diff --git a/Doxyfile b/Doxyfile index a71d68dc..7b9f483c 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.7 +# Doxyfile 1.8.9.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -46,10 +46,10 @@ PROJECT_NUMBER = PROJECT_BRIEF = -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. PROJECT_LOGO = @@ -60,7 +60,7 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where @@ -93,14 +93,14 @@ ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the @@ -145,7 +145,7 @@ ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. @@ -215,9 +215,9 @@ MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO @@ -286,7 +286,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # -# Note For files without extension you can use no_extension as a placeholder. +# Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. @@ -305,8 +305,8 @@ MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES @@ -346,7 +346,7 @@ SIP_SUPPORT = NO IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first +# tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. @@ -411,7 +411,7 @@ LOOKUP_CACHE_SIZE = 0 # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. @@ -421,35 +421,35 @@ LOOKUP_CACHE_SIZE = 0 EXTRACT_ALL = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. When set to YES local methods, +# This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are +# included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. @@ -474,21 +474,21 @@ HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be +# (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these +# documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. @@ -502,7 +502,7 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also +# names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. @@ -511,12 +511,19 @@ INTERNAL_DOCS = NO CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the +# their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -544,14 +551,14 @@ INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. +# name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = NO # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that +# name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. @@ -596,27 +603,25 @@ SORT_BY_SCOPE_NAME = NO STRICT_PROTO_MATCHING = NO -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. @@ -641,8 +646,8 @@ ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES @@ -690,8 +695,7 @@ LAYOUT_FILE = # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. +# search path. See also \cite for info how to create references. CITE_BIB_FILES = @@ -707,7 +711,7 @@ CITE_BIB_FILES = QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. @@ -715,7 +719,7 @@ QUIET = NO WARNINGS = YES -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. @@ -732,8 +736,8 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO @@ -914,7 +918,7 @@ INPUT_FILTER = FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for +# INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. @@ -974,7 +978,7 @@ REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. @@ -1021,7 +1025,7 @@ USE_HTAGS = NO VERBATIM_HEADERS = YES -# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the # clang parser (see: http://clang.llvm.org/) for more accurate parsing at the # cost of reduced performance. This can be particularly helpful with template # rich C++ code for which doxygen's built-in parser lacks the necessary type @@ -1070,7 +1074,7 @@ IGNORE_PREFIX = # Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES @@ -1132,13 +1136,15 @@ HTML_FOOTER = HTML_STYLESHEET = -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = imageStyle.css @@ -1154,7 +1160,7 @@ HTML_EXTRA_STYLESHEET = imageStyle.css HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to +# will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 @@ -1282,28 +1288,28 @@ GENERATE_HTMLHELP = NO CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1417,7 +1423,7 @@ DISABLE_INDEX = NO # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has @@ -1445,7 +1451,7 @@ ENUM_VALUES_PER_LINE = 4 TREEVIEW_WIDTH = 250 -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1474,7 +1480,7 @@ FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. @@ -1560,7 +1566,7 @@ SERVER_BASED_SEARCH = NO # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). # @@ -1573,7 +1579,7 @@ EXTERNAL_SEARCH = NO # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). See the section "External Indexing and # Searching" for details. @@ -1611,7 +1617,7 @@ EXTRA_SEARCH_MAPPINGS = # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO @@ -1642,7 +1648,7 @@ LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1676,23 +1682,36 @@ EXTRA_PACKAGES = # # Note: Only use a user-defined header if you know what you are doing! The # following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will -# replace them by respectively the title of the page, the current date and time, -# only the current date, the version number of doxygen, the project name (see -# PROJECT_NAME), or the project number (see PROJECT_NUMBER). +# $datetime, $date, $doxygenversion, $projectname, $projectnumber, +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. +# chapter. If it is left blank doxygen will generate a standard footer. See +# LATEX_HEADER for more information on how to generate a default footer and what +# special commands can be used inside the footer. # # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output # directory. Note that the files will be copied as-is; there are no commands or @@ -1710,8 +1729,8 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES -# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES to get a +# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate +# the PDF file directly from the LaTeX files. Set this option to YES, to get a # higher quality PDF documentation. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1756,7 +1775,7 @@ LATEX_BIB_STYLE = plain # Configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The # RTF output is optimized for Word 97 and may not look too pretty with other RTF # readers/editors. # The default value is: NO. @@ -1771,7 +1790,7 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1808,11 +1827,21 @@ RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for # classes and files. # The default value is: NO. @@ -1856,7 +1885,7 @@ MAN_LINKS = NO # Configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that # captures the structure of the code including all documentation. # The default value is: NO. @@ -1870,7 +1899,7 @@ GENERATE_XML = NO XML_OUTPUT = xml -# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to # the XML output. Note that enabling this will significantly increase the size # of the XML output. @@ -1883,7 +1912,7 @@ XML_PROGRAMLISTING = YES # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- -# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files # that can be used to generate PDF. # The default value is: NO. @@ -1897,14 +1926,23 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the +# program listings (including syntax highlighting and cross-referencing +# information) to the DOCBOOK output. Note that enabling this will significantly +# increase the size of the DOCBOOK output. +# The default value is: NO. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_PROGRAMLISTING = NO + #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen -# Definitions (see http://autogen.sf.net) file that captures the structure of -# the code including all documentation. Note that this feature is still -# experimental and incomplete at the moment. +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sf.net) file that captures the +# structure of the code including all documentation. Note that this feature is +# still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -1913,7 +1951,7 @@ GENERATE_AUTOGEN_DEF = NO # Configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module # file that captures the structure of the code including all documentation. # # Note that this feature is still experimental and incomplete at the moment. @@ -1921,7 +1959,7 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI # output from the Perl module output. # The default value is: NO. @@ -1929,9 +1967,9 @@ GENERATE_PERLMOD = NO PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely # formatted so it can be parsed by a human reader. This is useful if you want to -# understand what is going on. On the other hand, if this tag is set to NO the +# understand what is going on. On the other hand, if this tag is set to NO, the # size of the Perl module output will be much smaller and Perl will parse it # just the same. # The default value is: YES. @@ -1951,14 +1989,14 @@ PERLMOD_MAKEVAR_PREFIX = # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names -# in the source code. If set to NO only conditional compilation will be +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. @@ -1974,7 +2012,7 @@ MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES -# If the SEARCH_INCLUDES tag is set to YES the includes files in the +# If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -2054,20 +2092,21 @@ TAGFILES = GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES all external class will be listed in the -# class index. If set to NO only the inherited external classes will be listed. +# If the ALLEXTERNALS tag is set to YES, all external class will be listed in +# the class index. If set to NO, only the inherited external classes will be +# listed. # The default value is: NO. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in -# the modules index. If set to NO, only the current project's groups will be +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. @@ -2084,7 +2123,7 @@ PERL_PATH = /usr/bin/perl # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to # NO turns the diagrams off. Note that this option also works with HAVE_DOT # disabled, but it is recommended to install and use dot, since it yields more @@ -2109,7 +2148,7 @@ MSCGEN_PATH = DIA_PATH = -# If set to YES, the inheritance and collaboration graphs will hide inheritance +# If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2134,7 +2173,7 @@ HAVE_DOT = YES DOT_NUM_THREADS = 0 -# When you want a differently looking font n the dot files that doxygen +# When you want a differently looking font in the dot files that doxygen # generates you can specify the font name using DOT_FONTNAME. You need to make # sure dot is able to find the font, which can be done by putting it in a # standard location or by setting the DOTFONTPATH environment variable or by @@ -2182,7 +2221,7 @@ COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. @@ -2315,6 +2354,19 @@ MSCFILE_DIRS = DIAFILE_DIRS = +# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the +# path where java can find the plantuml.jar file. If left blank, it is assumed +# PlantUML is not used or called during a preprocessing step. Doxygen will +# generate a warning when it encounters a \startuml command in this case and +# will not generate output for the diagram. + +PLANTUML_JAR_PATH = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes # larger than this value, doxygen will truncate the graph, which is visualized @@ -2351,7 +2403,7 @@ MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. @@ -2368,7 +2420,7 @@ DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot # files that are used to generate the various graphs. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. diff --git a/_b_t_d_8cpp.html b/_b_t_d_8cpp.html index a4e00199..3a0d54f7 100644 --- a/_b_t_d_8cpp.html +++ b/_b_t_d_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: BTD.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -95,7 +96,7 @@ Include dependency graph for BTD.cpp:
- +

Go to the source code of this file.

@@ -104,7 +105,7 @@ Include dependency graph for BTD.cpp: diff --git a/_b_t_d_8cpp__incl.map b/_b_t_d_8cpp__incl.map index 542b27a5..15f4db02 100644 --- a/_b_t_d_8cpp__incl.map +++ b/_b_t_d_8cpp__incl.map @@ -1,4 +1,6 @@ - + + + diff --git a/_b_t_d_8cpp__incl.md5 b/_b_t_d_8cpp__incl.md5 index 93f257b8..b95131f9 100644 --- a/_b_t_d_8cpp__incl.md5 +++ b/_b_t_d_8cpp__incl.md5 @@ -1 +1 @@ -c765cc95de530749422030983e73bab2 \ No newline at end of file +a80eb4feea84cb3fbac6fb00fc2a6647 \ No newline at end of file diff --git a/_b_t_d_8cpp__incl.png b/_b_t_d_8cpp__incl.png index 59f0d439..55198ee9 100644 Binary files a/_b_t_d_8cpp__incl.png and b/_b_t_d_8cpp__incl.png differ diff --git a/_b_t_d_8cpp_source.html b/_b_t_d_8cpp_source.html index 52556a9f..72ff9ce9 100644 --- a/_b_t_d_8cpp_source.html +++ b/_b_t_d_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: BTD.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -148,12 +149,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
57 
58  AddressPool &addrPool = pUsb->GetAddressPool(); // Get memory address of USB device address pool
59 #ifdef EXTRADEBUG
-
60  Notify(PSTR("\r\nBTD ConfigureDevice"), 0x80);
+
60  Notify(PSTR("\r\nBTD ConfigureDevice"), 0x80);
61 #endif
62 
63  if(bAddress) { // Check if address has already been assigned to an instance
64 #ifdef DEBUG_USB_HOST
-
65  Notify(PSTR("\r\nAddress in use"), 0x80);
+
65  Notify(PSTR("\r\nAddress in use"), 0x80);
66 #endif
67  return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE;
68  }
@@ -161,14 +162,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
70  p = addrPool.GetUsbDevicePtr(0); // Get pointer to pseudo device with address 0 assigned
71  if(!p) {
72 #ifdef DEBUG_USB_HOST
-
73  Notify(PSTR("\r\nAddress not found"), 0x80);
+
73  Notify(PSTR("\r\nAddress not found"), 0x80);
74 #endif
75  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
76  }
77 
78  if(!p->epinfo) {
79 #ifdef DEBUG_USB_HOST
-
80  Notify(PSTR("\r\nepinfo is null"), 0x80);
+
80  Notify(PSTR("\r\nepinfo is null"), 0x80);
81 #endif
82  return USB_ERROR_EPINFO_IS_NULL;
83  }
@@ -187,7 +188,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
96 
97  if(!bAddress) {
98 #ifdef DEBUG_USB_HOST
-
99  Notify(PSTR("\r\nOut of address space"), 0x80);
+
99  Notify(PSTR("\r\nOut of address space"), 0x80);
100 #endif
101  return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL;
102  }
@@ -217,13 +218,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
126 
127  AddressPool &addrPool = pUsb->GetAddressPool();
128 #ifdef EXTRADEBUG
-
129  Notify(PSTR("\r\nBTD Init"), 0x80);
+
129  Notify(PSTR("\r\nBTD Init"), 0x80);
130 #endif
131  UsbDevice *p = addrPool.GetUsbDevicePtr(bAddress); // Get pointer to assigned address record
132 
133  if(!p) {
134 #ifdef DEBUG_USB_HOST
-
135  Notify(PSTR("\r\nAddress not found"), 0x80);
+
135  Notify(PSTR("\r\nAddress not found"), 0x80);
136 #endif
137  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
138  }
@@ -233,14 +234,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
142  rcode = pUsb->setAddr(0, 0, bAddress); // Assign new address to the device
143  if(rcode) {
144 #ifdef DEBUG_USB_HOST
-
145  Notify(PSTR("\r\nsetAddr: "), 0x80);
+
145  Notify(PSTR("\r\nsetAddr: "), 0x80);
146  D_PrintHex<uint8_t > (rcode, 0x80);
147 #endif
148  p->lowspeed = false;
149  goto Fail;
150  }
151 #ifdef EXTRADEBUG
-
152  Notify(PSTR("\r\nAddr: "), 0x80);
+
152  Notify(PSTR("\r\nAddr: "), 0x80);
153  D_PrintHex<uint8_t > (bAddress, 0x80);
154 #endif
155 
@@ -249,7 +250,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
158  p = addrPool.GetUsbDevicePtr(bAddress); // Get pointer to assigned address record
159  if(!p) {
160 #ifdef DEBUG_USB_HOST
-
161  Notify(PSTR("\r\nAddress not found"), 0x80);
+
161  Notify(PSTR("\r\nAddress not found"), 0x80);
162 #endif
163  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
164  }
@@ -269,16 +270,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
178 #ifdef DEBUG_USB_HOST
179  if(PID == PS3_PID || PID == PS3NAVIGATION_PID) {
180  if(PID == PS3_PID)
-
181  Notify(PSTR("\r\nDualshock 3 Controller Connected"), 0x80);
+
181  Notify(PSTR("\r\nDualshock 3 Controller Connected"), 0x80);
182  else // It must be a navigation controller
-
183  Notify(PSTR("\r\nNavigation Controller Connected"), 0x80);
+
183  Notify(PSTR("\r\nNavigation Controller Connected"), 0x80);
184  } else // It must be a Motion controller
-
185  Notify(PSTR("\r\nMotion Controller Connected"), 0x80);
+
185  Notify(PSTR("\r\nMotion Controller Connected"), 0x80);
186 #endif
187 
188  if(my_bdaddr[0] == 0x00 && my_bdaddr[1] == 0x00 && my_bdaddr[2] == 0x00 && my_bdaddr[3] == 0x00 && my_bdaddr[4] == 0x00 && my_bdaddr[5] == 0x00) {
189 #ifdef DEBUG_USB_HOST
-
190  Notify(PSTR("\r\nPlease plug in the dongle before trying to pair with the PS3 Controller\r\nor set the Bluetooth address in the constructor of the PS3BT class"), 0x80);
+
190  Notify(PSTR("\r\nPlease plug in the dongle before trying to pair with the PS3 Controller\r\nor set the Bluetooth address in the constructor of the PS3BT class"), 0x80);
191 #endif
192  } else {
193  if(PID == PS3_PID || PID == PS3NAVIGATION_PID)
@@ -286,10 +287,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
195  else
196  setMoveBdaddr(my_bdaddr); // Set internal Bluetooth address
197 #ifdef DEBUG_USB_HOST
-
198  Notify(PSTR("\r\nBluetooth Address was set to: "), 0x80);
+
198  Notify(PSTR("\r\nBluetooth Address was set to: "), 0x80);
199  for(int8_t i = 5; i > 0; i--) {
200  D_PrintHex<uint8_t > (my_bdaddr[i], 0x80);
-
201  Notify(PSTR(":"), 0x80);
+
201  Notify(PSTR(":"), 0x80);
202  }
203  D_PrintHex<uint8_t > (my_bdaddr[0], 0x80);
204 #endif
@@ -337,7 +338,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
246  bPollEnable = true;
247 
248 #ifdef DEBUG_USB_HOST
-
249  Notify(PSTR("\r\nBluetooth Dongle Initialized"), 0x80);
+
249  Notify(PSTR("\r\nBluetooth Dongle Initialized"), 0x80);
250 #endif
251  }
252  return 0; // Successful configuration
@@ -369,7 +370,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
278  rcode = USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED;
279 Fail:
280 #ifdef DEBUG_USB_HOST
-
281  Notify(PSTR("\r\nBTD Init Failed, error code: "), 0x80);
+
281  Notify(PSTR("\r\nBTD Init Failed, error code: "), 0x80);
282  NotifyFail(rcode);
283 #endif
284  Release();
@@ -386,7 +387,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
295  }
296  for(i = 0; i < BTD_NUM_SERVICES; i++) {
297  if(btService[i])
-
298  btService[i]->Reset(); // Reset all Bluetooth services
+
298  btService[i]->Reset(); // Reset all Bluetooth services
299  }
300 
301  connectToWii = false;
@@ -436,18 +437,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
345 
346 void BTD::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) {
347 #ifdef EXTRADEBUG
-
348  Notify(PSTR("\r\nEndpoint descriptor:"), 0x80);
-
349  Notify(PSTR("\r\nLength:\t\t"), 0x80);
+
348  Notify(PSTR("\r\nEndpoint descriptor:"), 0x80);
+
349  Notify(PSTR("\r\nLength:\t\t"), 0x80);
350  D_PrintHex<uint8_t > (ep_ptr->bLength, 0x80);
-
351  Notify(PSTR("\r\nType:\t\t"), 0x80);
+
351  Notify(PSTR("\r\nType:\t\t"), 0x80);
352  D_PrintHex<uint8_t > (ep_ptr->bDescriptorType, 0x80);
-
353  Notify(PSTR("\r\nAddress:\t"), 0x80);
+
353  Notify(PSTR("\r\nAddress:\t"), 0x80);
354  D_PrintHex<uint8_t > (ep_ptr->bEndpointAddress, 0x80);
-
355  Notify(PSTR("\r\nAttributes:\t"), 0x80);
+
355  Notify(PSTR("\r\nAttributes:\t"), 0x80);
356  D_PrintHex<uint8_t > (ep_ptr->bmAttributes, 0x80);
-
357  Notify(PSTR("\r\nMaxPktSize:\t"), 0x80);
+
357  Notify(PSTR("\r\nMaxPktSize:\t"), 0x80);
358  D_PrintHex<uint16_t > (ep_ptr->wMaxPacketSize, 0x80);
-
359  Notify(PSTR("\r\nPoll Intrv:\t"), 0x80);
+
359  Notify(PSTR("\r\nPoll Intrv:\t"), 0x80);
360  D_PrintHex<uint8_t > (ep_ptr->bInterval, 0x80);
361 #endif
362 }
@@ -471,1177 +472,1188 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
380  return 0;
381 }
382 
-
383 void BTD::HCI_event_task() {
-
384  uint16_t length = BULK_MAXPKTSIZE; // Request more than 16 bytes anyway, the inTransfer routine will take care of this
-
385  uint8_t rcode = pUsb->inTransfer(bAddress, epInfo[ BTD_EVENT_PIPE ].epAddr, &length, hcibuf); // Input on endpoint 1
-
386 
-
387  if(!rcode || rcode == hrNAK) { // Check for errors
-
388  switch(hcibuf[0]) { // Switch on event type
-
389  case EV_COMMAND_COMPLETE:
-
390  if(!hcibuf[5]) { // Check if command succeeded
-
391  hci_set_flag(HCI_FLAG_CMD_COMPLETE); // Set command complete flag
-
392  if((hcibuf[3] == 0x01) && (hcibuf[4] == 0x10)) { // Parameters from read local version information
-
393  hci_version = hcibuf[6]; // Used to check if it supports 2.0+EDR - see http://www.bluetooth.org/Technical/AssignedNumbers/hci.htm
-
394  hci_set_flag(HCI_FLAG_READ_VERSION);
-
395  } else if((hcibuf[3] == 0x09) && (hcibuf[4] == 0x10)) { // Parameters from read local bluetooth address
-
396  for(uint8_t i = 0; i < 6; i++)
-
397  my_bdaddr[i] = hcibuf[6 + i];
-
398  hci_set_flag(HCI_FLAG_READ_BDADDR);
-
399  }
-
400  }
-
401  break;
-
402 
-
403  case EV_COMMAND_STATUS:
-
404  if(hcibuf[2]) { // Show status on serial if not OK
-
405 #ifdef DEBUG_USB_HOST
-
406  Notify(PSTR("\r\nHCI Command Failed: "), 0x80);
-
407  D_PrintHex<uint8_t > (hcibuf[2], 0x80);
-
408 #endif
-
409  }
-
410  break;
-
411 
-
412  case EV_INQUIRY_COMPLETE:
-
413  if(inquiry_counter >= 5 && (pairWithWii || pairWithHIDDevice)) {
-
414  inquiry_counter = 0;
-
415 #ifdef DEBUG_USB_HOST
-
416  if(pairWithWii)
-
417  Notify(PSTR("\r\nCouldn't find Wiimote"), 0x80);
-
418  else
-
419  Notify(PSTR("\r\nCouldn't find HID device"), 0x80);
-
420 #endif
-
421  connectToWii = false;
-
422  pairWithWii = false;
-
423  connectToHIDDevice = false;
-
424  pairWithHIDDevice = false;
-
425  hci_state = HCI_SCANNING_STATE;
-
426  }
-
427  inquiry_counter++;
-
428  break;
-
429 
-
430  case EV_INQUIRY_RESULT:
-
431  if(hcibuf[2]) { // Check that there is more than zero responses
-
432 #ifdef EXTRADEBUG
-
433  Notify(PSTR("\r\nNumber of responses: "), 0x80);
-
434  Notify(hcibuf[2], 0x80);
-
435 #endif
-
436  for(uint8_t i = 0; i < hcibuf[2]; i++) {
-
437  uint8_t offset = 8 * hcibuf[2] + 3 * i;
-
438 
-
439  for(uint8_t j = 0; j < 3; j++)
-
440  classOfDevice[j] = hcibuf[j + 4 + offset];
-
441 
-
442  if(pairWithWii && classOfDevice[2] == 0x00 && (classOfDevice[1] & 0x05) && (classOfDevice[0] & 0x0C)) { // See http://wiibrew.org/wiki/Wiimote#SDP_information
-
443  if(classOfDevice[0] & 0x08) // Check if it's the new Wiimote with motion plus inside that was detected
-
444  motionPlusInside = true;
-
445  else
-
446  motionPlusInside = false;
+
383 void BTD::disconnect() {
+
384  for(uint8_t i = 0; i < BTD_NUM_SERVICES; i++)
+
385  if(btService[i])
+
386  btService[i]->disconnect();
+
387 };
+
388 
+
389 void BTD::HCI_event_task() {
+
390  uint16_t length = BULK_MAXPKTSIZE; // Request more than 16 bytes anyway, the inTransfer routine will take care of this
+
391  uint8_t rcode = pUsb->inTransfer(bAddress, epInfo[ BTD_EVENT_PIPE ].epAddr, &length, hcibuf); // Input on endpoint 1
+
392 
+
393  if(!rcode || rcode == hrNAK) { // Check for errors
+
394  switch(hcibuf[0]) { // Switch on event type
+
395  case EV_COMMAND_COMPLETE:
+
396  if(!hcibuf[5]) { // Check if command succeeded
+
397  hci_set_flag(HCI_FLAG_CMD_COMPLETE); // Set command complete flag
+
398  if((hcibuf[3] == 0x01) && (hcibuf[4] == 0x10)) { // Parameters from read local version information
+
399  hci_version = hcibuf[6]; // Used to check if it supports 2.0+EDR - see http://www.bluetooth.org/Technical/AssignedNumbers/hci.htm
+
400  hci_set_flag(HCI_FLAG_READ_VERSION);
+
401  } else if((hcibuf[3] == 0x09) && (hcibuf[4] == 0x10)) { // Parameters from read local bluetooth address
+
402  for(uint8_t i = 0; i < 6; i++)
+
403  my_bdaddr[i] = hcibuf[6 + i];
+
404  hci_set_flag(HCI_FLAG_READ_BDADDR);
+
405  }
+
406  }
+
407  break;
+
408 
+
409  case EV_COMMAND_STATUS:
+
410  if(hcibuf[2]) { // Show status on serial if not OK
+
411 #ifdef DEBUG_USB_HOST
+
412  Notify(PSTR("\r\nHCI Command Failed: "), 0x80);
+
413  D_PrintHex<uint8_t > (hcibuf[2], 0x80);
+
414 #endif
+
415  }
+
416  break;
+
417 
+
418  case EV_INQUIRY_COMPLETE:
+
419  if(inquiry_counter >= 5 && (pairWithWii || pairWithHIDDevice)) {
+
420  inquiry_counter = 0;
+
421 #ifdef DEBUG_USB_HOST
+
422  if(pairWithWii)
+
423  Notify(PSTR("\r\nCouldn't find Wiimote"), 0x80);
+
424  else
+
425  Notify(PSTR("\r\nCouldn't find HID device"), 0x80);
+
426 #endif
+
427  connectToWii = false;
+
428  pairWithWii = false;
+
429  connectToHIDDevice = false;
+
430  pairWithHIDDevice = false;
+
431  hci_state = HCI_SCANNING_STATE;
+
432  }
+
433  inquiry_counter++;
+
434  break;
+
435 
+
436  case EV_INQUIRY_RESULT:
+
437  if(hcibuf[2]) { // Check that there is more than zero responses
+
438 #ifdef EXTRADEBUG
+
439  Notify(PSTR("\r\nNumber of responses: "), 0x80);
+
440  Notify(hcibuf[2], 0x80);
+
441 #endif
+
442  for(uint8_t i = 0; i < hcibuf[2]; i++) {
+
443  uint8_t offset = 8 * hcibuf[2] + 3 * i;
+
444 
+
445  for(uint8_t j = 0; j < 3; j++)
+
446  classOfDevice[j] = hcibuf[j + 4 + offset];
447 
-
448  for(uint8_t j = 0; j < 6; j++)
-
449  disc_bdaddr[j] = hcibuf[j + 3 + 6 * i];
-
450 
-
451  hci_set_flag(HCI_FLAG_DEVICE_FOUND);
-
452  break;
-
453  } else if(pairWithHIDDevice && (classOfDevice[1] & 0x05) && (classOfDevice[0] & 0xC8)) { // Check if it is a mouse, keyboard or a gamepad - see: http://bluetooth-pentest.narod.ru/software/bluetooth_class_of_device-service_generator.html
-
454 #ifdef DEBUG_USB_HOST
-
455  if(classOfDevice[0] & 0x80)
-
456  Notify(PSTR("\r\nMouse found"), 0x80);
-
457  if(classOfDevice[0] & 0x40)
-
458  Notify(PSTR("\r\nKeyboard found"), 0x80);
-
459  if(classOfDevice[0] & 0x08)
-
460  Notify(PSTR("\r\nGamepad found"), 0x80);
-
461 #endif
-
462 
-
463  for(uint8_t j = 0; j < 6; j++)
-
464  disc_bdaddr[j] = hcibuf[j + 3 + 6 * i];
-
465 
-
466  hci_set_flag(HCI_FLAG_DEVICE_FOUND);
-
467  }
-
468 #ifdef EXTRADEBUG
-
469  else {
-
470  Notify(PSTR("\r\nClass of device: "), 0x80);
-
471  D_PrintHex<uint8_t > (classOfDevice[2], 0x80);
-
472  Notify(PSTR(" "), 0x80);
-
473  D_PrintHex<uint8_t > (classOfDevice[1], 0x80);
-
474  Notify(PSTR(" "), 0x80);
-
475  D_PrintHex<uint8_t > (classOfDevice[0], 0x80);
-
476  }
-
477 #endif
-
478  }
-
479  }
-
480  break;
-
481 
-
482  case EV_CONNECT_COMPLETE:
-
483  hci_set_flag(HCI_FLAG_CONNECT_EVENT);
-
484  if(!hcibuf[2]) { // Check if connected OK
-
485 #ifdef EXTRADEBUG
-
486  Notify(PSTR("\r\nConnection established"), 0x80);
-
487 #endif
-
488  hci_handle = hcibuf[3] | ((hcibuf[4] & 0x0F) << 8); // Store the handle for the ACL connection
-
489  hci_set_flag(HCI_FLAG_CONNECT_COMPLETE); // Set connection complete flag
-
490  } else {
-
491  hci_state = HCI_CHECK_DEVICE_SERVICE;
-
492 #ifdef DEBUG_USB_HOST
-
493  Notify(PSTR("\r\nConnection Failed: "), 0x80);
-
494  D_PrintHex<uint8_t > (hcibuf[2], 0x80);
-
495 #endif
-
496  }
-
497  break;
-
498 
-
499  case EV_DISCONNECT_COMPLETE:
-
500  if(!hcibuf[2]) { // Check if disconnected OK
-
501  hci_set_flag(HCI_FLAG_DISCONNECT_COMPLETE); // Set disconnect command complete flag
-
502  hci_clear_flag(HCI_FLAG_CONNECT_COMPLETE); // Clear connection complete flag
+
448  if(pairWithWii && classOfDevice[2] == 0x00 && (classOfDevice[1] & 0x05) && (classOfDevice[0] & 0x0C)) { // See http://wiibrew.org/wiki/Wiimote#SDP_information
+
449  if(classOfDevice[0] & 0x08) // Check if it's the new Wiimote with motion plus inside that was detected
+
450  motionPlusInside = true;
+
451  else
+
452  motionPlusInside = false;
+
453 
+
454  for(uint8_t j = 0; j < 6; j++)
+
455  disc_bdaddr[j] = hcibuf[j + 3 + 6 * i];
+
456 
+
457  hci_set_flag(HCI_FLAG_DEVICE_FOUND);
+
458  break;
+
459  } else if(pairWithHIDDevice && (classOfDevice[1] & 0x05) && (classOfDevice[0] & 0xC8)) { // Check if it is a mouse, keyboard or a gamepad - see: http://bluetooth-pentest.narod.ru/software/bluetooth_class_of_device-service_generator.html
+
460 #ifdef DEBUG_USB_HOST
+
461  if(classOfDevice[0] & 0x80)
+
462  Notify(PSTR("\r\nMouse found"), 0x80);
+
463  if(classOfDevice[0] & 0x40)
+
464  Notify(PSTR("\r\nKeyboard found"), 0x80);
+
465  if(classOfDevice[0] & 0x08)
+
466  Notify(PSTR("\r\nGamepad found"), 0x80);
+
467 #endif
+
468 
+
469  for(uint8_t j = 0; j < 6; j++)
+
470  disc_bdaddr[j] = hcibuf[j + 3 + 6 * i];
+
471 
+
472  hci_set_flag(HCI_FLAG_DEVICE_FOUND);
+
473  break;
+
474  }
+
475 #ifdef EXTRADEBUG
+
476  else {
+
477  Notify(PSTR("\r\nClass of device: "), 0x80);
+
478  D_PrintHex<uint8_t > (classOfDevice[2], 0x80);
+
479  Notify(PSTR(" "), 0x80);
+
480  D_PrintHex<uint8_t > (classOfDevice[1], 0x80);
+
481  Notify(PSTR(" "), 0x80);
+
482  D_PrintHex<uint8_t > (classOfDevice[0], 0x80);
+
483  }
+
484 #endif
+
485  }
+
486  }
+
487  break;
+
488 
+
489  case EV_CONNECT_COMPLETE:
+
490  hci_set_flag(HCI_FLAG_CONNECT_EVENT);
+
491  if(!hcibuf[2]) { // Check if connected OK
+
492 #ifdef EXTRADEBUG
+
493  Notify(PSTR("\r\nConnection established"), 0x80);
+
494 #endif
+
495  hci_handle = hcibuf[3] | ((hcibuf[4] & 0x0F) << 8); // Store the handle for the ACL connection
+
496  hci_set_flag(HCI_FLAG_CONNECT_COMPLETE); // Set connection complete flag
+
497  } else {
+
498  hci_state = HCI_CHECK_DEVICE_SERVICE;
+
499 #ifdef DEBUG_USB_HOST
+
500  Notify(PSTR("\r\nConnection Failed: "), 0x80);
+
501  D_PrintHex<uint8_t > (hcibuf[2], 0x80);
+
502 #endif
503  }
504  break;
505 
-
506  case EV_REMOTE_NAME_COMPLETE:
-
507  if(!hcibuf[2]) { // Check if reading is OK
-
508  for(uint8_t i = 0; i < min(sizeof (remote_name), sizeof (hcibuf) - 9); i++) {
-
509  remote_name[i] = hcibuf[9 + i];
-
510  if(remote_name[i] == '\0') // End of string
-
511  break;
-
512  }
-
513  hci_set_flag(HCI_FLAG_REMOTE_NAME_COMPLETE);
-
514  }
-
515  break;
-
516 
-
517  case EV_INCOMING_CONNECT:
-
518  for(uint8_t i = 0; i < 6; i++)
-
519  disc_bdaddr[i] = hcibuf[i + 2];
-
520 
-
521  for(uint8_t i = 0; i < 3; i++)
-
522  classOfDevice[i] = hcibuf[i + 8];
-
523 
-
524  if((classOfDevice[1] & 0x05) && (classOfDevice[0] & 0xC8)) { // Check if it is a mouse, keyboard or a gamepad
-
525 #ifdef DEBUG_USB_HOST
-
526  if(classOfDevice[0] & 0x80)
-
527  Notify(PSTR("\r\nMouse is connecting"), 0x80);
-
528  if(classOfDevice[0] & 0x40)
-
529  Notify(PSTR("\r\nKeyboard is connecting"), 0x80);
-
530  if(classOfDevice[0] & 0x08)
-
531  Notify(PSTR("\r\nGamepad is connecting"), 0x80);
-
532 #endif
-
533  incomingHIDDevice = true;
-
534  }
-
535 
-
536 #ifdef EXTRADEBUG
-
537  Notify(PSTR("\r\nClass of device: "), 0x80);
-
538  D_PrintHex<uint8_t > (classOfDevice[2], 0x80);
-
539  Notify(PSTR(" "), 0x80);
-
540  D_PrintHex<uint8_t > (classOfDevice[1], 0x80);
-
541  Notify(PSTR(" "), 0x80);
-
542  D_PrintHex<uint8_t > (classOfDevice[0], 0x80);
-
543 #endif
-
544  hci_set_flag(HCI_FLAG_INCOMING_REQUEST);
-
545  break;
-
546 
-
547  case EV_PIN_CODE_REQUEST:
-
548  if(pairWithWii) {
-
549 #ifdef DEBUG_USB_HOST
-
550  Notify(PSTR("\r\nPairing with wiimote"), 0x80);
+
506  case EV_DISCONNECT_COMPLETE:
+
507  if(!hcibuf[2]) { // Check if disconnected OK
+
508  hci_set_flag(HCI_FLAG_DISCONNECT_COMPLETE); // Set disconnect command complete flag
+
509  hci_clear_flag(HCI_FLAG_CONNECT_COMPLETE); // Clear connection complete flag
+
510  }
+
511  break;
+
512 
+
513  case EV_REMOTE_NAME_COMPLETE:
+
514  if(!hcibuf[2]) { // Check if reading is OK
+
515  for(uint8_t i = 0; i < min(sizeof (remote_name), sizeof (hcibuf) - 9); i++) {
+
516  remote_name[i] = hcibuf[9 + i];
+
517  if(remote_name[i] == '\0') // End of string
+
518  break;
+
519  }
+
520  // TODO: Altid sæt '\0' i remote name!
+
521  hci_set_flag(HCI_FLAG_REMOTE_NAME_COMPLETE);
+
522  }
+
523  break;
+
524 
+
525  case EV_INCOMING_CONNECT:
+
526  for(uint8_t i = 0; i < 6; i++)
+
527  disc_bdaddr[i] = hcibuf[i + 2];
+
528 
+
529  for(uint8_t i = 0; i < 3; i++)
+
530  classOfDevice[i] = hcibuf[i + 8];
+
531 
+
532  if((classOfDevice[1] & 0x05) && (classOfDevice[0] & 0xC8)) { // Check if it is a mouse, keyboard or a gamepad
+
533 #ifdef DEBUG_USB_HOST
+
534  if(classOfDevice[0] & 0x80)
+
535  Notify(PSTR("\r\nMouse is connecting"), 0x80);
+
536  if(classOfDevice[0] & 0x40)
+
537  Notify(PSTR("\r\nKeyboard is connecting"), 0x80);
+
538  if(classOfDevice[0] & 0x08)
+
539  Notify(PSTR("\r\nGamepad is connecting"), 0x80);
+
540 #endif
+
541  incomingHIDDevice = true;
+
542  }
+
543 
+
544 #ifdef EXTRADEBUG
+
545  Notify(PSTR("\r\nClass of device: "), 0x80);
+
546  D_PrintHex<uint8_t > (classOfDevice[2], 0x80);
+
547  Notify(PSTR(" "), 0x80);
+
548  D_PrintHex<uint8_t > (classOfDevice[1], 0x80);
+
549  Notify(PSTR(" "), 0x80);
+
550  D_PrintHex<uint8_t > (classOfDevice[0], 0x80);
551 #endif
-
552  hci_pin_code_request_reply();
-
553  } else if(btdPin != NULL) {
-
554 #ifdef DEBUG_USB_HOST
-
555  Notify(PSTR("\r\nBluetooth pin is set too: "), 0x80);
-
556  NotifyStr(btdPin, 0x80);
-
557 #endif
-
558  hci_pin_code_request_reply();
-
559  } else {
-
560 #ifdef DEBUG_USB_HOST
-
561  Notify(PSTR("\r\nNo pin was set"), 0x80);
-
562 #endif
-
563  hci_pin_code_negative_request_reply();
-
564  }
-
565  break;
-
566 
-
567  case EV_LINK_KEY_REQUEST:
+
552  hci_set_flag(HCI_FLAG_INCOMING_REQUEST);
+
553  break;
+
554 
+
555  case EV_PIN_CODE_REQUEST:
+
556  if(pairWithWii) {
+
557 #ifdef DEBUG_USB_HOST
+
558  Notify(PSTR("\r\nPairing with wiimote"), 0x80);
+
559 #endif
+
560  hci_pin_code_request_reply();
+
561  } else if(btdPin != NULL) {
+
562 #ifdef DEBUG_USB_HOST
+
563  Notify(PSTR("\r\nBluetooth pin is set too: "), 0x80);
+
564  NotifyStr(btdPin, 0x80);
+
565 #endif
+
566  hci_pin_code_request_reply();
+
567  } else {
568 #ifdef DEBUG_USB_HOST
-
569  Notify(PSTR("\r\nReceived Key Request"), 0x80);
+
569  Notify(PSTR("\r\nNo pin was set"), 0x80);
570 #endif
-
571  hci_link_key_request_negative_reply();
-
572  break;
-
573 
-
574  case EV_AUTHENTICATION_COMPLETE:
-
575  if(pairWithWii && !connectToWii) {
+
571  hci_pin_code_negative_request_reply();
+
572  }
+
573  break;
+
574 
+
575  case EV_LINK_KEY_REQUEST:
576 #ifdef DEBUG_USB_HOST
-
577  Notify(PSTR("\r\nPairing successful with Wiimote"), 0x80);
+
577  Notify(PSTR("\r\nReceived Key Request"), 0x80);
578 #endif
-
579  connectToWii = true; // Used to indicate to the Wii service, that it should connect to this device
-
580  } else if(pairWithHIDDevice && !connectToHIDDevice) {
-
581 #ifdef DEBUG_USB_HOST
-
582  Notify(PSTR("\r\nPairing successful with HID device"), 0x80);
-
583 #endif
-
584  connectToHIDDevice = true; // Used to indicate to the BTHID service, that it should connect to this device
-
585  }
-
586  break;
-
587  /* We will just ignore the following events */
-
588  case EV_NUM_COMPLETE_PKT:
-
589  case EV_ROLE_CHANGED:
-
590  case EV_PAGE_SCAN_REP_MODE:
-
591  case EV_LOOPBACK_COMMAND:
-
592  case EV_DATA_BUFFER_OVERFLOW:
-
593  case EV_CHANGE_CONNECTION_LINK:
-
594  case EV_MAX_SLOTS_CHANGE:
-
595  case EV_QOS_SETUP_COMPLETE:
-
596  case EV_LINK_KEY_NOTIFICATION:
-
597  case EV_ENCRYPTION_CHANGE:
-
598  case EV_READ_REMOTE_VERSION_INFORMATION_COMPLETE:
-
599  break;
-
600 #ifdef EXTRADEBUG
-
601  default:
-
602  if(hcibuf[0] != 0x00) {
-
603  Notify(PSTR("\r\nUnmanaged HCI Event: "), 0x80);
-
604  D_PrintHex<uint8_t > (hcibuf[0], 0x80);
-
605  }
-
606  break;
-
607 #endif
-
608  } // Switch
-
609  }
-
610 #ifdef EXTRADEBUG
-
611  else {
-
612  Notify(PSTR("\r\nHCI event error: "), 0x80);
-
613  D_PrintHex<uint8_t > (rcode, 0x80);
-
614  }
+
579  hci_link_key_request_negative_reply();
+
580  break;
+
581 
+
582  case EV_AUTHENTICATION_COMPLETE:
+
583  if(pairWithWii && !connectToWii) {
+
584 #ifdef DEBUG_USB_HOST
+
585  Notify(PSTR("\r\nPairing successful with Wiimote"), 0x80);
+
586 #endif
+
587  connectToWii = true; // Used to indicate to the Wii service, that it should connect to this device
+
588  } else if(pairWithHIDDevice && !connectToHIDDevice) {
+
589 #ifdef DEBUG_USB_HOST
+
590  Notify(PSTR("\r\nPairing successful with HID device"), 0x80);
+
591 #endif
+
592  connectToHIDDevice = true; // Used to indicate to the BTHID service, that it should connect to this device
+
593  }
+
594  break;
+
595  /* We will just ignore the following events */
+
596  case EV_NUM_COMPLETE_PKT:
+
597  case EV_ROLE_CHANGED:
+
598  case EV_PAGE_SCAN_REP_MODE:
+
599  case EV_LOOPBACK_COMMAND:
+
600  case EV_DATA_BUFFER_OVERFLOW:
+
601  case EV_CHANGE_CONNECTION_LINK:
+
602  case EV_MAX_SLOTS_CHANGE:
+
603  case EV_QOS_SETUP_COMPLETE:
+
604  case EV_LINK_KEY_NOTIFICATION:
+
605  case EV_ENCRYPTION_CHANGE:
+
606  case EV_READ_REMOTE_VERSION_INFORMATION_COMPLETE:
+
607  break;
+
608 #ifdef EXTRADEBUG
+
609  default:
+
610  if(hcibuf[0] != 0x00) {
+
611  Notify(PSTR("\r\nUnmanaged HCI Event: "), 0x80);
+
612  D_PrintHex<uint8_t > (hcibuf[0], 0x80);
+
613  }
+
614  break;
615 #endif
-
616 }
-
617 
-
618 /* Poll Bluetooth and print result */
-
619 void BTD::HCI_task() {
-
620  switch(hci_state) {
-
621  case HCI_INIT_STATE:
-
622  hci_counter++;
-
623  if(hci_counter > hci_num_reset_loops) { // wait until we have looped x times to clear any old events
-
624  hci_reset();
-
625  hci_state = HCI_RESET_STATE;
-
626  hci_counter = 0;
-
627  }
-
628  break;
-
629 
-
630  case HCI_RESET_STATE:
-
631  hci_counter++;
-
632  if(hci_check_flag(HCI_FLAG_CMD_COMPLETE)) {
-
633  hci_counter = 0;
-
634 #ifdef DEBUG_USB_HOST
-
635  Notify(PSTR("\r\nHCI Reset complete"), 0x80);
-
636 #endif
-
637  hci_state = HCI_CLASS_STATE;
-
638  hci_write_class_of_device();
-
639  } else if(hci_counter > hci_num_reset_loops) {
-
640  hci_num_reset_loops *= 10;
-
641  if(hci_num_reset_loops > 2000)
-
642  hci_num_reset_loops = 2000;
-
643 #ifdef DEBUG_USB_HOST
-
644  Notify(PSTR("\r\nNo response to HCI Reset"), 0x80);
-
645 #endif
-
646  hci_state = HCI_INIT_STATE;
-
647  hci_counter = 0;
-
648  }
-
649  break;
-
650 
-
651  case HCI_CLASS_STATE:
-
652  if(hci_check_flag(HCI_FLAG_CMD_COMPLETE)) {
-
653 #ifdef DEBUG_USB_HOST
-
654  Notify(PSTR("\r\nWrite class of device"), 0x80);
-
655 #endif
-
656  hci_state = HCI_BDADDR_STATE;
-
657  hci_read_bdaddr();
-
658  }
-
659  break;
-
660 
-
661  case HCI_BDADDR_STATE:
-
662  if(hci_check_flag(HCI_FLAG_READ_BDADDR)) {
-
663 #ifdef DEBUG_USB_HOST
-
664  Notify(PSTR("\r\nLocal Bluetooth Address: "), 0x80);
-
665  for(int8_t i = 5; i > 0; i--) {
-
666  D_PrintHex<uint8_t > (my_bdaddr[i], 0x80);
-
667  Notify(PSTR(":"), 0x80);
-
668  }
-
669  D_PrintHex<uint8_t > (my_bdaddr[0], 0x80);
-
670 #endif
-
671  hci_read_local_version_information();
-
672  hci_state = HCI_LOCAL_VERSION_STATE;
-
673  }
-
674  break;
-
675 
-
676  case HCI_LOCAL_VERSION_STATE: // The local version is used by the PS3BT class
-
677  if(hci_check_flag(HCI_FLAG_READ_VERSION)) {
-
678  if(btdName != NULL) {
-
679  hci_set_local_name(btdName);
-
680  hci_state = HCI_SET_NAME_STATE;
-
681  } else
-
682  hci_state = HCI_CHECK_DEVICE_SERVICE;
-
683  }
-
684  break;
-
685 
-
686  case HCI_SET_NAME_STATE:
-
687  if(hci_check_flag(HCI_FLAG_CMD_COMPLETE)) {
-
688 #ifdef DEBUG_USB_HOST
-
689  Notify(PSTR("\r\nThe name is set to: "), 0x80);
-
690  NotifyStr(btdName, 0x80);
-
691 #endif
-
692  hci_state = HCI_CHECK_DEVICE_SERVICE;
-
693  }
-
694  break;
-
695 
-
696  case HCI_CHECK_DEVICE_SERVICE:
-
697  if(pairWithHIDDevice || pairWithWii) { // Check if it should try to connect to a Wiimote
-
698 #ifdef DEBUG_USB_HOST
-
699  if(pairWithWii)
-
700  Notify(PSTR("\r\nStarting inquiry\r\nPress 1 & 2 on the Wiimote\r\nOr press sync if you are using a Wii U Pro Controller"), 0x80);
-
701  else
-
702  Notify(PSTR("\r\nPlease enable discovery of your device"), 0x80);
-
703 #endif
-
704  hci_inquiry();
-
705  hci_state = HCI_INQUIRY_STATE;
-
706  } else
-
707  hci_state = HCI_SCANNING_STATE; // Don't try to connect to a Wiimote
-
708  break;
-
709 
-
710  case HCI_INQUIRY_STATE:
-
711  if(hci_check_flag(HCI_FLAG_DEVICE_FOUND)) {
-
712  hci_inquiry_cancel(); // Stop inquiry
-
713 #ifdef DEBUG_USB_HOST
-
714  if(pairWithWii)
-
715  Notify(PSTR("\r\nWiimote found"), 0x80);
-
716  else
-
717  Notify(PSTR("\r\nHID device found"), 0x80);
-
718 
-
719  Notify(PSTR("\r\nNow just create the instance like so:"), 0x80);
-
720  if(pairWithWii)
-
721  Notify(PSTR("\r\nWII Wii(&Btd);"), 0x80);
-
722  else
-
723  Notify(PSTR("\r\nBTHID bthid(&Btd);"), 0x80);
-
724 
-
725  Notify(PSTR("\r\nAnd then press any button on the "), 0x80);
-
726  if(pairWithWii)
-
727  Notify(PSTR("Wiimote"), 0x80);
-
728  else
-
729  Notify(PSTR("device"), 0x80);
-
730 #endif
-
731  if(motionPlusInside) {
-
732  hci_remote_name(); // We need to know the name to distinguish between a Wiimote and a Wii U Pro Controller
-
733  hci_state = HCI_REMOTE_NAME_STATE;
-
734  } else
-
735  hci_state = HCI_CONNECT_DEVICE_STATE;
-
736  }
-
737  break;
-
738 
-
739  case HCI_CONNECT_DEVICE_STATE:
-
740  if(hci_check_flag(HCI_FLAG_CMD_COMPLETE)) {
-
741 #ifdef DEBUG_USB_HOST
-
742  if(pairWithWii)
-
743  Notify(PSTR("\r\nConnecting to Wiimote"), 0x80);
-
744  else
-
745  Notify(PSTR("\r\nConnecting to HID device"), 0x80);
-
746 #endif
-
747  hci_connect();
-
748  hci_state = HCI_CONNECTED_DEVICE_STATE;
-
749  }
-
750  break;
-
751 
-
752  case HCI_CONNECTED_DEVICE_STATE:
-
753  if(hci_check_flag(HCI_FLAG_CONNECT_EVENT)) {
-
754  if(hci_check_flag(HCI_FLAG_CONNECT_COMPLETE)) {
-
755 #ifdef DEBUG_USB_HOST
-
756  if(pairWithWii)
-
757  Notify(PSTR("\r\nConnected to Wiimote"), 0x80);
-
758  else
-
759  Notify(PSTR("\r\nConnected to HID device"), 0x80);
-
760 #endif
-
761  hci_authentication_request(); // This will start the pairing with the Wiimote
-
762  hci_state = HCI_SCANNING_STATE;
-
763  } else {
-
764 #ifdef DEBUG_USB_HOST
-
765  Notify(PSTR("\r\nTrying to connect one more time..."), 0x80);
-
766 #endif
-
767  hci_connect(); // Try to connect one more time
-
768  }
-
769  }
-
770  break;
-
771 
-
772  case HCI_SCANNING_STATE:
-
773  if(!connectToWii && !pairWithWii && !connectToHIDDevice && !pairWithHIDDevice) {
-
774 #ifdef DEBUG_USB_HOST
-
775  Notify(PSTR("\r\nWait For Incoming Connection Request"), 0x80);
-
776 #endif
-
777  hci_write_scan_enable();
-
778  watingForConnection = true;
-
779  hci_state = HCI_CONNECT_IN_STATE;
-
780  }
-
781  break;
-
782 
-
783  case HCI_CONNECT_IN_STATE:
-
784  if(hci_check_flag(HCI_FLAG_INCOMING_REQUEST)) {
-
785  watingForConnection = false;
-
786 #ifdef DEBUG_USB_HOST
-
787  Notify(PSTR("\r\nIncoming Connection Request"), 0x80);
-
788 #endif
-
789  hci_remote_name();
-
790  hci_state = HCI_REMOTE_NAME_STATE;
-
791  } else if(hci_check_flag(HCI_FLAG_DISCONNECT_COMPLETE))
-
792  hci_state = HCI_DISCONNECT_STATE;
-
793  break;
-
794 
-
795  case HCI_REMOTE_NAME_STATE:
-
796  if(hci_check_flag(HCI_FLAG_REMOTE_NAME_COMPLETE)) {
-
797 #ifdef DEBUG_USB_HOST
-
798  Notify(PSTR("\r\nRemote Name: "), 0x80);
-
799  for(uint8_t i = 0; i < strlen(remote_name); i++)
-
800  Notifyc(remote_name[i], 0x80);
-
801 #endif
-
802  if(strncmp((const char*)remote_name, "Nintendo", 8) == 0) {
-
803  incomingWii = true;
-
804 #ifdef DEBUG_USB_HOST
-
805  Notify(PSTR("\r\nWiimote is connecting"), 0x80);
-
806 #endif
-
807  if(strncmp((const char*)remote_name, "Nintendo RVL-CNT-01-TR", 22) == 0) {
-
808 #ifdef DEBUG_USB_HOST
-
809  Notify(PSTR(" with Motion Plus Inside"), 0x80);
-
810 #endif
-
811  motionPlusInside = true;
-
812  } else if(strncmp((const char*)remote_name, "Nintendo RVL-CNT-01-UC", 22) == 0) {
-
813 #ifdef DEBUG_USB_HOST
-
814  Notify(PSTR(" - Wii U Pro Controller"), 0x80);
-
815 #endif
-
816  motionPlusInside = true;
-
817  wiiUProController = true;
-
818  } else {
-
819  motionPlusInside = false;
-
820  wiiUProController = false;
-
821  }
-
822  }
-
823  if(classOfDevice[2] == 0 && classOfDevice[1] == 0x25 && classOfDevice[0] == 0x08 && strncmp((const char*)remote_name, "Wireless Controller", 19) == 0) {
-
824 #ifdef DEBUG_USB_HOST
-
825  Notify(PSTR("\r\nPS4 controller is connecting"), 0x80);
-
826 #endif
-
827  incomingPS4 = true;
-
828  }
-
829  if(pairWithWii && motionPlusInside)
-
830  hci_state = HCI_CONNECT_DEVICE_STATE;
-
831  else {
-
832  hci_accept_connection();
-
833  hci_state = HCI_CONNECTED_STATE;
-
834  }
-
835  }
-
836  break;
-
837 
-
838  case HCI_CONNECTED_STATE:
-
839  if(hci_check_flag(HCI_FLAG_CONNECT_COMPLETE)) {
-
840 #ifdef DEBUG_USB_HOST
-
841  Notify(PSTR("\r\nConnected to Device: "), 0x80);
-
842  for(int8_t i = 5; i > 0; i--) {
-
843  D_PrintHex<uint8_t > (disc_bdaddr[i], 0x80);
-
844  Notify(PSTR(":"), 0x80);
-
845  }
-
846  D_PrintHex<uint8_t > (disc_bdaddr[0], 0x80);
-
847 #endif
-
848  if(incomingPS4)
-
849  connectToHIDDevice = true; // We should always connect to the PS4 controller
-
850 
-
851  // Clear these flags for a new connection
-
852  l2capConnectionClaimed = false;
-
853  sdpConnectionClaimed = false;
-
854  rfcommConnectionClaimed = false;
-
855 
-
856  hci_event_flag = 0;
-
857  hci_state = HCI_DONE_STATE;
-
858  }
-
859  break;
-
860 
-
861  case HCI_DONE_STATE:
-
862  hci_counter++;
-
863  if(hci_counter > 1000) { // Wait until we have looped 1000 times to make sure that the L2CAP connection has been started
-
864  hci_counter = 0;
-
865  hci_state = HCI_SCANNING_STATE;
+
616  } // Switch
+
617  }
+
618 #ifdef EXTRADEBUG
+
619  else {
+
620  Notify(PSTR("\r\nHCI event error: "), 0x80);
+
621  D_PrintHex<uint8_t > (rcode, 0x80);
+
622  }
+
623 #endif
+
624 }
+
625 
+
626 /* Poll Bluetooth and print result */
+
627 void BTD::HCI_task() {
+
628  switch(hci_state) {
+
629  case HCI_INIT_STATE:
+
630  hci_counter++;
+
631  if(hci_counter > hci_num_reset_loops) { // wait until we have looped x times to clear any old events
+
632  hci_reset();
+
633  hci_state = HCI_RESET_STATE;
+
634  hci_counter = 0;
+
635  }
+
636  break;
+
637 
+
638  case HCI_RESET_STATE:
+
639  hci_counter++;
+
640  if(hci_check_flag(HCI_FLAG_CMD_COMPLETE)) {
+
641  hci_counter = 0;
+
642 #ifdef DEBUG_USB_HOST
+
643  Notify(PSTR("\r\nHCI Reset complete"), 0x80);
+
644 #endif
+
645  hci_state = HCI_CLASS_STATE;
+
646  hci_write_class_of_device();
+
647  } else if(hci_counter > hci_num_reset_loops) {
+
648  hci_num_reset_loops *= 10;
+
649  if(hci_num_reset_loops > 2000)
+
650  hci_num_reset_loops = 2000;
+
651 #ifdef DEBUG_USB_HOST
+
652  Notify(PSTR("\r\nNo response to HCI Reset"), 0x80);
+
653 #endif
+
654  hci_state = HCI_INIT_STATE;
+
655  hci_counter = 0;
+
656  }
+
657  break;
+
658 
+
659  case HCI_CLASS_STATE:
+
660  if(hci_check_flag(HCI_FLAG_CMD_COMPLETE)) {
+
661 #ifdef DEBUG_USB_HOST
+
662  Notify(PSTR("\r\nWrite class of device"), 0x80);
+
663 #endif
+
664  hci_state = HCI_BDADDR_STATE;
+
665  hci_read_bdaddr();
+
666  }
+
667  break;
+
668 
+
669  case HCI_BDADDR_STATE:
+
670  if(hci_check_flag(HCI_FLAG_READ_BDADDR)) {
+
671 #ifdef DEBUG_USB_HOST
+
672  Notify(PSTR("\r\nLocal Bluetooth Address: "), 0x80);
+
673  for(int8_t i = 5; i > 0; i--) {
+
674  D_PrintHex<uint8_t > (my_bdaddr[i], 0x80);
+
675  Notify(PSTR(":"), 0x80);
+
676  }
+
677  D_PrintHex<uint8_t > (my_bdaddr[0], 0x80);
+
678 #endif
+
679  hci_read_local_version_information();
+
680  hci_state = HCI_LOCAL_VERSION_STATE;
+
681  }
+
682  break;
+
683 
+
684  case HCI_LOCAL_VERSION_STATE: // The local version is used by the PS3BT class
+
685  if(hci_check_flag(HCI_FLAG_READ_VERSION)) {
+
686  if(btdName != NULL) {
+
687  hci_set_local_name(btdName);
+
688  hci_state = HCI_SET_NAME_STATE;
+
689  } else
+
690  hci_state = HCI_CHECK_DEVICE_SERVICE;
+
691  }
+
692  break;
+
693 
+
694  case HCI_SET_NAME_STATE:
+
695  if(hci_check_flag(HCI_FLAG_CMD_COMPLETE)) {
+
696 #ifdef DEBUG_USB_HOST
+
697  Notify(PSTR("\r\nThe name is set to: "), 0x80);
+
698  NotifyStr(btdName, 0x80);
+
699 #endif
+
700  hci_state = HCI_CHECK_DEVICE_SERVICE;
+
701  }
+
702  break;
+
703 
+
704  case HCI_CHECK_DEVICE_SERVICE:
+
705  if(pairWithHIDDevice || pairWithWii) { // Check if it should try to connect to a Wiimote
+
706 #ifdef DEBUG_USB_HOST
+
707  if(pairWithWii)
+
708  Notify(PSTR("\r\nStarting inquiry\r\nPress 1 & 2 on the Wiimote\r\nOr press sync if you are using a Wii U Pro Controller"), 0x80);
+
709  else
+
710  Notify(PSTR("\r\nPlease enable discovery of your device"), 0x80);
+
711 #endif
+
712  hci_inquiry();
+
713  hci_state = HCI_INQUIRY_STATE;
+
714  } else
+
715  hci_state = HCI_SCANNING_STATE; // Don't try to connect to a Wiimote
+
716  break;
+
717 
+
718  case HCI_INQUIRY_STATE:
+
719  if(hci_check_flag(HCI_FLAG_DEVICE_FOUND)) {
+
720  hci_inquiry_cancel(); // Stop inquiry
+
721 #ifdef DEBUG_USB_HOST
+
722  if(pairWithWii)
+
723  Notify(PSTR("\r\nWiimote found"), 0x80);
+
724  else
+
725  Notify(PSTR("\r\nHID device found"), 0x80);
+
726 
+
727  Notify(PSTR("\r\nNow just create the instance like so:"), 0x80);
+
728  if(pairWithWii)
+
729  Notify(PSTR("\r\nWII Wii(&Btd);"), 0x80);
+
730  else
+
731  Notify(PSTR("\r\nBTHID bthid(&Btd);"), 0x80);
+
732 
+
733  Notify(PSTR("\r\nAnd then press any button on the "), 0x80);
+
734  if(pairWithWii)
+
735  Notify(PSTR("Wiimote"), 0x80);
+
736  else
+
737  Notify(PSTR("device"), 0x80);
+
738 #endif
+
739  if(motionPlusInside) {
+
740  hci_remote_name(); // We need to know the name to distinguish between a Wiimote and a Wii U Pro Controller
+
741  hci_state = HCI_REMOTE_NAME_STATE;
+
742  } else
+
743  hci_state = HCI_CONNECT_DEVICE_STATE;
+
744  }
+
745  break;
+
746 
+
747  case HCI_CONNECT_DEVICE_STATE:
+
748  if(hci_check_flag(HCI_FLAG_CMD_COMPLETE)) {
+
749 #ifdef DEBUG_USB_HOST
+
750  if(pairWithWii)
+
751  Notify(PSTR("\r\nConnecting to Wiimote"), 0x80);
+
752  else
+
753  Notify(PSTR("\r\nConnecting to HID device"), 0x80);
+
754 #endif
+
755  hci_connect();
+
756  hci_state = HCI_CONNECTED_DEVICE_STATE;
+
757  }
+
758  break;
+
759 
+
760  case HCI_CONNECTED_DEVICE_STATE:
+
761  if(hci_check_flag(HCI_FLAG_CONNECT_EVENT)) {
+
762  if(hci_check_flag(HCI_FLAG_CONNECT_COMPLETE)) {
+
763 #ifdef DEBUG_USB_HOST
+
764  if(pairWithWii)
+
765  Notify(PSTR("\r\nConnected to Wiimote"), 0x80);
+
766  else
+
767  Notify(PSTR("\r\nConnected to HID device"), 0x80);
+
768 #endif
+
769  hci_authentication_request(); // This will start the pairing with the Wiimote
+
770  hci_state = HCI_SCANNING_STATE;
+
771  } else {
+
772 #ifdef DEBUG_USB_HOST
+
773  Notify(PSTR("\r\nTrying to connect one more time..."), 0x80);
+
774 #endif
+
775  hci_connect(); // Try to connect one more time
+
776  }
+
777  }
+
778  break;
+
779 
+
780  case HCI_SCANNING_STATE:
+
781  if(!connectToWii && !pairWithWii && !connectToHIDDevice && !pairWithHIDDevice) {
+
782 #ifdef DEBUG_USB_HOST
+
783  Notify(PSTR("\r\nWait For Incoming Connection Request"), 0x80);
+
784 #endif
+
785  hci_write_scan_enable();
+
786  watingForConnection = true;
+
787  hci_state = HCI_CONNECT_IN_STATE;
+
788  }
+
789  break;
+
790 
+
791  case HCI_CONNECT_IN_STATE:
+
792  if(hci_check_flag(HCI_FLAG_INCOMING_REQUEST)) {
+
793  watingForConnection = false;
+
794 #ifdef DEBUG_USB_HOST
+
795  Notify(PSTR("\r\nIncoming Connection Request"), 0x80);
+
796 #endif
+
797  hci_remote_name();
+
798  hci_state = HCI_REMOTE_NAME_STATE;
+
799  } else if(hci_check_flag(HCI_FLAG_DISCONNECT_COMPLETE))
+
800  hci_state = HCI_DISCONNECT_STATE;
+
801  break;
+
802 
+
803  case HCI_REMOTE_NAME_STATE:
+
804  if(hci_check_flag(HCI_FLAG_REMOTE_NAME_COMPLETE)) {
+
805 #ifdef DEBUG_USB_HOST
+
806  Notify(PSTR("\r\nRemote Name: "), 0x80);
+
807  for(uint8_t i = 0; i < strlen(remote_name); i++)
+
808  Notifyc(remote_name[i], 0x80);
+
809 #endif
+
810  if(strncmp((const char*)remote_name, "Nintendo", 8) == 0) {
+
811  incomingWii = true;
+
812 #ifdef DEBUG_USB_HOST
+
813  Notify(PSTR("\r\nWiimote is connecting"), 0x80);
+
814 #endif
+
815  if(strncmp((const char*)remote_name, "Nintendo RVL-CNT-01-TR", 22) == 0) {
+
816 #ifdef DEBUG_USB_HOST
+
817  Notify(PSTR(" with Motion Plus Inside"), 0x80);
+
818 #endif
+
819  motionPlusInside = true;
+
820  } else if(strncmp((const char*)remote_name, "Nintendo RVL-CNT-01-UC", 22) == 0) {
+
821 #ifdef DEBUG_USB_HOST
+
822  Notify(PSTR(" - Wii U Pro Controller"), 0x80);
+
823 #endif
+
824  motionPlusInside = true;
+
825  wiiUProController = true;
+
826  } else {
+
827  motionPlusInside = false;
+
828  wiiUProController = false;
+
829  }
+
830  }
+
831  if(classOfDevice[2] == 0 && classOfDevice[1] == 0x25 && classOfDevice[0] == 0x08 && strncmp((const char*)remote_name, "Wireless Controller", 19) == 0) {
+
832 #ifdef DEBUG_USB_HOST
+
833  Notify(PSTR("\r\nPS4 controller is connecting"), 0x80);
+
834 #endif
+
835  incomingPS4 = true;
+
836  }
+
837  if(pairWithWii && motionPlusInside)
+
838  hci_state = HCI_CONNECT_DEVICE_STATE;
+
839  else {
+
840  hci_accept_connection();
+
841  hci_state = HCI_CONNECTED_STATE;
+
842  }
+
843  }
+
844  break;
+
845 
+
846  case HCI_CONNECTED_STATE:
+
847  if(hci_check_flag(HCI_FLAG_CONNECT_COMPLETE)) {
+
848 #ifdef DEBUG_USB_HOST
+
849  Notify(PSTR("\r\nConnected to Device: "), 0x80);
+
850  for(int8_t i = 5; i > 0; i--) {
+
851  D_PrintHex<uint8_t > (disc_bdaddr[i], 0x80);
+
852  Notify(PSTR(":"), 0x80);
+
853  }
+
854  D_PrintHex<uint8_t > (disc_bdaddr[0], 0x80);
+
855 #endif
+
856  if(incomingPS4)
+
857  connectToHIDDevice = true; // We should always connect to the PS4 controller
+
858 
+
859  // Clear these flags for a new connection
+
860  l2capConnectionClaimed = false;
+
861  sdpConnectionClaimed = false;
+
862  rfcommConnectionClaimed = false;
+
863 
+
864  hci_event_flag = 0;
+
865  hci_state = HCI_DONE_STATE;
866  }
867  break;
868 
-
869  case HCI_DISCONNECT_STATE:
-
870  if(hci_check_flag(HCI_FLAG_DISCONNECT_COMPLETE)) {
-
871 #ifdef DEBUG_USB_HOST
-
872  Notify(PSTR("\r\nHCI Disconnected from Device"), 0x80);
-
873 #endif
-
874  hci_event_flag = 0; // Clear all flags
-
875 
-
876  // Reset all buffers
-
877  memset(hcibuf, 0, BULK_MAXPKTSIZE);
-
878  memset(l2capinbuf, 0, BULK_MAXPKTSIZE);
-
879 
-
880  connectToWii = incomingWii = pairWithWii = false;
-
881  connectToHIDDevice = incomingHIDDevice = pairWithHIDDevice = false;
-
882  incomingPS4 = false;
+
869  case HCI_DONE_STATE:
+
870  hci_counter++;
+
871  if(hci_counter > 1000) { // Wait until we have looped 1000 times to make sure that the L2CAP connection has been started
+
872  hci_counter = 0;
+
873  hci_state = HCI_SCANNING_STATE;
+
874  }
+
875  break;
+
876 
+
877  case HCI_DISCONNECT_STATE:
+
878  if(hci_check_flag(HCI_FLAG_DISCONNECT_COMPLETE)) {
+
879 #ifdef DEBUG_USB_HOST
+
880  Notify(PSTR("\r\nHCI Disconnected from Device"), 0x80);
+
881 #endif
+
882  hci_event_flag = 0; // Clear all flags
883 
-
884  hci_state = HCI_SCANNING_STATE;
-
885  }
-
886  break;
-
887  default:
-
888  break;
-
889  }
-
890 }
+
884  // Reset all buffers
+
885  memset(hcibuf, 0, BULK_MAXPKTSIZE);
+
886  memset(l2capinbuf, 0, BULK_MAXPKTSIZE);
+
887 
+
888  connectToWii = incomingWii = pairWithWii = false;
+
889  connectToHIDDevice = incomingHIDDevice = pairWithHIDDevice = false;
+
890  incomingPS4 = false;
891 
-
892 void BTD::ACL_event_task() {
-
893  uint16_t length = BULK_MAXPKTSIZE;
-
894  uint8_t rcode = pUsb->inTransfer(bAddress, epInfo[ BTD_DATAIN_PIPE ].epAddr, &length, l2capinbuf); // Input on endpoint 2
-
895 
-
896  if(!rcode) { // Check for errors
-
897  if(length > 0) { // Check if any data was read
-
898  for(uint8_t i = 0; i < BTD_NUM_SERVICES; i++) {
-
899  if(btService[i])
-
900  btService[i]->ACLData(l2capinbuf);
-
901  }
-
902  }
-
903  }
-
904 #ifdef EXTRADEBUG
-
905  else if(rcode != hrNAK) {
-
906  Notify(PSTR("\r\nACL data in error: "), 0x80);
-
907  D_PrintHex<uint8_t > (rcode, 0x80);
-
908  }
-
909 #endif
-
910  for(uint8_t i = 0; i < BTD_NUM_SERVICES; i++)
-
911  if(btService[i])
-
912  btService[i]->Run();
-
913 }
-
914 
-
915 /************************************************************/
-
916 /* HCI Commands */
-
917 
-
918 /************************************************************/
-
919 void BTD::HCI_Command(uint8_t* data, uint16_t nbytes) {
-
920  hci_clear_flag(HCI_FLAG_CMD_COMPLETE);
-
921  pUsb->ctrlReq(bAddress, epInfo[ BTD_CONTROL_PIPE ].epAddr, bmREQ_HCI_OUT, 0x00, 0x00, 0x00, 0x00, nbytes, nbytes, data, NULL);
-
922 }
-
923 
-
924 void BTD::hci_reset() {
-
925  hci_event_flag = 0; // Clear all the flags
-
926  hcibuf[0] = 0x03; // HCI OCF = 3
-
927  hcibuf[1] = 0x03 << 2; // HCI OGF = 3
-
928  hcibuf[2] = 0x00;
-
929 
-
930  HCI_Command(hcibuf, 3);
-
931 }
-
932 
-
933 void BTD::hci_write_scan_enable() {
-
934  hci_clear_flag(HCI_FLAG_INCOMING_REQUEST);
-
935  hcibuf[0] = 0x1A; // HCI OCF = 1A
-
936  hcibuf[1] = 0x03 << 2; // HCI OGF = 3
-
937  hcibuf[2] = 0x01; // parameter length = 1
-
938  if(btdName != NULL)
-
939  hcibuf[3] = 0x03; // Inquiry Scan enabled. Page Scan enabled.
-
940  else
-
941  hcibuf[3] = 0x02; // Inquiry Scan disabled. Page Scan enabled.
-
942 
-
943  HCI_Command(hcibuf, 4);
-
944 }
-
945 
-
946 void BTD::hci_write_scan_disable() {
-
947  hcibuf[0] = 0x1A; // HCI OCF = 1A
-
948  hcibuf[1] = 0x03 << 2; // HCI OGF = 3
-
949  hcibuf[2] = 0x01; // parameter length = 1
-
950  hcibuf[3] = 0x00; // Inquiry Scan disabled. Page Scan disabled.
-
951 
-
952  HCI_Command(hcibuf, 4);
-
953 }
-
954 
-
955 void BTD::hci_read_bdaddr() {
-
956  hci_clear_flag(HCI_FLAG_READ_BDADDR);
-
957  hcibuf[0] = 0x09; // HCI OCF = 9
-
958  hcibuf[1] = 0x04 << 2; // HCI OGF = 4
-
959  hcibuf[2] = 0x00;
-
960 
-
961  HCI_Command(hcibuf, 3);
-
962 }
-
963 
-
964 void BTD::hci_read_local_version_information() {
-
965  hci_clear_flag(HCI_FLAG_READ_VERSION);
-
966  hcibuf[0] = 0x01; // HCI OCF = 1
-
967  hcibuf[1] = 0x04 << 2; // HCI OGF = 4
-
968  hcibuf[2] = 0x00;
-
969 
-
970  HCI_Command(hcibuf, 3);
-
971 }
-
972 
-
973 void BTD::hci_accept_connection() {
-
974  hci_clear_flag(HCI_FLAG_CONNECT_COMPLETE);
-
975  hcibuf[0] = 0x09; // HCI OCF = 9
-
976  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
-
977  hcibuf[2] = 0x07; // parameter length 7
-
978  hcibuf[3] = disc_bdaddr[0]; // 6 octet bdaddr
-
979  hcibuf[4] = disc_bdaddr[1];
-
980  hcibuf[5] = disc_bdaddr[2];
-
981  hcibuf[6] = disc_bdaddr[3];
-
982  hcibuf[7] = disc_bdaddr[4];
-
983  hcibuf[8] = disc_bdaddr[5];
-
984  hcibuf[9] = 0x00; // Switch role to master
-
985 
-
986  HCI_Command(hcibuf, 10);
-
987 }
-
988 
-
989 void BTD::hci_remote_name() {
-
990  hci_clear_flag(HCI_FLAG_REMOTE_NAME_COMPLETE);
-
991  hcibuf[0] = 0x19; // HCI OCF = 19
-
992  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
-
993  hcibuf[2] = 0x0A; // parameter length = 10
-
994  hcibuf[3] = disc_bdaddr[0]; // 6 octet bdaddr
-
995  hcibuf[4] = disc_bdaddr[1];
-
996  hcibuf[5] = disc_bdaddr[2];
-
997  hcibuf[6] = disc_bdaddr[3];
-
998  hcibuf[7] = disc_bdaddr[4];
-
999  hcibuf[8] = disc_bdaddr[5];
-
1000  hcibuf[9] = 0x01; // Page Scan Repetition Mode
-
1001  hcibuf[10] = 0x00; // Reserved
-
1002  hcibuf[11] = 0x00; // Clock offset - low byte
-
1003  hcibuf[12] = 0x00; // Clock offset - high byte
-
1004 
-
1005  HCI_Command(hcibuf, 13);
-
1006 }
-
1007 
-
1008 void BTD::hci_set_local_name(const char* name) {
-
1009  hcibuf[0] = 0x13; // HCI OCF = 13
-
1010  hcibuf[1] = 0x03 << 2; // HCI OGF = 3
-
1011  hcibuf[2] = strlen(name) + 1; // parameter length = the length of the string + end byte
-
1012  uint8_t i;
-
1013  for(i = 0; i < strlen(name); i++)
-
1014  hcibuf[i + 3] = name[i];
-
1015  hcibuf[i + 3] = 0x00; // End of string
-
1016 
-
1017  HCI_Command(hcibuf, 4 + strlen(name));
-
1018 }
-
1019 
-
1020 void BTD::hci_inquiry() {
-
1021  hci_clear_flag(HCI_FLAG_DEVICE_FOUND);
-
1022  hcibuf[0] = 0x01;
-
1023  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
-
1024  hcibuf[2] = 0x05; // Parameter Total Length = 5
-
1025  hcibuf[3] = 0x33; // LAP: Genera/Unlimited Inquiry Access Code (GIAC = 0x9E8B33) - see https://www.bluetooth.org/Technical/AssignedNumbers/baseband.htm
-
1026  hcibuf[4] = 0x8B;
-
1027  hcibuf[5] = 0x9E;
-
1028  hcibuf[6] = 0x30; // Inquiry time = 61.44 sec (maximum)
-
1029  hcibuf[7] = 0x0A; // 10 number of responses
-
1030 
-
1031  HCI_Command(hcibuf, 8);
-
1032 }
-
1033 
-
1034 void BTD::hci_inquiry_cancel() {
-
1035  hcibuf[0] = 0x02;
-
1036  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
-
1037  hcibuf[2] = 0x00; // Parameter Total Length = 0
+
892  hci_state = HCI_SCANNING_STATE;
+
893  }
+
894  break;
+
895  default:
+
896  break;
+
897  }
+
898 }
+
899 
+
900 void BTD::ACL_event_task() {
+
901  uint16_t length = BULK_MAXPKTSIZE;
+
902  uint8_t rcode = pUsb->inTransfer(bAddress, epInfo[ BTD_DATAIN_PIPE ].epAddr, &length, l2capinbuf); // Input on endpoint 2
+
903 
+
904  if(!rcode) { // Check for errors
+
905  if(length > 0) { // Check if any data was read
+
906  for(uint8_t i = 0; i < BTD_NUM_SERVICES; i++) {
+
907  if(btService[i])
+
908  btService[i]->ACLData(l2capinbuf);
+
909  }
+
910  }
+
911  }
+
912 #ifdef EXTRADEBUG
+
913  else if(rcode != hrNAK) {
+
914  Notify(PSTR("\r\nACL data in error: "), 0x80);
+
915  D_PrintHex<uint8_t > (rcode, 0x80);
+
916  }
+
917 #endif
+
918  for(uint8_t i = 0; i < BTD_NUM_SERVICES; i++)
+
919  if(btService[i])
+
920  btService[i]->Run();
+
921 }
+
922 
+
923 /************************************************************/
+
924 /* HCI Commands */
+
925 
+
926 /************************************************************/
+
927 void BTD::HCI_Command(uint8_t* data, uint16_t nbytes) {
+
928  hci_clear_flag(HCI_FLAG_CMD_COMPLETE);
+
929  pUsb->ctrlReq(bAddress, epInfo[ BTD_CONTROL_PIPE ].epAddr, bmREQ_HCI_OUT, 0x00, 0x00, 0x00, 0x00, nbytes, nbytes, data, NULL);
+
930 }
+
931 
+
932 void BTD::hci_reset() {
+
933  hci_event_flag = 0; // Clear all the flags
+
934  hcibuf[0] = 0x03; // HCI OCF = 3
+
935  hcibuf[1] = 0x03 << 2; // HCI OGF = 3
+
936  hcibuf[2] = 0x00;
+
937 
+
938  HCI_Command(hcibuf, 3);
+
939 }
+
940 
+
941 void BTD::hci_write_scan_enable() {
+
942  hci_clear_flag(HCI_FLAG_INCOMING_REQUEST);
+
943  hcibuf[0] = 0x1A; // HCI OCF = 1A
+
944  hcibuf[1] = 0x03 << 2; // HCI OGF = 3
+
945  hcibuf[2] = 0x01; // parameter length = 1
+
946  if(btdName != NULL)
+
947  hcibuf[3] = 0x03; // Inquiry Scan enabled. Page Scan enabled.
+
948  else
+
949  hcibuf[3] = 0x02; // Inquiry Scan disabled. Page Scan enabled.
+
950 
+
951  HCI_Command(hcibuf, 4);
+
952 }
+
953 
+
954 void BTD::hci_write_scan_disable() {
+
955  hcibuf[0] = 0x1A; // HCI OCF = 1A
+
956  hcibuf[1] = 0x03 << 2; // HCI OGF = 3
+
957  hcibuf[2] = 0x01; // parameter length = 1
+
958  hcibuf[3] = 0x00; // Inquiry Scan disabled. Page Scan disabled.
+
959 
+
960  HCI_Command(hcibuf, 4);
+
961 }
+
962 
+
963 void BTD::hci_read_bdaddr() {
+
964  hci_clear_flag(HCI_FLAG_READ_BDADDR);
+
965  hcibuf[0] = 0x09; // HCI OCF = 9
+
966  hcibuf[1] = 0x04 << 2; // HCI OGF = 4
+
967  hcibuf[2] = 0x00;
+
968 
+
969  HCI_Command(hcibuf, 3);
+
970 }
+
971 
+
972 void BTD::hci_read_local_version_information() {
+
973  hci_clear_flag(HCI_FLAG_READ_VERSION);
+
974  hcibuf[0] = 0x01; // HCI OCF = 1
+
975  hcibuf[1] = 0x04 << 2; // HCI OGF = 4
+
976  hcibuf[2] = 0x00;
+
977 
+
978  HCI_Command(hcibuf, 3);
+
979 }
+
980 
+
981 void BTD::hci_accept_connection() {
+
982  hci_clear_flag(HCI_FLAG_CONNECT_COMPLETE);
+
983  hcibuf[0] = 0x09; // HCI OCF = 9
+
984  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
+
985  hcibuf[2] = 0x07; // parameter length 7
+
986  hcibuf[3] = disc_bdaddr[0]; // 6 octet bdaddr
+
987  hcibuf[4] = disc_bdaddr[1];
+
988  hcibuf[5] = disc_bdaddr[2];
+
989  hcibuf[6] = disc_bdaddr[3];
+
990  hcibuf[7] = disc_bdaddr[4];
+
991  hcibuf[8] = disc_bdaddr[5];
+
992  hcibuf[9] = 0x00; // Switch role to master
+
993 
+
994  HCI_Command(hcibuf, 10);
+
995 }
+
996 
+
997 void BTD::hci_remote_name() {
+
998  hci_clear_flag(HCI_FLAG_REMOTE_NAME_COMPLETE);
+
999  hcibuf[0] = 0x19; // HCI OCF = 19
+
1000  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
+
1001  hcibuf[2] = 0x0A; // parameter length = 10
+
1002  hcibuf[3] = disc_bdaddr[0]; // 6 octet bdaddr
+
1003  hcibuf[4] = disc_bdaddr[1];
+
1004  hcibuf[5] = disc_bdaddr[2];
+
1005  hcibuf[6] = disc_bdaddr[3];
+
1006  hcibuf[7] = disc_bdaddr[4];
+
1007  hcibuf[8] = disc_bdaddr[5];
+
1008  hcibuf[9] = 0x01; // Page Scan Repetition Mode
+
1009  hcibuf[10] = 0x00; // Reserved
+
1010  hcibuf[11] = 0x00; // Clock offset - low byte
+
1011  hcibuf[12] = 0x00; // Clock offset - high byte
+
1012 
+
1013  HCI_Command(hcibuf, 13);
+
1014 }
+
1015 
+
1016 void BTD::hci_set_local_name(const char* name) {
+
1017  hcibuf[0] = 0x13; // HCI OCF = 13
+
1018  hcibuf[1] = 0x03 << 2; // HCI OGF = 3
+
1019  hcibuf[2] = strlen(name) + 1; // parameter length = the length of the string + end byte
+
1020  uint8_t i;
+
1021  for(i = 0; i < strlen(name); i++)
+
1022  hcibuf[i + 3] = name[i];
+
1023  hcibuf[i + 3] = 0x00; // End of string
+
1024 
+
1025  HCI_Command(hcibuf, 4 + strlen(name));
+
1026 }
+
1027 
+
1028 void BTD::hci_inquiry() {
+
1029  hci_clear_flag(HCI_FLAG_DEVICE_FOUND);
+
1030  hcibuf[0] = 0x01;
+
1031  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
+
1032  hcibuf[2] = 0x05; // Parameter Total Length = 5
+
1033  hcibuf[3] = 0x33; // LAP: Genera/Unlimited Inquiry Access Code (GIAC = 0x9E8B33) - see https://www.bluetooth.org/Technical/AssignedNumbers/baseband.htm
+
1034  hcibuf[4] = 0x8B;
+
1035  hcibuf[5] = 0x9E;
+
1036  hcibuf[6] = 0x30; // Inquiry time = 61.44 sec (maximum)
+
1037  hcibuf[7] = 0x0A; // 10 number of responses
1038 
-
1039  HCI_Command(hcibuf, 3);
+
1039  HCI_Command(hcibuf, 8);
1040 }
1041 
-
1042 void BTD::hci_connect() {
-
1043  hci_connect(disc_bdaddr); // Use last discovered device
-
1044 }
-
1045 
-
1046 void BTD::hci_connect(uint8_t *bdaddr) {
-
1047  hci_clear_flag(HCI_FLAG_CONNECT_COMPLETE | HCI_FLAG_CONNECT_EVENT);
-
1048  hcibuf[0] = 0x05;
-
1049  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
-
1050  hcibuf[2] = 0x0D; // parameter Total Length = 13
-
1051  hcibuf[3] = bdaddr[0]; // 6 octet bdaddr (LSB)
-
1052  hcibuf[4] = bdaddr[1];
-
1053  hcibuf[5] = bdaddr[2];
-
1054  hcibuf[6] = bdaddr[3];
-
1055  hcibuf[7] = bdaddr[4];
-
1056  hcibuf[8] = bdaddr[5];
-
1057  hcibuf[9] = 0x18; // DM1 or DH1 may be used
-
1058  hcibuf[10] = 0xCC; // DM3, DH3, DM5, DH5 may be used
-
1059  hcibuf[11] = 0x01; // Page repetition mode R1
-
1060  hcibuf[12] = 0x00; // Reserved
-
1061  hcibuf[13] = 0x00; // Clock offset
-
1062  hcibuf[14] = 0x00; // Invalid clock offset
-
1063  hcibuf[15] = 0x00; // Do not allow role switch
-
1064 
-
1065  HCI_Command(hcibuf, 16);
-
1066 }
-
1067 
-
1068 void BTD::hci_pin_code_request_reply() {
-
1069  hcibuf[0] = 0x0D; // HCI OCF = 0D
-
1070  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
-
1071  hcibuf[2] = 0x17; // parameter length 23
-
1072  hcibuf[3] = disc_bdaddr[0]; // 6 octet bdaddr
-
1073  hcibuf[4] = disc_bdaddr[1];
-
1074  hcibuf[5] = disc_bdaddr[2];
-
1075  hcibuf[6] = disc_bdaddr[3];
-
1076  hcibuf[7] = disc_bdaddr[4];
-
1077  hcibuf[8] = disc_bdaddr[5];
-
1078  if(pairWithWii) {
-
1079  hcibuf[9] = 6; // Pin length is the length of the Bluetooth address
-
1080  if(wiiUProController) {
-
1081 #ifdef DEBUG_USB_HOST
-
1082  Notify(PSTR("\r\nParing with Wii U Pro Controller"), 0x80);
-
1083 #endif
-
1084  for(uint8_t i = 0; i < 6; i++)
-
1085  hcibuf[10 + i] = my_bdaddr[i]; // The pin is the Bluetooth dongles Bluetooth address backwards
-
1086  } else {
-
1087  for(uint8_t i = 0; i < 6; i++)
-
1088  hcibuf[10 + i] = disc_bdaddr[i]; // The pin is the Wiimote's Bluetooth address backwards
-
1089  }
-
1090  for(uint8_t i = 16; i < 26; i++)
-
1091  hcibuf[i] = 0x00; // The rest should be 0
-
1092  } else {
-
1093  hcibuf[9] = strlen(btdPin); // Length of pin
-
1094  uint8_t i;
-
1095  for(i = 0; i < strlen(btdPin); i++) // The maximum size of the pin is 16
-
1096  hcibuf[i + 10] = btdPin[i];
-
1097  for(; i < 16; i++)
-
1098  hcibuf[i + 10] = 0x00; // The rest should be 0
-
1099  }
-
1100 
-
1101  HCI_Command(hcibuf, 26);
-
1102 }
-
1103 
-
1104 void BTD::hci_pin_code_negative_request_reply() {
-
1105  hcibuf[0] = 0x0E; // HCI OCF = 0E
-
1106  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
-
1107  hcibuf[2] = 0x06; // parameter length 6
-
1108  hcibuf[3] = disc_bdaddr[0]; // 6 octet bdaddr
-
1109  hcibuf[4] = disc_bdaddr[1];
-
1110  hcibuf[5] = disc_bdaddr[2];
-
1111  hcibuf[6] = disc_bdaddr[3];
-
1112  hcibuf[7] = disc_bdaddr[4];
-
1113  hcibuf[8] = disc_bdaddr[5];
-
1114 
-
1115  HCI_Command(hcibuf, 9);
-
1116 }
-
1117 
-
1118 void BTD::hci_link_key_request_negative_reply() {
-
1119  hcibuf[0] = 0x0C; // HCI OCF = 0C
-
1120  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
-
1121  hcibuf[2] = 0x06; // parameter length 6
-
1122  hcibuf[3] = disc_bdaddr[0]; // 6 octet bdaddr
-
1123  hcibuf[4] = disc_bdaddr[1];
-
1124  hcibuf[5] = disc_bdaddr[2];
-
1125  hcibuf[6] = disc_bdaddr[3];
-
1126  hcibuf[7] = disc_bdaddr[4];
-
1127  hcibuf[8] = disc_bdaddr[5];
-
1128 
-
1129  HCI_Command(hcibuf, 9);
-
1130 }
-
1131 
-
1132 void BTD::hci_authentication_request() {
-
1133  hcibuf[0] = 0x11; // HCI OCF = 11
-
1134  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
-
1135  hcibuf[2] = 0x02; // parameter length = 2
-
1136  hcibuf[3] = (uint8_t)(hci_handle & 0xFF); //connection handle - low byte
-
1137  hcibuf[4] = (uint8_t)((hci_handle >> 8) & 0x0F); //connection handle - high byte
-
1138 
-
1139  HCI_Command(hcibuf, 5);
-
1140 }
-
1141 
-
1142 void BTD::hci_disconnect(uint16_t handle) { // This is called by the different services
-
1143  hci_clear_flag(HCI_FLAG_DISCONNECT_COMPLETE);
-
1144  hcibuf[0] = 0x06; // HCI OCF = 6
-
1145  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
-
1146  hcibuf[2] = 0x03; // parameter length = 3
-
1147  hcibuf[3] = (uint8_t)(handle & 0xFF); //connection handle - low byte
-
1148  hcibuf[4] = (uint8_t)((handle >> 8) & 0x0F); //connection handle - high byte
-
1149  hcibuf[5] = 0x13; // reason
-
1150 
-
1151  HCI_Command(hcibuf, 6);
-
1152 }
-
1153 
-
1154 void BTD::hci_write_class_of_device() { // See http://bluetooth-pentest.narod.ru/software/bluetooth_class_of_device-service_generator.html
-
1155  hcibuf[0] = 0x24; // HCI OCF = 24
-
1156  hcibuf[1] = 0x03 << 2; // HCI OGF = 3
-
1157  hcibuf[2] = 0x03; // parameter length = 3
-
1158  hcibuf[3] = 0x04; // Robot
-
1159  hcibuf[4] = 0x08; // Toy
-
1160  hcibuf[5] = 0x00;
+
1042 void BTD::hci_inquiry_cancel() {
+
1043  hcibuf[0] = 0x02;
+
1044  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
+
1045  hcibuf[2] = 0x00; // Parameter Total Length = 0
+
1046 
+
1047  HCI_Command(hcibuf, 3);
+
1048 }
+
1049 
+
1050 void BTD::hci_connect() {
+
1051  hci_connect(disc_bdaddr); // Use last discovered device
+
1052 }
+
1053 
+
1054 void BTD::hci_connect(uint8_t *bdaddr) {
+
1055  hci_clear_flag(HCI_FLAG_CONNECT_COMPLETE | HCI_FLAG_CONNECT_EVENT);
+
1056  hcibuf[0] = 0x05;
+
1057  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
+
1058  hcibuf[2] = 0x0D; // parameter Total Length = 13
+
1059  hcibuf[3] = bdaddr[0]; // 6 octet bdaddr (LSB)
+
1060  hcibuf[4] = bdaddr[1];
+
1061  hcibuf[5] = bdaddr[2];
+
1062  hcibuf[6] = bdaddr[3];
+
1063  hcibuf[7] = bdaddr[4];
+
1064  hcibuf[8] = bdaddr[5];
+
1065  hcibuf[9] = 0x18; // DM1 or DH1 may be used
+
1066  hcibuf[10] = 0xCC; // DM3, DH3, DM5, DH5 may be used
+
1067  hcibuf[11] = 0x01; // Page repetition mode R1
+
1068  hcibuf[12] = 0x00; // Reserved
+
1069  hcibuf[13] = 0x00; // Clock offset
+
1070  hcibuf[14] = 0x00; // Invalid clock offset
+
1071  hcibuf[15] = 0x00; // Do not allow role switch
+
1072 
+
1073  HCI_Command(hcibuf, 16);
+
1074 }
+
1075 
+
1076 void BTD::hci_pin_code_request_reply() {
+
1077  hcibuf[0] = 0x0D; // HCI OCF = 0D
+
1078  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
+
1079  hcibuf[2] = 0x17; // parameter length 23
+
1080  hcibuf[3] = disc_bdaddr[0]; // 6 octet bdaddr
+
1081  hcibuf[4] = disc_bdaddr[1];
+
1082  hcibuf[5] = disc_bdaddr[2];
+
1083  hcibuf[6] = disc_bdaddr[3];
+
1084  hcibuf[7] = disc_bdaddr[4];
+
1085  hcibuf[8] = disc_bdaddr[5];
+
1086  if(pairWithWii) {
+
1087  hcibuf[9] = 6; // Pin length is the length of the Bluetooth address
+
1088  if(wiiUProController) {
+
1089 #ifdef DEBUG_USB_HOST
+
1090  Notify(PSTR("\r\nParing with Wii U Pro Controller"), 0x80);
+
1091 #endif
+
1092  for(uint8_t i = 0; i < 6; i++)
+
1093  hcibuf[10 + i] = my_bdaddr[i]; // The pin is the Bluetooth dongles Bluetooth address backwards
+
1094  } else {
+
1095  for(uint8_t i = 0; i < 6; i++)
+
1096  hcibuf[10 + i] = disc_bdaddr[i]; // The pin is the Wiimote's Bluetooth address backwards
+
1097  }
+
1098  for(uint8_t i = 16; i < 26; i++)
+
1099  hcibuf[i] = 0x00; // The rest should be 0
+
1100  } else {
+
1101  hcibuf[9] = strlen(btdPin); // Length of pin
+
1102  uint8_t i;
+
1103  for(i = 0; i < strlen(btdPin); i++) // The maximum size of the pin is 16
+
1104  hcibuf[i + 10] = btdPin[i];
+
1105  for(; i < 16; i++)
+
1106  hcibuf[i + 10] = 0x00; // The rest should be 0
+
1107  }
+
1108 
+
1109  HCI_Command(hcibuf, 26);
+
1110 }
+
1111 
+
1112 void BTD::hci_pin_code_negative_request_reply() {
+
1113  hcibuf[0] = 0x0E; // HCI OCF = 0E
+
1114  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
+
1115  hcibuf[2] = 0x06; // parameter length 6
+
1116  hcibuf[3] = disc_bdaddr[0]; // 6 octet bdaddr
+
1117  hcibuf[4] = disc_bdaddr[1];
+
1118  hcibuf[5] = disc_bdaddr[2];
+
1119  hcibuf[6] = disc_bdaddr[3];
+
1120  hcibuf[7] = disc_bdaddr[4];
+
1121  hcibuf[8] = disc_bdaddr[5];
+
1122 
+
1123  HCI_Command(hcibuf, 9);
+
1124 }
+
1125 
+
1126 void BTD::hci_link_key_request_negative_reply() {
+
1127  hcibuf[0] = 0x0C; // HCI OCF = 0C
+
1128  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
+
1129  hcibuf[2] = 0x06; // parameter length 6
+
1130  hcibuf[3] = disc_bdaddr[0]; // 6 octet bdaddr
+
1131  hcibuf[4] = disc_bdaddr[1];
+
1132  hcibuf[5] = disc_bdaddr[2];
+
1133  hcibuf[6] = disc_bdaddr[3];
+
1134  hcibuf[7] = disc_bdaddr[4];
+
1135  hcibuf[8] = disc_bdaddr[5];
+
1136 
+
1137  HCI_Command(hcibuf, 9);
+
1138 }
+
1139 
+
1140 void BTD::hci_authentication_request() {
+
1141  hcibuf[0] = 0x11; // HCI OCF = 11
+
1142  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
+
1143  hcibuf[2] = 0x02; // parameter length = 2
+
1144  hcibuf[3] = (uint8_t)(hci_handle & 0xFF); //connection handle - low byte
+
1145  hcibuf[4] = (uint8_t)((hci_handle >> 8) & 0x0F); //connection handle - high byte
+
1146 
+
1147  HCI_Command(hcibuf, 5);
+
1148 }
+
1149 
+
1150 void BTD::hci_disconnect(uint16_t handle) { // This is called by the different services
+
1151  hci_clear_flag(HCI_FLAG_DISCONNECT_COMPLETE);
+
1152  hcibuf[0] = 0x06; // HCI OCF = 6
+
1153  hcibuf[1] = 0x01 << 2; // HCI OGF = 1
+
1154  hcibuf[2] = 0x03; // parameter length = 3
+
1155  hcibuf[3] = (uint8_t)(handle & 0xFF); //connection handle - low byte
+
1156  hcibuf[4] = (uint8_t)((handle >> 8) & 0x0F); //connection handle - high byte
+
1157  hcibuf[5] = 0x13; // reason
+
1158 
+
1159  HCI_Command(hcibuf, 6);
+
1160 }
1161 
-
1162  HCI_Command(hcibuf, 6);
-
1163 }
-
1164 /*******************************************************************
-
1165  * *
-
1166  * HCI ACL Data Packet *
-
1167  * *
-
1168  * buf[0] buf[1] buf[2] buf[3]
-
1169  * 0 4 8 11 12 16 24 31 MSB
-
1170  * .-+-+-+-+-+-+-+-|-+-+-+-|-+-|-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-.
-
1171  * | HCI Handle |PB |BC | Data Total Length | HCI ACL Data Packet
-
1172  * .-+-+-+-+-+-+-+-|-+-+-+-|-+-|-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-.
-
1173  *
-
1174  * buf[4] buf[5] buf[6] buf[7]
-
1175  * 0 8 16 31 MSB
-
1176  * .-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-.
-
1177  * | Length | Channel ID | Basic L2CAP header
-
1178  * .-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-.
-
1179  *
-
1180  * buf[8] buf[9] buf[10] buf[11]
-
1181  * 0 8 16 31 MSB
-
1182  * .-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-.
-
1183  * | Code | Identifier | Length | Control frame (C-frame)
-
1184  * .-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-. (signaling packet format)
-
1185  */
-
1186 /************************************************************/
-
1187 /* L2CAP Commands */
-
1188 
-
1189 /************************************************************/
-
1190 void BTD::L2CAP_Command(uint16_t handle, uint8_t* data, uint8_t nbytes, uint8_t channelLow, uint8_t channelHigh) {
-
1191  uint8_t buf[8 + nbytes];
-
1192  buf[0] = (uint8_t)(handle & 0xff); // HCI handle with PB,BC flag
-
1193  buf[1] = (uint8_t)(((handle >> 8) & 0x0f) | 0x20);
-
1194  buf[2] = (uint8_t)((4 + nbytes) & 0xff); // HCI ACL total data length
-
1195  buf[3] = (uint8_t)((4 + nbytes) >> 8);
-
1196  buf[4] = (uint8_t)(nbytes & 0xff); // L2CAP header: Length
-
1197  buf[5] = (uint8_t)(nbytes >> 8);
-
1198  buf[6] = channelLow;
-
1199  buf[7] = channelHigh;
-
1200 
-
1201  for(uint16_t i = 0; i < nbytes; i++) // L2CAP C-frame
-
1202  buf[8 + i] = data[i];
-
1203 
-
1204  uint8_t rcode = pUsb->outTransfer(bAddress, epInfo[ BTD_DATAOUT_PIPE ].epAddr, (8 + nbytes), buf);
-
1205  if(rcode) {
-
1206  delay(100); // This small delay prevents it from overflowing if it fails
-
1207 #ifdef DEBUG_USB_HOST
-
1208  Notify(PSTR("\r\nError sending L2CAP message: 0x"), 0x80);
-
1209  D_PrintHex<uint8_t > (rcode, 0x80);
-
1210  Notify(PSTR(" - Channel ID: "), 0x80);
-
1211  D_PrintHex<uint8_t > (channelHigh, 0x80);
-
1212  Notify(PSTR(" "), 0x80);
-
1213  D_PrintHex<uint8_t > (channelLow, 0x80);
-
1214 #endif
-
1215  }
-
1216 }
-
1217 
-
1218 void BTD::l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t* scid, uint16_t psm) {
-
1219  l2capoutbuf[0] = L2CAP_CMD_CONNECTION_REQUEST; // Code
-
1220  l2capoutbuf[1] = rxid; // Identifier
-
1221  l2capoutbuf[2] = 0x04; // Length
-
1222  l2capoutbuf[3] = 0x00;
-
1223  l2capoutbuf[4] = (uint8_t)(psm & 0xff); // PSM
-
1224  l2capoutbuf[5] = (uint8_t)(psm >> 8);
-
1225  l2capoutbuf[6] = scid[0]; // Source CID
-
1226  l2capoutbuf[7] = scid[1];
-
1227 
-
1228  L2CAP_Command(handle, l2capoutbuf, 8);
-
1229 }
-
1230 
-
1231 void BTD::l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid, uint8_t result) {
-
1232  l2capoutbuf[0] = L2CAP_CMD_CONNECTION_RESPONSE; // Code
-
1233  l2capoutbuf[1] = rxid; // Identifier
-
1234  l2capoutbuf[2] = 0x08; // Length
-
1235  l2capoutbuf[3] = 0x00;
-
1236  l2capoutbuf[4] = dcid[0]; // Destination CID
-
1237  l2capoutbuf[5] = dcid[1];
-
1238  l2capoutbuf[6] = scid[0]; // Source CID
-
1239  l2capoutbuf[7] = scid[1];
-
1240  l2capoutbuf[8] = result; // Result: Pending or Success
-
1241  l2capoutbuf[9] = 0x00;
-
1242  l2capoutbuf[10] = 0x00; // No further information
-
1243  l2capoutbuf[11] = 0x00;
-
1244 
-
1245  L2CAP_Command(handle, l2capoutbuf, 12);
-
1246 }
-
1247 
-
1248 void BTD::l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t* dcid) {
-
1249  l2capoutbuf[0] = L2CAP_CMD_CONFIG_REQUEST; // Code
-
1250  l2capoutbuf[1] = rxid; // Identifier
-
1251  l2capoutbuf[2] = 0x08; // Length
-
1252  l2capoutbuf[3] = 0x00;
-
1253  l2capoutbuf[4] = dcid[0]; // Destination CID
-
1254  l2capoutbuf[5] = dcid[1];
-
1255  l2capoutbuf[6] = 0x00; // Flags
-
1256  l2capoutbuf[7] = 0x00;
-
1257  l2capoutbuf[8] = 0x01; // Config Opt: type = MTU (Maximum Transmission Unit) - Hint
-
1258  l2capoutbuf[9] = 0x02; // Config Opt: length
-
1259  l2capoutbuf[10] = 0xFF; // MTU
-
1260  l2capoutbuf[11] = 0xFF;
-
1261 
-
1262  L2CAP_Command(handle, l2capoutbuf, 12);
-
1263 }
-
1264 
-
1265 void BTD::l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t* scid) {
-
1266  l2capoutbuf[0] = L2CAP_CMD_CONFIG_RESPONSE; // Code
-
1267  l2capoutbuf[1] = rxid; // Identifier
-
1268  l2capoutbuf[2] = 0x0A; // Length
-
1269  l2capoutbuf[3] = 0x00;
-
1270  l2capoutbuf[4] = scid[0]; // Source CID
-
1271  l2capoutbuf[5] = scid[1];
-
1272  l2capoutbuf[6] = 0x00; // Flag
-
1273  l2capoutbuf[7] = 0x00;
-
1274  l2capoutbuf[8] = 0x00; // Result
-
1275  l2capoutbuf[9] = 0x00;
-
1276  l2capoutbuf[10] = 0x01; // Config
-
1277  l2capoutbuf[11] = 0x02;
-
1278  l2capoutbuf[12] = 0xA0;
-
1279  l2capoutbuf[13] = 0x02;
-
1280 
-
1281  L2CAP_Command(handle, l2capoutbuf, 14);
-
1282 }
-
1283 
-
1284 void BTD::l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid) {
-
1285  l2capoutbuf[0] = L2CAP_CMD_DISCONNECT_REQUEST; // Code
-
1286  l2capoutbuf[1] = rxid; // Identifier
-
1287  l2capoutbuf[2] = 0x04; // Length
-
1288  l2capoutbuf[3] = 0x00;
-
1289  l2capoutbuf[4] = dcid[0];
-
1290  l2capoutbuf[5] = dcid[1];
-
1291  l2capoutbuf[6] = scid[0];
-
1292  l2capoutbuf[7] = scid[1];
-
1293 
-
1294  L2CAP_Command(handle, l2capoutbuf, 8);
-
1295 }
-
1296 
-
1297 void BTD::l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid) {
-
1298  l2capoutbuf[0] = L2CAP_CMD_DISCONNECT_RESPONSE; // Code
-
1299  l2capoutbuf[1] = rxid; // Identifier
-
1300  l2capoutbuf[2] = 0x04; // Length
-
1301  l2capoutbuf[3] = 0x00;
-
1302  l2capoutbuf[4] = dcid[0];
-
1303  l2capoutbuf[5] = dcid[1];
-
1304  l2capoutbuf[6] = scid[0];
-
1305  l2capoutbuf[7] = scid[1];
-
1306 
-
1307  L2CAP_Command(handle, l2capoutbuf, 8);
-
1308 }
-
1309 
-
1310 void BTD::l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh) {
-
1311  l2capoutbuf[0] = L2CAP_CMD_INFORMATION_RESPONSE; // Code
-
1312  l2capoutbuf[1] = rxid; // Identifier
-
1313  l2capoutbuf[2] = 0x08; // Length
-
1314  l2capoutbuf[3] = 0x00;
-
1315  l2capoutbuf[4] = infoTypeLow;
-
1316  l2capoutbuf[5] = infoTypeHigh;
-
1317  l2capoutbuf[6] = 0x00; // Result = success
-
1318  l2capoutbuf[7] = 0x00; // Result = success
-
1319  l2capoutbuf[8] = 0x00;
-
1320  l2capoutbuf[9] = 0x00;
-
1321  l2capoutbuf[10] = 0x00;
-
1322  l2capoutbuf[11] = 0x00;
-
1323 
-
1324  L2CAP_Command(handle, l2capoutbuf, 12);
-
1325 }
-
1326 
-
1327 /* PS3 Commands - only set Bluetooth address is implemented in this library */
-
1328 void BTD::setBdaddr(uint8_t* bdaddr) {
-
1329  /* Set the internal Bluetooth address */
-
1330  uint8_t buf[8];
-
1331  buf[0] = 0x01;
-
1332  buf[1] = 0x00;
-
1333 
-
1334  for(uint8_t i = 0; i < 6; i++)
-
1335  buf[i + 2] = bdaddr[5 - i]; // Copy into buffer, has to be written reversed, so it is MSB first
-
1336 
-
1337  // bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF5), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data
-
1338  pUsb->ctrlReq(bAddress, epInfo[BTD_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);
-
1339 }
-
1340 
-
1341 void BTD::setMoveBdaddr(uint8_t* bdaddr) {
-
1342  /* Set the internal Bluetooth address */
-
1343  uint8_t buf[11];
-
1344  buf[0] = 0x05;
-
1345  buf[7] = 0x10;
-
1346  buf[8] = 0x01;
-
1347  buf[9] = 0x02;
-
1348  buf[10] = 0x12;
-
1349 
-
1350  for(uint8_t i = 0; i < 6; i++)
-
1351  buf[i + 1] = bdaddr[i];
-
1352 
-
1353  // bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x05), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data
-
1354  pUsb->ctrlReq(bAddress, epInfo[BTD_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x05, 0x03, 0x00, 11, 11, buf, NULL);
-
1355 }
-
static const uint8_t BTD_DATAOUT_PIPE
Definition: BTD.h:557
-
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:766
-
bool incomingWii
Definition: BTD.h:507
+
1162 void BTD::hci_write_class_of_device() { // See http://bluetooth-pentest.narod.ru/software/bluetooth_class_of_device-service_generator.html
+
1163  hcibuf[0] = 0x24; // HCI OCF = 24
+
1164  hcibuf[1] = 0x03 << 2; // HCI OGF = 3
+
1165  hcibuf[2] = 0x03; // parameter length = 3
+
1166  hcibuf[3] = 0x04; // Robot
+
1167  hcibuf[4] = 0x08; // Toy
+
1168  hcibuf[5] = 0x00;
+
1169 
+
1170  HCI_Command(hcibuf, 6);
+
1171 }
+
1172 /*******************************************************************
+
1173  * *
+
1174  * HCI ACL Data Packet *
+
1175  * *
+
1176  * buf[0] buf[1] buf[2] buf[3]
+
1177  * 0 4 8 11 12 16 24 31 MSB
+
1178  * .-+-+-+-+-+-+-+-|-+-+-+-|-+-|-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-.
+
1179  * | HCI Handle |PB |BC | Data Total Length | HCI ACL Data Packet
+
1180  * .-+-+-+-+-+-+-+-|-+-+-+-|-+-|-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-.
+
1181  *
+
1182  * buf[4] buf[5] buf[6] buf[7]
+
1183  * 0 8 16 31 MSB
+
1184  * .-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-.
+
1185  * | Length | Channel ID | Basic L2CAP header
+
1186  * .-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-.
+
1187  *
+
1188  * buf[8] buf[9] buf[10] buf[11]
+
1189  * 0 8 16 31 MSB
+
1190  * .-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-.
+
1191  * | Code | Identifier | Length | Control frame (C-frame)
+
1192  * .-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-. (signaling packet format)
+
1193  */
+
1194 /************************************************************/
+
1195 /* L2CAP Commands */
+
1196 
+
1197 /************************************************************/
+
1198 void BTD::L2CAP_Command(uint16_t handle, uint8_t* data, uint8_t nbytes, uint8_t channelLow, uint8_t channelHigh) {
+
1199  uint8_t buf[8 + nbytes];
+
1200  buf[0] = (uint8_t)(handle & 0xff); // HCI handle with PB,BC flag
+
1201  buf[1] = (uint8_t)(((handle >> 8) & 0x0f) | 0x20);
+
1202  buf[2] = (uint8_t)((4 + nbytes) & 0xff); // HCI ACL total data length
+
1203  buf[3] = (uint8_t)((4 + nbytes) >> 8);
+
1204  buf[4] = (uint8_t)(nbytes & 0xff); // L2CAP header: Length
+
1205  buf[5] = (uint8_t)(nbytes >> 8);
+
1206  buf[6] = channelLow;
+
1207  buf[7] = channelHigh;
+
1208 
+
1209  for(uint16_t i = 0; i < nbytes; i++) // L2CAP C-frame
+
1210  buf[8 + i] = data[i];
+
1211 
+
1212  uint8_t rcode = pUsb->outTransfer(bAddress, epInfo[ BTD_DATAOUT_PIPE ].epAddr, (8 + nbytes), buf);
+
1213  if(rcode) {
+
1214  delay(100); // This small delay prevents it from overflowing if it fails
+
1215 #ifdef DEBUG_USB_HOST
+
1216  Notify(PSTR("\r\nError sending L2CAP message: 0x"), 0x80);
+
1217  D_PrintHex<uint8_t > (rcode, 0x80);
+
1218  Notify(PSTR(" - Channel ID: "), 0x80);
+
1219  D_PrintHex<uint8_t > (channelHigh, 0x80);
+
1220  Notify(PSTR(" "), 0x80);
+
1221  D_PrintHex<uint8_t > (channelLow, 0x80);
+
1222 #endif
+
1223  }
+
1224 }
+
1225 
+
1226 void BTD::l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t* scid, uint16_t psm) {
+
1227  l2capoutbuf[0] = L2CAP_CMD_CONNECTION_REQUEST; // Code
+
1228  l2capoutbuf[1] = rxid; // Identifier
+
1229  l2capoutbuf[2] = 0x04; // Length
+
1230  l2capoutbuf[3] = 0x00;
+
1231  l2capoutbuf[4] = (uint8_t)(psm & 0xff); // PSM
+
1232  l2capoutbuf[5] = (uint8_t)(psm >> 8);
+
1233  l2capoutbuf[6] = scid[0]; // Source CID
+
1234  l2capoutbuf[7] = scid[1];
+
1235 
+
1236  L2CAP_Command(handle, l2capoutbuf, 8);
+
1237 }
+
1238 
+
1239 void BTD::l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid, uint8_t result) {
+
1240  l2capoutbuf[0] = L2CAP_CMD_CONNECTION_RESPONSE; // Code
+
1241  l2capoutbuf[1] = rxid; // Identifier
+
1242  l2capoutbuf[2] = 0x08; // Length
+
1243  l2capoutbuf[3] = 0x00;
+
1244  l2capoutbuf[4] = dcid[0]; // Destination CID
+
1245  l2capoutbuf[5] = dcid[1];
+
1246  l2capoutbuf[6] = scid[0]; // Source CID
+
1247  l2capoutbuf[7] = scid[1];
+
1248  l2capoutbuf[8] = result; // Result: Pending or Success
+
1249  l2capoutbuf[9] = 0x00;
+
1250  l2capoutbuf[10] = 0x00; // No further information
+
1251  l2capoutbuf[11] = 0x00;
+
1252 
+
1253  L2CAP_Command(handle, l2capoutbuf, 12);
+
1254 }
+
1255 
+
1256 void BTD::l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t* dcid) {
+
1257  l2capoutbuf[0] = L2CAP_CMD_CONFIG_REQUEST; // Code
+
1258  l2capoutbuf[1] = rxid; // Identifier
+
1259  l2capoutbuf[2] = 0x08; // Length
+
1260  l2capoutbuf[3] = 0x00;
+
1261  l2capoutbuf[4] = dcid[0]; // Destination CID
+
1262  l2capoutbuf[5] = dcid[1];
+
1263  l2capoutbuf[6] = 0x00; // Flags
+
1264  l2capoutbuf[7] = 0x00;
+
1265  l2capoutbuf[8] = 0x01; // Config Opt: type = MTU (Maximum Transmission Unit) - Hint
+
1266  l2capoutbuf[9] = 0x02; // Config Opt: length
+
1267  l2capoutbuf[10] = 0xFF; // MTU
+
1268  l2capoutbuf[11] = 0xFF;
+
1269 
+
1270  L2CAP_Command(handle, l2capoutbuf, 12);
+
1271 }
+
1272 
+
1273 void BTD::l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t* scid) {
+
1274  l2capoutbuf[0] = L2CAP_CMD_CONFIG_RESPONSE; // Code
+
1275  l2capoutbuf[1] = rxid; // Identifier
+
1276  l2capoutbuf[2] = 0x0A; // Length
+
1277  l2capoutbuf[3] = 0x00;
+
1278  l2capoutbuf[4] = scid[0]; // Source CID
+
1279  l2capoutbuf[5] = scid[1];
+
1280  l2capoutbuf[6] = 0x00; // Flag
+
1281  l2capoutbuf[7] = 0x00;
+
1282  l2capoutbuf[8] = 0x00; // Result
+
1283  l2capoutbuf[9] = 0x00;
+
1284  l2capoutbuf[10] = 0x01; // Config
+
1285  l2capoutbuf[11] = 0x02;
+
1286  l2capoutbuf[12] = 0xA0;
+
1287  l2capoutbuf[13] = 0x02;
+
1288 
+
1289  L2CAP_Command(handle, l2capoutbuf, 14);
+
1290 }
+
1291 
+
1292 void BTD::l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid) {
+
1293  l2capoutbuf[0] = L2CAP_CMD_DISCONNECT_REQUEST; // Code
+
1294  l2capoutbuf[1] = rxid; // Identifier
+
1295  l2capoutbuf[2] = 0x04; // Length
+
1296  l2capoutbuf[3] = 0x00;
+
1297  l2capoutbuf[4] = dcid[0];
+
1298  l2capoutbuf[5] = dcid[1];
+
1299  l2capoutbuf[6] = scid[0];
+
1300  l2capoutbuf[7] = scid[1];
+
1301 
+
1302  L2CAP_Command(handle, l2capoutbuf, 8);
+
1303 }
+
1304 
+
1305 void BTD::l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid) {
+
1306  l2capoutbuf[0] = L2CAP_CMD_DISCONNECT_RESPONSE; // Code
+
1307  l2capoutbuf[1] = rxid; // Identifier
+
1308  l2capoutbuf[2] = 0x04; // Length
+
1309  l2capoutbuf[3] = 0x00;
+
1310  l2capoutbuf[4] = dcid[0];
+
1311  l2capoutbuf[5] = dcid[1];
+
1312  l2capoutbuf[6] = scid[0];
+
1313  l2capoutbuf[7] = scid[1];
+
1314 
+
1315  L2CAP_Command(handle, l2capoutbuf, 8);
+
1316 }
+
1317 
+
1318 void BTD::l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh) {
+
1319  l2capoutbuf[0] = L2CAP_CMD_INFORMATION_RESPONSE; // Code
+
1320  l2capoutbuf[1] = rxid; // Identifier
+
1321  l2capoutbuf[2] = 0x08; // Length
+
1322  l2capoutbuf[3] = 0x00;
+
1323  l2capoutbuf[4] = infoTypeLow;
+
1324  l2capoutbuf[5] = infoTypeHigh;
+
1325  l2capoutbuf[6] = 0x00; // Result = success
+
1326  l2capoutbuf[7] = 0x00; // Result = success
+
1327  l2capoutbuf[8] = 0x00;
+
1328  l2capoutbuf[9] = 0x00;
+
1329  l2capoutbuf[10] = 0x00;
+
1330  l2capoutbuf[11] = 0x00;
+
1331 
+
1332  L2CAP_Command(handle, l2capoutbuf, 12);
+
1333 }
+
1334 
+
1335 /* PS3 Commands - only set Bluetooth address is implemented in this library */
+
1336 void BTD::setBdaddr(uint8_t* bdaddr) {
+
1337  /* Set the internal Bluetooth address */
+
1338  uint8_t buf[8];
+
1339  buf[0] = 0x01;
+
1340  buf[1] = 0x00;
+
1341 
+
1342  for(uint8_t i = 0; i < 6; i++)
+
1343  buf[i + 2] = bdaddr[5 - i]; // Copy into buffer, has to be written reversed, so it is MSB first
+
1344 
+
1345  // bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF5), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data
+
1346  pUsb->ctrlReq(bAddress, epInfo[BTD_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);
+
1347 }
+
1348 
+
1349 void BTD::setMoveBdaddr(uint8_t* bdaddr) {
+
1350  /* Set the internal Bluetooth address */
+
1351  uint8_t buf[11];
+
1352  buf[0] = 0x05;
+
1353  buf[7] = 0x10;
+
1354  buf[8] = 0x01;
+
1355  buf[9] = 0x02;
+
1356  buf[10] = 0x12;
+
1357 
+
1358  for(uint8_t i = 0; i < 6; i++)
+
1359  buf[i + 1] = bdaddr[i];
+
1360 
+
1361  // bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x05), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data
+
1362  pUsb->ctrlReq(bAddress, epInfo[BTD_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x05, 0x03, 0x00, 11, 11, buf, NULL);
+
1363 }
+
static const uint8_t BTD_DATAOUT_PIPE
Definition: BTD.h:521
+
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:769
+
bool incomingWii
Definition: BTD.h:471
Definition: address.h:83
-
void hci_connect()
Definition: BTD.cpp:1042
-
uint8_t bNumEP
Definition: BTD.h:546
+
void hci_connect()
Definition: BTD.cpp:1050
+
uint8_t bNumEP
Definition: BTD.h:510
EpInfo * epinfo
Definition: address.h:76
-
const char * btdName
Definition: BTD.h:480
-
void hci_reset()
Definition: BTD.cpp:924
-
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1231
-
#define HCI_SCANNING_STATE
Definition: BTD.h:54
+
const char * btdName
Definition: BTD.h:444
+
void hci_reset()
Definition: BTD.cpp:932
+
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1239
+
#define HCI_SCANNING_STATE
Definition: BTD.h:52
bool lowspeed
Definition: address.h:79
-
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:81
-
void l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)
Definition: BTD.cpp:1218
-
#define EV_COMMAND_STATUS
Definition: BTD.h:98
-
#define EV_REMOTE_NAME_COMPLETE
Definition: BTD.h:85
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
+
void l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)
Definition: BTD.cpp:1226
+
#define EV_COMMAND_STATUS
Definition: BTD.h:96
+
#define EV_REMOTE_NAME_COMPLETE
Definition: BTD.h:83
uint8_t bmNakPower
Definition: address.h:42
-
bool sdpConnectionClaimed
Definition: BTD.h:475
-
#define bmREQ_HCI_OUT
Definition: BTD.h:36
-
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1284
+
bool sdpConnectionClaimed
Definition: BTD.h:439
+
#define bmREQ_HCI_OUT
Definition: BTD.h:37
+
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1292
Definition: address.h:75
-
bool rfcommConnectionClaimed
Definition: BTD.h:477
-
uint8_t hci_version
Definition: BTD.h:497
+
bool rfcommConnectionClaimed
Definition: BTD.h:441
+
uint8_t hci_version
Definition: BTD.h:461
uint16_t idVendor
Definition: usb_ch9.h:106
-
#define EV_INQUIRY_COMPLETE
Definition: BTD.h:79
-
void hci_inquiry()
Definition: BTD.cpp:1020
-
static const uint8_t BTD_EVENT_PIPE
Definition: BTD.h:553
-
#define PS3MOVE_PID
Definition: BTD.h:27
+
#define EV_INQUIRY_COMPLETE
Definition: BTD.h:77
+
void hci_inquiry()
Definition: BTD.cpp:1028
+
static const uint8_t BTD_EVENT_PIPE
Definition: BTD.h:517
+
#define PS3MOVE_PID
Definition: BTD.h:28
Definition: usb_ch9.h:141
uint8_t bInterval
Definition: usb_ch9.h:147
-
bool pairWithWii
Definition: BTD.h:509
+
bool pairWithWii
Definition: BTD.h:473
uint8_t bLength
Definition: usb_ch9.h:142
uint8_t bMaxPacketSize0
Definition: usb_ch9.h:105
-
void hci_write_scan_disable()
Definition: BTD.cpp:946
+
#define HID_REQUEST_SET_REPORT
Definition: hid.h:72
+
void hci_write_scan_disable()
Definition: BTD.cpp:954
#define NotifyFail(...)
Definition: message.h:55
-
#define HCI_SET_NAME_STATE
Definition: BTD.h:47
-
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: BTD.cpp:314
-
#define EV_LINK_KEY_REQUEST
Definition: BTD.h:91
-
#define HCI_DONE_STATE
Definition: BTD.h:59
-
#define BTD_NUM_SERVICES
Definition: BTD.h:190
-
#define EV_DATA_BUFFER_OVERFLOW
Definition: BTD.h:93
-
#define HCI_DISCONNECT_STATE
Definition: BTD.h:60
-
#define HCI_FLAG_CONNECT_COMPLETE
Definition: BTD.h:64
-
#define EV_PIN_CODE_REQUEST
Definition: BTD.h:90
-
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:805
-
const char * btdPin
Definition: BTD.h:482
-
bool motionPlusInside
Definition: BTD.h:511
-
#define EV_AUTHENTICATION_COMPLETE
Definition: BTD.h:84
-
void hci_remote_name()
Definition: BTD.cpp:989
-
#define HCI_FLAG_CONNECT_EVENT
Definition: BTD.h:71
-
#define HCI_FLAG_DISCONNECT_COMPLETE
Definition: BTD.h:65
-
#define HCI_REMOTE_NAME_STATE
Definition: BTD.h:56
-
#define USB_ERROR_FailGetDevDescr
Definition: UsbCore.h:87
-
#define HCI_FLAG_CMD_COMPLETE
Definition: BTD.h:63
-
#define PS3_VID
Definition: BTD.h:24
+
#define HCI_SET_NAME_STATE
Definition: BTD.h:45
+
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: BTD.cpp:314
+
#define EV_LINK_KEY_REQUEST
Definition: BTD.h:89
+
#define HCI_DONE_STATE
Definition: BTD.h:57
+
#define BTD_NUM_SERVICES
Definition: BTD.h:188
+
#define EV_DATA_BUFFER_OVERFLOW
Definition: BTD.h:91
+
#define HCI_DISCONNECT_STATE
Definition: BTD.h:58
+
#define HCI_FLAG_CONNECT_COMPLETE
Definition: BTD.h:62
+
#define EV_PIN_CODE_REQUEST
Definition: BTD.h:88
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
+
const char * btdPin
Definition: BTD.h:446
+
bool motionPlusInside
Definition: BTD.h:475
+
#define EV_AUTHENTICATION_COMPLETE
Definition: BTD.h:82
+
void hci_remote_name()
Definition: BTD.cpp:997
+
#define bmREQ_HID_OUT
Definition: hid.h:63
+
#define HCI_FLAG_CONNECT_EVENT
Definition: BTD.h:69
+
#define HCI_FLAG_DISCONNECT_COMPLETE
Definition: BTD.h:63
+
#define HCI_REMOTE_NAME_STATE
Definition: BTD.h:54
+
#define USB_ERROR_FailGetDevDescr
Definition: UsbCore.h:89
+
#define HCI_FLAG_CMD_COMPLETE
Definition: BTD.h:61
+
#define PS3_VID
Definition: BTD.h:25
#define NotifyFailGetDevDescr(...)
Definition: message.h:50
BTD(USB *p)
Definition: BTD.cpp:27
-
char remote_name[30]
Definition: BTD.h:491
-
#define hrJERR
Definition: max3421e.h:225
+
char remote_name[30]
Definition: BTD.h:455
+
#define hrJERR
Definition: max3421e.h:220
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
-
virtual void Reset()
-
#define EV_MAX_SLOTS_CHANGE
Definition: BTD.h:94
-
static const uint8_t BTD_DATAIN_PIPE
Definition: BTD.h:555
-
void hci_set_local_name(const char *name)
Definition: BTD.cpp:1008
-
#define EV_QOS_SETUP_COMPLETE
Definition: BTD.h:96
-
void hci_write_scan_enable()
Definition: BTD.cpp:933
-
virtual uint8_t Release()
Definition: BTD.cpp:365
+
virtual void Reset()=0
+
#define EV_MAX_SLOTS_CHANGE
Definition: BTD.h:92
+
static const uint8_t BTD_DATAIN_PIPE
Definition: BTD.h:519
+
void hci_set_local_name(const char *name)
Definition: BTD.cpp:1016
+
#define EV_QOS_SETUP_COMPLETE
Definition: BTD.h:94
+
void hci_write_scan_enable()
Definition: BTD.cpp:941
+
uint8_t Release()
Definition: BTD.cpp:365
virtual void FreeAddress(uint8_t addr)=0
uint8_t epAttribs
Definition: address.h:37
-
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1297
+
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1305
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
Definition: Usb.cpp:126
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
-
bool watingForConnection
Definition: BTD.h:471
-
#define HCI_BDADDR_STATE
Definition: BTD.h:45
-
#define HCI_CONNECT_DEVICE_STATE
Definition: BTD.h:51
+
bool watingForConnection
Definition: BTD.h:435
+
#define HCI_BDADDR_STATE
Definition: BTD.h:43
+
#define HCI_CONNECT_DEVICE_STATE
Definition: BTD.h:49
#define Notify(...)
Definition: message.h:44
-
bool connectToHIDDevice
Definition: BTD.h:519
+
bool connectToHIDDevice
Definition: BTD.h:483
uint8_t bmAttributes
Definition: usb_ch9.h:145
-
-
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:796
-
uint8_t bAddress
Definition: BTD.h:539
+
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
+
uint8_t bAddress
Definition: BTD.h:503
#define NotifyFailGetConfDescr(...)
Definition: message.h:52
uint8_t epAddr
Definition: address.h:33
-
bool incomingHIDDevice
Definition: BTD.h:523
+
bool incomingHIDDevice
Definition: BTD.h:487
#define NotifyFailUnknownDevice(...)
Definition: message.h:54
-
bool pairWithHIDDevice
Definition: BTD.h:525
-
uint32_t qNextPollTime
Definition: BTD.h:548
+
bool pairWithHIDDevice
Definition: BTD.h:489
+
uint32_t qNextPollTime
Definition: BTD.h:512
#define USB_NAK_MAX_POWER
Definition: address.h:27
-
#define EV_CONNECT_COMPLETE
Definition: BTD.h:81
+
#define EV_CONNECT_COMPLETE
Definition: BTD.h:79
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
Definition: BTD.cpp:346
-
#define EV_DISCONNECT_COMPLETE
Definition: BTD.h:83
-
#define HCI_FLAG_READ_BDADDR
Definition: BTD.h:68
-
#define IOGEAR_GBU521_PID
Definition: BTD.h:30
-
bool connectToWii
Definition: BTD.h:503
-
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: BTD.cpp:48
-
#define HCI_LOCAL_VERSION_STATE
Definition: BTD.h:46
-
bool wiiUProController
Definition: BTD.h:513
-
uint16_t hci_handle
Definition: BTD.h:487
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: BTD.cpp:122
+
#define EV_DISCONNECT_COMPLETE
Definition: BTD.h:81
+
#define HCI_FLAG_READ_BDADDR
Definition: BTD.h:66
+
#define IOGEAR_GBU521_PID
Definition: BTD.h:31
+
bool connectToWii
Definition: BTD.h:467
+
uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: BTD.cpp:48
+
#define HCI_LOCAL_VERSION_STATE
Definition: BTD.h:44
+
virtual void disconnect()=0
+
bool wiiUProController
Definition: BTD.h:477
+
uint16_t hci_handle
Definition: BTD.h:451
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: BTD.cpp:122
#define Notifyc(...)
Definition: message.h:46
Definition: address.h:32
-
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1142
-
#define HCI_RESET_STATE
Definition: BTD.h:43
+
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1150
+
#define HCI_RESET_STATE
Definition: BTD.h:41
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
Definition: Usb.cpp:292
-
#define hrNAK
Definition: max3421e.h:216
-
void hci_read_bdaddr()
Definition: BTD.cpp:955
-
void hci_inquiry_cancel()
Definition: BTD.cpp:1034
-
#define L2CAP_CMD_INFORMATION_RESPONSE
Definition: BTD.h:173
+
#define hrNAK
Definition: max3421e.h:211
+
void hci_read_bdaddr()
Definition: BTD.cpp:963
+
void hci_inquiry_cancel()
Definition: BTD.cpp:1042
+
#define L2CAP_CMD_INFORMATION_RESPONSE
Definition: BTD.h:171
uint16_t wMaxPacketSize
Definition: usb_ch9.h:146
-
uint8_t my_bdaddr[6]
Definition: BTD.h:485
-
#define HID_REQUEST_SET_REPORT
Definition: BTD.h:39
-
#define EV_INCOMING_CONNECT
Definition: BTD.h:82
-
#define HCI_CONNECT_IN_STATE
Definition: BTD.h:55
+
virtual void Run()=0
+
uint8_t my_bdaddr[6]
Definition: BTD.h:449
+
#define EV_INCOMING_CONNECT
Definition: BTD.h:80
+
#define HCI_CONNECT_IN_STATE
Definition: BTD.h:53
-
#define HCI_INQUIRY_STATE
Definition: BTD.h:50
+
#define HCI_INQUIRY_STATE
Definition: BTD.h:48
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
uint8_t bEndpointAddress
Definition: usb_ch9.h:144
-
#define HCI_CONNECTED_STATE
Definition: BTD.h:57
-
#define EV_INQUIRY_RESULT
Definition: BTD.h:80
-
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:83
-
#define L2CAP_CMD_CONFIG_REQUEST
Definition: BTD.h:168
-
virtual uint8_t Poll()
Definition: BTD.cpp:371
-
#define L2CAP_CMD_DISCONNECT_REQUEST
Definition: BTD.h:170
-
static const uint8_t BTD_CONTROL_PIPE
Definition: BTD.h:551
+
#define HCI_CONNECTED_STATE
Definition: BTD.h:55
+
#define EV_INQUIRY_RESULT
Definition: BTD.h:78
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
+
#define L2CAP_CMD_CONFIG_REQUEST
Definition: BTD.h:166
+
#define PSTR(str)
+
uint8_t Poll()
Definition: BTD.cpp:371
+
#define L2CAP_CMD_DISCONNECT_REQUEST
Definition: BTD.h:168
+
static const uint8_t BTD_CONTROL_PIPE
Definition: BTD.h:515
uint8_t bDescriptorType
Definition: usb_ch9.h:143
-
#define BULK_MAXPKTSIZE
Definition: BTD.h:33
-
#define HCI_FLAG_READ_VERSION
Definition: BTD.h:69
-
uint8_t disc_bdaddr[6]
Definition: BTD.h:489
-
bool l2capConnectionClaimed
Definition: BTD.h:473
+
#define BULK_MAXPKTSIZE
Definition: BTD.h:34
+
void disconnect()
Definition: BTD.cpp:383
+
#define HCI_FLAG_READ_VERSION
Definition: BTD.h:67
+
uint8_t disc_bdaddr[6]
Definition: BTD.h:453
+
bool l2capConnectionClaimed
Definition: BTD.h:437
#define USB_NAK_NOWAIT
Definition: address.h:29
-
#define HCI_FLAG_INCOMING_REQUEST
Definition: BTD.h:67
-
#define EV_NUM_COMPLETE_PKT
Definition: BTD.h:89
-
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:80
-
EpInfo epInfo[BTD_MAX_ENDPOINTS]
Definition: BTD.h:541
-
#define IOGEAR_GBU521_VID
Definition: BTD.h:29
-
virtual void ACLData(uint8_t *ACLData)
-
#define PS3_PID
Definition: BTD.h:25
+
#define HCI_FLAG_INCOMING_REQUEST
Definition: BTD.h:65
+
#define EV_NUM_COMPLETE_PKT
Definition: BTD.h:87
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
+
EpInfo epInfo[BTD_MAX_ENDPOINTS]
Definition: BTD.h:505
+
#define IOGEAR_GBU521_VID
Definition: BTD.h:30
+
#define PS3_PID
Definition: BTD.h:26
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
Definition: Usb.cpp:206
-
#define BTD_MAX_ENDPOINTS
Definition: BTD.h:189
-
#define PS3NAVIGATION_PID
Definition: BTD.h:26
-
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:75
-
#define L2CAP_CMD_DISCONNECT_RESPONSE
Definition: BTD.h:171
-
#define EV_READ_REMOTE_VERSION_INFORMATION_COMPLETE
Definition: BTD.h:95
-
#define EV_COMMAND_COMPLETE
Definition: BTD.h:97
-
void l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh)
Definition: BTD.cpp:1310
+
#define BTD_MAX_ENDPOINTS
Definition: BTD.h:187
+
#define PS3NAVIGATION_PID
Definition: BTD.h:27
+
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:77
+
#define L2CAP_CMD_DISCONNECT_RESPONSE
Definition: BTD.h:169
+
#define EV_READ_REMOTE_VERSION_INFORMATION_COMPLETE
Definition: BTD.h:93
+
#define EV_COMMAND_COMPLETE
Definition: BTD.h:95
+
void l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh)
Definition: BTD.cpp:1318
uint16_t idProduct
Definition: usb_ch9.h:107
-
#define L2CAP_CMD_CONNECTION_RESPONSE
Definition: BTD.h:167
-
#define L2CAP_CMD_CONFIG_RESPONSE
Definition: BTD.h:169
-
#define hci_set_flag(flag)
Definition: BTD.h:75
-
void hci_write_class_of_device()
Definition: BTD.cpp:1154
-
#define HCI_CONNECTED_DEVICE_STATE
Definition: BTD.h:52
-
#define HCI_INIT_STATE
Definition: BTD.h:42
-
#define bmREQ_HID_OUT
Definition: BTD.h:38
-
void hci_pin_code_negative_request_reply()
Definition: BTD.cpp:1104
-
#define EV_CHANGE_CONNECTION_LINK
Definition: BTD.h:87
+
#define L2CAP_CMD_CONNECTION_RESPONSE
Definition: BTD.h:165
+
#define L2CAP_CMD_CONFIG_RESPONSE
Definition: BTD.h:167
+
#define hci_set_flag(flag)
Definition: BTD.h:73
+
void hci_write_class_of_device()
Definition: BTD.cpp:1162
+
#define HCI_CONNECTED_DEVICE_STATE
Definition: BTD.h:50
+
#define HCI_INIT_STATE
Definition: BTD.h:40
+
void hci_pin_code_negative_request_reply()
Definition: BTD.cpp:1112
+
#define EV_CHANGE_CONNECTION_LINK
Definition: BTD.h:85
+
virtual void ACLData(uint8_t *ACLData)=0
uint8_t bNumConfigurations
Definition: usb_ch9.h:112
-
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:78
-
#define hci_check_flag(flag)
Definition: BTD.h:74
-
#define EV_ROLE_CHANGED
Definition: BTD.h:88
+
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:80
+
#define hci_check_flag(flag)
Definition: BTD.h:72
+
#define EV_ROLE_CHANGED
Definition: BTD.h:86
uint8_t maxPktSize
Definition: address.h:34
-
AddressPool & GetAddressPool()
Definition: UsbCore.h:206
-
#define HCI_CHECK_DEVICE_SERVICE
Definition: BTD.h:48
-
Definition: UsbCore.h:190
-
virtual void Run()
-
uint8_t bConfNum
Definition: BTD.h:544
-
void hci_link_key_request_negative_reply()
Definition: BTD.cpp:1118
-
#define EV_LOOPBACK_COMMAND
Definition: BTD.h:99
-
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1190
-
#define EV_LINK_KEY_NOTIFICATION
Definition: BTD.h:92
-
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1265
-
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1248
-
void hci_pin_code_request_reply()
Definition: BTD.cpp:1068
-
#define L2CAP_CMD_CONNECTION_REQUEST
Definition: BTD.h:166
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
#define HCI_CHECK_DEVICE_SERVICE
Definition: BTD.h:46
+
Definition: UsbCore.h:197
+
uint8_t bConfNum
Definition: BTD.h:508
+
void hci_link_key_request_negative_reply()
Definition: BTD.cpp:1126
+
#define EV_LOOPBACK_COMMAND
Definition: BTD.h:97
+
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1198
+
#define EV_LINK_KEY_NOTIFICATION
Definition: BTD.h:90
+
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1273
+
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1256
+
void hci_pin_code_request_reply()
Definition: BTD.cpp:1076
+
#define L2CAP_CMD_CONNECTION_REQUEST
Definition: BTD.h:164
-
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:210
-
#define EV_ENCRYPTION_CHANGE
Definition: BTD.h:86
+
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:217
+
#define EV_ENCRYPTION_CHANGE
Definition: BTD.h:84
#define NotifyFailSetConfDescr(...)
Definition: message.h:53
-
#define hci_clear_flag(flag)
Definition: BTD.h:76
-
USB * pUsb
Definition: BTD.h:533
+
#define hci_clear_flag(flag)
Definition: BTD.h:74
+
USB * pUsb
Definition: BTD.h:497
#define NotifyStr(...)
Definition: message.h:45
-
void hci_authentication_request()
Definition: BTD.cpp:1132
-
void hci_read_local_version_information()
Definition: BTD.cpp:964
-
#define HCI_FLAG_REMOTE_NAME_COMPLETE
Definition: BTD.h:66
-
void hci_accept_connection()
Definition: BTD.cpp:973
-
#define EV_PAGE_SCAN_REP_MODE
Definition: BTD.h:100
-
#define HCI_FLAG_DEVICE_FOUND
Definition: BTD.h:70
-
#define HCI_CLASS_STATE
Definition: BTD.h:44
-
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:761
+
void hci_authentication_request()
Definition: BTD.cpp:1140
+
void hci_read_local_version_information()
Definition: BTD.cpp:972
+
#define HCI_FLAG_REMOTE_NAME_COMPLETE
Definition: BTD.h:64
+
void hci_accept_connection()
Definition: BTD.cpp:981
+
#define EV_PAGE_SCAN_REP_MODE
Definition: BTD.h:98
+
#define HCI_FLAG_DEVICE_FOUND
Definition: BTD.h:68
+
#define HCI_CLASS_STATE
Definition: BTD.h:42
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:51
-
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
Definition: UsbCore.h:86
-
void HCI_Command(uint8_t *data, uint16_t nbytes)
Definition: BTD.cpp:919
+
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
Definition: UsbCore.h:88
+
void HCI_Command(uint8_t *data, uint16_t nbytes)
Definition: BTD.cpp:927
Definition: usb_ch9.h:98
diff --git a/_b_t_d_8h.html b/_b_t_d_8h.html index 02cf46e7..b8f1d579 100644 --- a/_b_t_d_8h.html +++ b/_b_t_d_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: BTD.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -93,12 +94,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
#include "Usb.h"
+#include "hid.h"
Include dependency graph for BTD.h:
- +
This graph shows which files directly or indirectly include this file:
@@ -112,10 +114,10 @@ This graph shows which files directly or indirectly include this file:
- - + +

Classes

class  BluetoothService
 
class  BTD
 
class  BluetoothService
 
@@ -135,10 +137,6 @@ Macros - - - - @@ -173,23 +171,23 @@ Macros - + - + - + - + - + - + - + - + - + @@ -281,35 +279,35 @@ Macros - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -357,8 +355,6 @@ Macros - -

Macros

 
#define bmREQ_HCI_OUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_DEVICE
 
#define bmREQ_HID_OUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
 
#define HID_REQUEST_SET_REPORT   0x09
 
#define HCI_INIT_STATE   0
 
#define HCI_RESET_STATE   1
 
#define HCI_DISCONNECT_STATE   16
 
#define HCI_FLAG_CMD_COMPLETE   0x01
#define HCI_FLAG_CMD_COMPLETE   (1UL << 0)
 
#define HCI_FLAG_CONNECT_COMPLETE   0x02
#define HCI_FLAG_CONNECT_COMPLETE   (1UL << 1)
 
#define HCI_FLAG_DISCONNECT_COMPLETE   0x04
#define HCI_FLAG_DISCONNECT_COMPLETE   (1UL << 2)
 
#define HCI_FLAG_REMOTE_NAME_COMPLETE   0x08
#define HCI_FLAG_REMOTE_NAME_COMPLETE   (1UL << 3)
 
#define HCI_FLAG_INCOMING_REQUEST   0x10
#define HCI_FLAG_INCOMING_REQUEST   (1UL << 4)
 
#define HCI_FLAG_READ_BDADDR   0x20
#define HCI_FLAG_READ_BDADDR   (1UL << 5)
 
#define HCI_FLAG_READ_VERSION   0x40
#define HCI_FLAG_READ_VERSION   (1UL << 6)
 
#define HCI_FLAG_DEVICE_FOUND   0x80
#define HCI_FLAG_DEVICE_FOUND   (1UL << 7)
 
#define HCI_FLAG_CONNECT_EVENT   0x100
#define HCI_FLAG_CONNECT_EVENT   (1UL << 8)
 
#define hci_check_flag(flag)   (hci_event_flag & (flag))
 
 
#define WII_INIT_MOTION_PLUS_STATE   21
 
#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST   0x00000001
#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST   (1UL << 0)
 
#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS   0x00000002
#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS   (1UL << 1)
 
#define L2CAP_FLAG_CONTROL_CONNECTED   0x00000004
#define L2CAP_FLAG_CONTROL_CONNECTED   (1UL << 2)
 
#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE   0x00000008
#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE   (1UL << 3)
 
#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST   0x00000010
#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST   (1UL << 4)
 
#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS   0x00000020
#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS   (1UL << 5)
 
#define L2CAP_FLAG_INTERRUPT_CONNECTED   0x00000040
#define L2CAP_FLAG_INTERRUPT_CONNECTED   (1UL << 6)
 
#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE   0x00000080
#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE   (1UL << 7)
 
#define L2CAP_FLAG_CONNECTION_SDP_REQUEST   0x00000100
#define L2CAP_FLAG_CONNECTION_SDP_REQUEST   (1UL << 8)
 
#define L2CAP_FLAG_CONFIG_SDP_SUCCESS   0x00000200
#define L2CAP_FLAG_CONFIG_SDP_SUCCESS   (1UL << 9)
 
#define L2CAP_FLAG_DISCONNECT_SDP_REQUEST   0x00000400
#define L2CAP_FLAG_DISCONNECT_SDP_REQUEST   (1UL << 10)
 
#define L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST   0x00000800
#define L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST   (1UL << 11)
 
#define L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS   0x00001000
#define L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS   (1UL << 12)
 
#define L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST   0x00002000
#define L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST   (1UL << 13)
 
#define L2CAP_FLAG_DISCONNECT_RESPONSE   0x00004000
#define L2CAP_FLAG_DISCONNECT_RESPONSE   (1UL << 14)
 
#define l2cap_check_flag(flag)   (l2cap_event_flag & (flag))
 
 
#define PAIR   1
 
#define UHS_ACL_HANDLE_OK(x, y)   ((x[0] == (y & 0xff)) && (x[1] == ((y >> 8) | 0x20)))
 

Macro Definition Documentation

@@ -371,7 +367,7 @@ Macros
-

Definition at line 24 of file BTD.h.

+

Definition at line 25 of file BTD.h.

@@ -385,7 +381,7 @@ Macros
-

Definition at line 25 of file BTD.h.

+

Definition at line 26 of file BTD.h.

@@ -399,7 +395,7 @@ Macros
-

Definition at line 26 of file BTD.h.

+

Definition at line 27 of file BTD.h.

@@ -413,7 +409,7 @@ Macros
-

Definition at line 27 of file BTD.h.

+

Definition at line 28 of file BTD.h.

@@ -427,7 +423,7 @@ Macros
-

Definition at line 29 of file BTD.h.

+

Definition at line 30 of file BTD.h.

@@ -441,7 +437,7 @@ Macros
-

Definition at line 30 of file BTD.h.

+

Definition at line 31 of file BTD.h.

@@ -455,7 +451,7 @@ Macros
-

Definition at line 33 of file BTD.h.

+

Definition at line 34 of file BTD.h.

@@ -469,35 +465,7 @@ Macros
-

Definition at line 36 of file BTD.h.

- -
- - -
-
- - - - -
#define bmREQ_HID_OUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
-
- -

Definition at line 38 of file BTD.h.

- -
-
- -
-
- - - - -
#define HID_REQUEST_SET_REPORT   0x09
-
- -

Definition at line 39 of file BTD.h.

+

Definition at line 37 of file BTD.h.

@@ -511,7 +479,7 @@ Macros
-

Definition at line 42 of file BTD.h.

+

Definition at line 40 of file BTD.h.

@@ -525,7 +493,7 @@ Macros
-

Definition at line 43 of file BTD.h.

+

Definition at line 41 of file BTD.h.

@@ -539,7 +507,7 @@ Macros
-

Definition at line 44 of file BTD.h.

+

Definition at line 42 of file BTD.h.

@@ -553,7 +521,7 @@ Macros
-

Definition at line 45 of file BTD.h.

+

Definition at line 43 of file BTD.h.

@@ -567,7 +535,7 @@ Macros
-

Definition at line 46 of file BTD.h.

+

Definition at line 44 of file BTD.h.

@@ -581,7 +549,7 @@ Macros
-

Definition at line 47 of file BTD.h.

+

Definition at line 45 of file BTD.h.

@@ -595,7 +563,7 @@ Macros
-

Definition at line 48 of file BTD.h.

+

Definition at line 46 of file BTD.h.

@@ -609,7 +577,7 @@ Macros
-

Definition at line 50 of file BTD.h.

+

Definition at line 48 of file BTD.h.

@@ -623,7 +591,7 @@ Macros
-

Definition at line 51 of file BTD.h.

+

Definition at line 49 of file BTD.h.

@@ -637,7 +605,7 @@ Macros
-

Definition at line 52 of file BTD.h.

+

Definition at line 50 of file BTD.h.

@@ -651,7 +619,7 @@ Macros
-

Definition at line 54 of file BTD.h.

+

Definition at line 52 of file BTD.h.

@@ -665,7 +633,7 @@ Macros
-

Definition at line 55 of file BTD.h.

+

Definition at line 53 of file BTD.h.

@@ -679,7 +647,7 @@ Macros
-

Definition at line 56 of file BTD.h.

+

Definition at line 54 of file BTD.h.

@@ -693,7 +661,7 @@ Macros
-

Definition at line 57 of file BTD.h.

+

Definition at line 55 of file BTD.h.

@@ -707,7 +675,7 @@ Macros
-

Definition at line 58 of file BTD.h.

+

Definition at line 56 of file BTD.h.

@@ -721,7 +689,7 @@ Macros
-

Definition at line 59 of file BTD.h.

+

Definition at line 57 of file BTD.h.

@@ -735,7 +703,7 @@ Macros
-

Definition at line 60 of file BTD.h.

+

Definition at line 58 of file BTD.h.

@@ -744,12 +712,12 @@ Macros
- +
#define HCI_FLAG_CMD_COMPLETE   0x01#define HCI_FLAG_CMD_COMPLETE   (1UL << 0)
-

Definition at line 63 of file BTD.h.

+

Definition at line 61 of file BTD.h.

@@ -758,12 +726,12 @@ Macros
- +
#define HCI_FLAG_CONNECT_COMPLETE   0x02#define HCI_FLAG_CONNECT_COMPLETE   (1UL << 1)
-

Definition at line 64 of file BTD.h.

+

Definition at line 62 of file BTD.h.

@@ -772,12 +740,12 @@ Macros
- +
#define HCI_FLAG_DISCONNECT_COMPLETE   0x04#define HCI_FLAG_DISCONNECT_COMPLETE   (1UL << 2)
-

Definition at line 65 of file BTD.h.

+

Definition at line 63 of file BTD.h.

@@ -786,12 +754,12 @@ Macros
- +
#define HCI_FLAG_REMOTE_NAME_COMPLETE   0x08#define HCI_FLAG_REMOTE_NAME_COMPLETE   (1UL << 3)
-

Definition at line 66 of file BTD.h.

+

Definition at line 64 of file BTD.h.

@@ -800,12 +768,12 @@ Macros
- +
#define HCI_FLAG_INCOMING_REQUEST   0x10#define HCI_FLAG_INCOMING_REQUEST   (1UL << 4)
-

Definition at line 67 of file BTD.h.

+

Definition at line 65 of file BTD.h.

@@ -814,12 +782,12 @@ Macros
- +
#define HCI_FLAG_READ_BDADDR   0x20#define HCI_FLAG_READ_BDADDR   (1UL << 5)
-

Definition at line 68 of file BTD.h.

+

Definition at line 66 of file BTD.h.

@@ -828,12 +796,12 @@ Macros
- +
#define HCI_FLAG_READ_VERSION   0x40#define HCI_FLAG_READ_VERSION   (1UL << 6)
-

Definition at line 69 of file BTD.h.

+

Definition at line 67 of file BTD.h.

@@ -842,12 +810,12 @@ Macros
- +
#define HCI_FLAG_DEVICE_FOUND   0x80#define HCI_FLAG_DEVICE_FOUND   (1UL << 7)
-

Definition at line 70 of file BTD.h.

+

Definition at line 68 of file BTD.h.

@@ -856,12 +824,12 @@ Macros
- +
#define HCI_FLAG_CONNECT_EVENT   0x100#define HCI_FLAG_CONNECT_EVENT   (1UL << 8)
-

Definition at line 71 of file BTD.h.

+

Definition at line 69 of file BTD.h.

@@ -879,7 +847,7 @@ Macros
-

Definition at line 74 of file BTD.h.

+

Definition at line 72 of file BTD.h.

@@ -897,7 +865,7 @@ Macros
-

Definition at line 75 of file BTD.h.

+

Definition at line 73 of file BTD.h.

@@ -915,7 +883,7 @@ Macros
-

Definition at line 76 of file BTD.h.

+

Definition at line 74 of file BTD.h.

@@ -929,7 +897,7 @@ Macros
-

Definition at line 79 of file BTD.h.

+

Definition at line 77 of file BTD.h.

@@ -943,7 +911,7 @@ Macros
-

Definition at line 80 of file BTD.h.

+

Definition at line 78 of file BTD.h.

@@ -957,7 +925,7 @@ Macros
-

Definition at line 81 of file BTD.h.

+

Definition at line 79 of file BTD.h.

@@ -971,7 +939,7 @@ Macros
-

Definition at line 82 of file BTD.h.

+

Definition at line 80 of file BTD.h.

@@ -985,7 +953,7 @@ Macros
-

Definition at line 83 of file BTD.h.

+

Definition at line 81 of file BTD.h.

@@ -999,7 +967,7 @@ Macros
-

Definition at line 84 of file BTD.h.

+

Definition at line 82 of file BTD.h.

@@ -1013,7 +981,7 @@ Macros
-

Definition at line 85 of file BTD.h.

+

Definition at line 83 of file BTD.h.

@@ -1027,7 +995,7 @@ Macros
-

Definition at line 86 of file BTD.h.

+

Definition at line 84 of file BTD.h.

@@ -1041,7 +1009,7 @@ Macros
-

Definition at line 87 of file BTD.h.

+

Definition at line 85 of file BTD.h.

@@ -1055,7 +1023,7 @@ Macros
-

Definition at line 88 of file BTD.h.

+

Definition at line 86 of file BTD.h.

@@ -1069,7 +1037,7 @@ Macros
-

Definition at line 89 of file BTD.h.

+

Definition at line 87 of file BTD.h.

@@ -1083,7 +1051,7 @@ Macros
-

Definition at line 90 of file BTD.h.

+

Definition at line 88 of file BTD.h.

@@ -1097,7 +1065,7 @@ Macros
-

Definition at line 91 of file BTD.h.

+

Definition at line 89 of file BTD.h.

@@ -1111,7 +1079,7 @@ Macros
-

Definition at line 92 of file BTD.h.

+

Definition at line 90 of file BTD.h.

@@ -1125,7 +1093,7 @@ Macros
-

Definition at line 93 of file BTD.h.

+

Definition at line 91 of file BTD.h.

@@ -1139,7 +1107,7 @@ Macros
-

Definition at line 94 of file BTD.h.

+

Definition at line 92 of file BTD.h.

@@ -1153,7 +1121,7 @@ Macros
-

Definition at line 95 of file BTD.h.

+

Definition at line 93 of file BTD.h.

@@ -1167,7 +1135,7 @@ Macros
-

Definition at line 96 of file BTD.h.

+

Definition at line 94 of file BTD.h.

@@ -1181,7 +1149,7 @@ Macros
-

Definition at line 97 of file BTD.h.

+

Definition at line 95 of file BTD.h.

@@ -1195,7 +1163,7 @@ Macros
-

Definition at line 98 of file BTD.h.

+

Definition at line 96 of file BTD.h.

@@ -1209,7 +1177,7 @@ Macros
-

Definition at line 99 of file BTD.h.

+

Definition at line 97 of file BTD.h.

@@ -1223,7 +1191,7 @@ Macros
-

Definition at line 100 of file BTD.h.

+

Definition at line 98 of file BTD.h.

@@ -1237,7 +1205,7 @@ Macros
-

Definition at line 103 of file BTD.h.

+

Definition at line 101 of file BTD.h.

@@ -1251,7 +1219,7 @@ Macros
-

Definition at line 104 of file BTD.h.

+

Definition at line 102 of file BTD.h.

@@ -1265,7 +1233,7 @@ Macros
-

Definition at line 107 of file BTD.h.

+

Definition at line 105 of file BTD.h.

@@ -1279,7 +1247,7 @@ Macros
-

Definition at line 108 of file BTD.h.

+

Definition at line 106 of file BTD.h.

@@ -1293,7 +1261,7 @@ Macros
-

Definition at line 109 of file BTD.h.

+

Definition at line 107 of file BTD.h.

@@ -1307,7 +1275,7 @@ Macros
-

Definition at line 110 of file BTD.h.

+

Definition at line 108 of file BTD.h.

@@ -1321,7 +1289,7 @@ Macros
-

Definition at line 113 of file BTD.h.

+

Definition at line 111 of file BTD.h.

@@ -1335,7 +1303,7 @@ Macros
-

Definition at line 114 of file BTD.h.

+

Definition at line 112 of file BTD.h.

@@ -1349,7 +1317,7 @@ Macros
-

Definition at line 115 of file BTD.h.

+

Definition at line 113 of file BTD.h.

@@ -1363,7 +1331,7 @@ Macros
-

Definition at line 116 of file BTD.h.

+

Definition at line 114 of file BTD.h.

@@ -1377,7 +1345,7 @@ Macros
-

Definition at line 119 of file BTD.h.

+

Definition at line 117 of file BTD.h.

@@ -1391,7 +1359,7 @@ Macros
-

Definition at line 120 of file BTD.h.

+

Definition at line 118 of file BTD.h.

@@ -1405,7 +1373,7 @@ Macros
-

Definition at line 123 of file BTD.h.

+

Definition at line 121 of file BTD.h.

@@ -1419,7 +1387,7 @@ Macros
-

Definition at line 124 of file BTD.h.

+

Definition at line 122 of file BTD.h.

@@ -1433,7 +1401,7 @@ Macros
-

Definition at line 126 of file BTD.h.

+

Definition at line 124 of file BTD.h.

@@ -1447,7 +1415,7 @@ Macros
-

Definition at line 129 of file BTD.h.

+

Definition at line 127 of file BTD.h.

@@ -1461,7 +1429,7 @@ Macros
-

Definition at line 130 of file BTD.h.

+

Definition at line 128 of file BTD.h.

@@ -1475,7 +1443,7 @@ Macros
-

Definition at line 131 of file BTD.h.

+

Definition at line 129 of file BTD.h.

@@ -1489,7 +1457,7 @@ Macros
-

Definition at line 132 of file BTD.h.

+

Definition at line 130 of file BTD.h.

@@ -1503,7 +1471,7 @@ Macros
-

Definition at line 133 of file BTD.h.

+

Definition at line 131 of file BTD.h.

@@ -1512,12 +1480,12 @@ Macros
- +
#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST   0x00000001#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST   (1UL << 0)
-

Definition at line 136 of file BTD.h.

+

Definition at line 134 of file BTD.h.

@@ -1526,12 +1494,12 @@ Macros
- +
#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS   0x00000002#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS   (1UL << 1)
-

Definition at line 137 of file BTD.h.

+

Definition at line 135 of file BTD.h.

@@ -1540,12 +1508,12 @@ Macros
- +
#define L2CAP_FLAG_CONTROL_CONNECTED   0x00000004#define L2CAP_FLAG_CONTROL_CONNECTED   (1UL << 2)
-

Definition at line 138 of file BTD.h.

+

Definition at line 136 of file BTD.h.

@@ -1554,12 +1522,12 @@ Macros
- +
#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE   0x00000008#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE   (1UL << 3)
-

Definition at line 139 of file BTD.h.

+

Definition at line 137 of file BTD.h.

@@ -1568,12 +1536,12 @@ Macros
- +
#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST   0x00000010#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST   (1UL << 4)
-

Definition at line 142 of file BTD.h.

+

Definition at line 140 of file BTD.h.

@@ -1582,12 +1550,12 @@ Macros
- +
#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS   0x00000020#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS   (1UL << 5)
-

Definition at line 143 of file BTD.h.

+

Definition at line 141 of file BTD.h.

@@ -1596,12 +1564,12 @@ Macros
- +
#define L2CAP_FLAG_INTERRUPT_CONNECTED   0x00000040#define L2CAP_FLAG_INTERRUPT_CONNECTED   (1UL << 6)
-

Definition at line 144 of file BTD.h.

+

Definition at line 142 of file BTD.h.

@@ -1610,12 +1578,12 @@ Macros
- +
#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE   0x00000080#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE   (1UL << 7)
-

Definition at line 145 of file BTD.h.

+

Definition at line 143 of file BTD.h.

@@ -1624,12 +1592,12 @@ Macros
- +
#define L2CAP_FLAG_CONNECTION_SDP_REQUEST   0x00000100#define L2CAP_FLAG_CONNECTION_SDP_REQUEST   (1UL << 8)
-

Definition at line 148 of file BTD.h.

+

Definition at line 146 of file BTD.h.

@@ -1638,12 +1606,12 @@ Macros
- +
#define L2CAP_FLAG_CONFIG_SDP_SUCCESS   0x00000200#define L2CAP_FLAG_CONFIG_SDP_SUCCESS   (1UL << 9)
-

Definition at line 149 of file BTD.h.

+

Definition at line 147 of file BTD.h.

@@ -1652,12 +1620,12 @@ Macros
- +
#define L2CAP_FLAG_DISCONNECT_SDP_REQUEST   0x00000400#define L2CAP_FLAG_DISCONNECT_SDP_REQUEST   (1UL << 10)
-

Definition at line 150 of file BTD.h.

+

Definition at line 148 of file BTD.h.

@@ -1666,12 +1634,12 @@ Macros
- +
#define L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST   0x00000800#define L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST   (1UL << 11)
-

Definition at line 153 of file BTD.h.

+

Definition at line 151 of file BTD.h.

@@ -1680,12 +1648,12 @@ Macros
- +
#define L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS   0x00001000#define L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS   (1UL << 12)
-

Definition at line 154 of file BTD.h.

+

Definition at line 152 of file BTD.h.

@@ -1694,12 +1662,12 @@ Macros
- +
#define L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST   0x00002000#define L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST   (1UL << 13)
-

Definition at line 155 of file BTD.h.

+

Definition at line 153 of file BTD.h.

@@ -1708,12 +1676,12 @@ Macros
- +
#define L2CAP_FLAG_DISCONNECT_RESPONSE   0x00004000#define L2CAP_FLAG_DISCONNECT_RESPONSE   (1UL << 14)
-

Definition at line 157 of file BTD.h.

+

Definition at line 155 of file BTD.h.

@@ -1731,7 +1699,7 @@ Macros
-

Definition at line 160 of file BTD.h.

+

Definition at line 158 of file BTD.h.

@@ -1749,7 +1717,7 @@ Macros
-

Definition at line 161 of file BTD.h.

+

Definition at line 159 of file BTD.h.

@@ -1767,7 +1735,7 @@ Macros
-

Definition at line 162 of file BTD.h.

+

Definition at line 160 of file BTD.h.

@@ -1781,7 +1749,7 @@ Macros
-

Definition at line 165 of file BTD.h.

+

Definition at line 163 of file BTD.h.

@@ -1795,7 +1763,7 @@ Macros
-

Definition at line 166 of file BTD.h.

+

Definition at line 164 of file BTD.h.

@@ -1809,7 +1777,7 @@ Macros
-

Definition at line 167 of file BTD.h.

+

Definition at line 165 of file BTD.h.

@@ -1823,7 +1791,7 @@ Macros
-

Definition at line 168 of file BTD.h.

+

Definition at line 166 of file BTD.h.

@@ -1837,7 +1805,7 @@ Macros
-

Definition at line 169 of file BTD.h.

+

Definition at line 167 of file BTD.h.

@@ -1851,7 +1819,7 @@ Macros
-

Definition at line 170 of file BTD.h.

+

Definition at line 168 of file BTD.h.

@@ -1865,7 +1833,7 @@ Macros
-

Definition at line 171 of file BTD.h.

+

Definition at line 169 of file BTD.h.

@@ -1879,7 +1847,7 @@ Macros
-

Definition at line 172 of file BTD.h.

+

Definition at line 170 of file BTD.h.

@@ -1893,7 +1861,7 @@ Macros
-

Definition at line 173 of file BTD.h.

+

Definition at line 171 of file BTD.h.

@@ -1907,7 +1875,7 @@ Macros
-

Definition at line 176 of file BTD.h.

+

Definition at line 174 of file BTD.h.

@@ -1921,7 +1889,7 @@ Macros
-

Definition at line 177 of file BTD.h.

+

Definition at line 175 of file BTD.h.

@@ -1935,7 +1903,7 @@ Macros
-

Definition at line 180 of file BTD.h.

+

Definition at line 178 of file BTD.h.

@@ -1949,7 +1917,7 @@ Macros
-

Definition at line 181 of file BTD.h.

+

Definition at line 179 of file BTD.h.

@@ -1963,7 +1931,7 @@ Macros
-

Definition at line 182 of file BTD.h.

+

Definition at line 180 of file BTD.h.

@@ -1977,7 +1945,7 @@ Macros
-

Definition at line 183 of file BTD.h.

+

Definition at line 181 of file BTD.h.

@@ -1991,7 +1959,7 @@ Macros
-

Definition at line 186 of file BTD.h.

+

Definition at line 184 of file BTD.h.

@@ -2005,7 +1973,7 @@ Macros
-

Definition at line 187 of file BTD.h.

+

Definition at line 185 of file BTD.h.

@@ -2019,7 +1987,7 @@ Macros
-

Definition at line 189 of file BTD.h.

+

Definition at line 187 of file BTD.h.

@@ -2033,7 +2001,7 @@ Macros
-

Definition at line 190 of file BTD.h.

+

Definition at line 188 of file BTD.h.

@@ -2047,35 +2015,7 @@ Macros
-

Definition at line 192 of file BTD.h.

- -
- - -
-
- - - - - - - - - - - - - - - - - - -
#define UHS_ACL_HANDLE_OK( x,
 
)   ((x[0] == (y & 0xff)) && (x[1] == ((y >> 8) | 0x20)))
-
- -

Definition at line 207 of file BTD.h.

+

Definition at line 190 of file BTD.h.

@@ -2084,7 +2024,7 @@ Macros diff --git a/_b_t_d_8h__dep__incl.md5 b/_b_t_d_8h__dep__incl.md5 index c136623d..3f896a89 100644 --- a/_b_t_d_8h__dep__incl.md5 +++ b/_b_t_d_8h__dep__incl.md5 @@ -1 +1 @@ -a586d33041837831328e4bd5a24cb1bb \ No newline at end of file +1cf25c5527b32b2a9e530f3758fe7f24 \ No newline at end of file diff --git a/_b_t_d_8h__incl.map b/_b_t_d_8h__incl.map index 830f9213..76e8f727 100644 --- a/_b_t_d_8h__incl.map +++ b/_b_t_d_8h__incl.map @@ -1,3 +1,5 @@ - + + + diff --git a/_b_t_d_8h__incl.md5 b/_b_t_d_8h__incl.md5 index c6726354..156dedb9 100644 --- a/_b_t_d_8h__incl.md5 +++ b/_b_t_d_8h__incl.md5 @@ -1 +1 @@ -6a148ecdc8a7fa65c24885517e9426dd \ No newline at end of file +5207daceba9d7a9a37aadb1360508ea8 \ No newline at end of file diff --git a/_b_t_d_8h__incl.png b/_b_t_d_8h__incl.png index dc13158e..be8d4494 100644 Binary files a/_b_t_d_8h__incl.png and b/_b_t_d_8h__incl.png differ diff --git a/_b_t_d_8h_source.html b/_b_t_d_8h_source.html index acb7e89f..181e87c2 100644 --- a/_b_t_d_8h_source.html +++ b/_b_t_d_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: BTD.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -110,461 +111,477 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
19 #define _btd_h_
20 
21 #include "Usb.h"
-
22 
-
23 //PID and VID of the Sony PS3 devices
-
24 #define PS3_VID 0x054C // Sony Corporation
-
25 #define PS3_PID 0x0268 // PS3 Controller DualShock 3
-
26 #define PS3NAVIGATION_PID 0x042F // Navigation controller
-
27 #define PS3MOVE_PID 0x03D5 // Motion controller
-
28 
-
29 #define IOGEAR_GBU521_VID 0x0A5C // The IOGEAR GBU521 dongle does not presents itself correctly, so we have to check for it manually
-
30 #define IOGEAR_GBU521_PID 0x21E8
-
31 
-
32 /* Bluetooth dongle data taken from descriptors */
-
33 #define BULK_MAXPKTSIZE 64 // Max size for ACL data
-
34 
-
35 // Used in control endpoint header for HCI Commands
-
36 #define bmREQ_HCI_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_DEVICE
-
37 // Used in control endpoint header for HID Commands
-
38 #define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
-
39 #define HID_REQUEST_SET_REPORT 0x09
-
40 
-
41 /* Bluetooth HCI states for hci_task() */
-
42 #define HCI_INIT_STATE 0
-
43 #define HCI_RESET_STATE 1
-
44 #define HCI_CLASS_STATE 2
-
45 #define HCI_BDADDR_STATE 3
-
46 #define HCI_LOCAL_VERSION_STATE 4
-
47 #define HCI_SET_NAME_STATE 5
-
48 #define HCI_CHECK_DEVICE_SERVICE 6
-
49 
-
50 #define HCI_INQUIRY_STATE 7 // These three states are only used if it should pair and connect to a device
-
51 #define HCI_CONNECT_DEVICE_STATE 8
-
52 #define HCI_CONNECTED_DEVICE_STATE 9
-
53 
-
54 #define HCI_SCANNING_STATE 10
-
55 #define HCI_CONNECT_IN_STATE 11
-
56 #define HCI_REMOTE_NAME_STATE 12
-
57 #define HCI_CONNECTED_STATE 13
-
58 #define HCI_DISABLE_SCAN_STATE 14
-
59 #define HCI_DONE_STATE 15
-
60 #define HCI_DISCONNECT_STATE 16
-
61 
-
62 /* HCI event flags*/
-
63 #define HCI_FLAG_CMD_COMPLETE 0x01
-
64 #define HCI_FLAG_CONNECT_COMPLETE 0x02
-
65 #define HCI_FLAG_DISCONNECT_COMPLETE 0x04
-
66 #define HCI_FLAG_REMOTE_NAME_COMPLETE 0x08
-
67 #define HCI_FLAG_INCOMING_REQUEST 0x10
-
68 #define HCI_FLAG_READ_BDADDR 0x20
-
69 #define HCI_FLAG_READ_VERSION 0x40
-
70 #define HCI_FLAG_DEVICE_FOUND 0x80
-
71 #define HCI_FLAG_CONNECT_EVENT 0x100
-
72 
-
73 /* Macros for HCI event flag tests */
-
74 #define hci_check_flag(flag) (hci_event_flag & (flag))
-
75 #define hci_set_flag(flag) (hci_event_flag |= (flag))
-
76 #define hci_clear_flag(flag) (hci_event_flag &= ~(flag))
-
77 
-
78 /* HCI Events managed */
-
79 #define EV_INQUIRY_COMPLETE 0x01
-
80 #define EV_INQUIRY_RESULT 0x02
-
81 #define EV_CONNECT_COMPLETE 0x03
-
82 #define EV_INCOMING_CONNECT 0x04
-
83 #define EV_DISCONNECT_COMPLETE 0x05
-
84 #define EV_AUTHENTICATION_COMPLETE 0x06
-
85 #define EV_REMOTE_NAME_COMPLETE 0x07
-
86 #define EV_ENCRYPTION_CHANGE 0x08
-
87 #define EV_CHANGE_CONNECTION_LINK 0x09
-
88 #define EV_ROLE_CHANGED 0x12
-
89 #define EV_NUM_COMPLETE_PKT 0x13
-
90 #define EV_PIN_CODE_REQUEST 0x16
-
91 #define EV_LINK_KEY_REQUEST 0x17
-
92 #define EV_LINK_KEY_NOTIFICATION 0x18
-
93 #define EV_DATA_BUFFER_OVERFLOW 0x1A
-
94 #define EV_MAX_SLOTS_CHANGE 0x1B
-
95 #define EV_READ_REMOTE_VERSION_INFORMATION_COMPLETE 0x0C
-
96 #define EV_QOS_SETUP_COMPLETE 0x0D
-
97 #define EV_COMMAND_COMPLETE 0x0E
-
98 #define EV_COMMAND_STATUS 0x0F
-
99 #define EV_LOOPBACK_COMMAND 0x19
-
100 #define EV_PAGE_SCAN_REP_MODE 0x20
-
101 
-
102 /* Bluetooth states for the different Bluetooth drivers */
-
103 #define L2CAP_WAIT 0
-
104 #define L2CAP_DONE 1
-
105 
-
106 /* Used for HID Control channel */
-
107 #define L2CAP_CONTROL_CONNECT_REQUEST 2
-
108 #define L2CAP_CONTROL_CONFIG_REQUEST 3
-
109 #define L2CAP_CONTROL_SUCCESS 4
-
110 #define L2CAP_CONTROL_DISCONNECT 5
-
111 
-
112 /* Used for HID Interrupt channel */
-
113 #define L2CAP_INTERRUPT_SETUP 6
-
114 #define L2CAP_INTERRUPT_CONNECT_REQUEST 7
-
115 #define L2CAP_INTERRUPT_CONFIG_REQUEST 8
-
116 #define L2CAP_INTERRUPT_DISCONNECT 9
-
117 
-
118 /* Used for SDP channel */
-
119 #define L2CAP_SDP_WAIT 10
-
120 #define L2CAP_SDP_SUCCESS 11
-
121 
-
122 /* Used for RFCOMM channel */
-
123 #define L2CAP_RFCOMM_WAIT 12
-
124 #define L2CAP_RFCOMM_SUCCESS 13
+
22 #include "hid.h"
+
23 
+
24 //PID and VID of the Sony PS3 devices
+
25 #define PS3_VID 0x054C // Sony Corporation
+
26 #define PS3_PID 0x0268 // PS3 Controller DualShock 3
+
27 #define PS3NAVIGATION_PID 0x042F // Navigation controller
+
28 #define PS3MOVE_PID 0x03D5 // Motion controller
+
29 
+
30 #define IOGEAR_GBU521_VID 0x0A5C // The IOGEAR GBU521 dongle does not presents itself correctly, so we have to check for it manually
+
31 #define IOGEAR_GBU521_PID 0x21E8
+
32 
+
33 /* Bluetooth dongle data taken from descriptors */
+
34 #define BULK_MAXPKTSIZE 64 // Max size for ACL data
+
35 
+
36 // Used in control endpoint header for HCI Commands
+
37 #define bmREQ_HCI_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_DEVICE
+
38 
+
39 /* Bluetooth HCI states for hci_task() */
+
40 #define HCI_INIT_STATE 0
+
41 #define HCI_RESET_STATE 1
+
42 #define HCI_CLASS_STATE 2
+
43 #define HCI_BDADDR_STATE 3
+
44 #define HCI_LOCAL_VERSION_STATE 4
+
45 #define HCI_SET_NAME_STATE 5
+
46 #define HCI_CHECK_DEVICE_SERVICE 6
+
47 
+
48 #define HCI_INQUIRY_STATE 7 // These three states are only used if it should pair and connect to a device
+
49 #define HCI_CONNECT_DEVICE_STATE 8
+
50 #define HCI_CONNECTED_DEVICE_STATE 9
+
51 
+
52 #define HCI_SCANNING_STATE 10
+
53 #define HCI_CONNECT_IN_STATE 11
+
54 #define HCI_REMOTE_NAME_STATE 12
+
55 #define HCI_CONNECTED_STATE 13
+
56 #define HCI_DISABLE_SCAN_STATE 14
+
57 #define HCI_DONE_STATE 15
+
58 #define HCI_DISCONNECT_STATE 16
+
59 
+
60 /* HCI event flags*/
+
61 #define HCI_FLAG_CMD_COMPLETE (1UL << 0)
+
62 #define HCI_FLAG_CONNECT_COMPLETE (1UL << 1)
+
63 #define HCI_FLAG_DISCONNECT_COMPLETE (1UL << 2)
+
64 #define HCI_FLAG_REMOTE_NAME_COMPLETE (1UL << 3)
+
65 #define HCI_FLAG_INCOMING_REQUEST (1UL << 4)
+
66 #define HCI_FLAG_READ_BDADDR (1UL << 5)
+
67 #define HCI_FLAG_READ_VERSION (1UL << 6)
+
68 #define HCI_FLAG_DEVICE_FOUND (1UL << 7)
+
69 #define HCI_FLAG_CONNECT_EVENT (1UL << 8)
+
70 
+
71 /* Macros for HCI event flag tests */
+
72 #define hci_check_flag(flag) (hci_event_flag & (flag))
+
73 #define hci_set_flag(flag) (hci_event_flag |= (flag))
+
74 #define hci_clear_flag(flag) (hci_event_flag &= ~(flag))
+
75 
+
76 /* HCI Events managed */
+
77 #define EV_INQUIRY_COMPLETE 0x01
+
78 #define EV_INQUIRY_RESULT 0x02
+
79 #define EV_CONNECT_COMPLETE 0x03
+
80 #define EV_INCOMING_CONNECT 0x04
+
81 #define EV_DISCONNECT_COMPLETE 0x05
+
82 #define EV_AUTHENTICATION_COMPLETE 0x06
+
83 #define EV_REMOTE_NAME_COMPLETE 0x07
+
84 #define EV_ENCRYPTION_CHANGE 0x08
+
85 #define EV_CHANGE_CONNECTION_LINK 0x09
+
86 #define EV_ROLE_CHANGED 0x12
+
87 #define EV_NUM_COMPLETE_PKT 0x13
+
88 #define EV_PIN_CODE_REQUEST 0x16
+
89 #define EV_LINK_KEY_REQUEST 0x17
+
90 #define EV_LINK_KEY_NOTIFICATION 0x18
+
91 #define EV_DATA_BUFFER_OVERFLOW 0x1A
+
92 #define EV_MAX_SLOTS_CHANGE 0x1B
+
93 #define EV_READ_REMOTE_VERSION_INFORMATION_COMPLETE 0x0C
+
94 #define EV_QOS_SETUP_COMPLETE 0x0D
+
95 #define EV_COMMAND_COMPLETE 0x0E
+
96 #define EV_COMMAND_STATUS 0x0F
+
97 #define EV_LOOPBACK_COMMAND 0x19
+
98 #define EV_PAGE_SCAN_REP_MODE 0x20
+
99 
+
100 /* Bluetooth states for the different Bluetooth drivers */
+
101 #define L2CAP_WAIT 0
+
102 #define L2CAP_DONE 1
+
103 
+
104 /* Used for HID Control channel */
+
105 #define L2CAP_CONTROL_CONNECT_REQUEST 2
+
106 #define L2CAP_CONTROL_CONFIG_REQUEST 3
+
107 #define L2CAP_CONTROL_SUCCESS 4
+
108 #define L2CAP_CONTROL_DISCONNECT 5
+
109 
+
110 /* Used for HID Interrupt channel */
+
111 #define L2CAP_INTERRUPT_SETUP 6
+
112 #define L2CAP_INTERRUPT_CONNECT_REQUEST 7
+
113 #define L2CAP_INTERRUPT_CONFIG_REQUEST 8
+
114 #define L2CAP_INTERRUPT_DISCONNECT 9
+
115 
+
116 /* Used for SDP channel */
+
117 #define L2CAP_SDP_WAIT 10
+
118 #define L2CAP_SDP_SUCCESS 11
+
119 
+
120 /* Used for RFCOMM channel */
+
121 #define L2CAP_RFCOMM_WAIT 12
+
122 #define L2CAP_RFCOMM_SUCCESS 13
+
123 
+
124 #define L2CAP_DISCONNECT_RESPONSE 14 // Used for both SDP and RFCOMM channel
125 
-
126 #define L2CAP_DISCONNECT_RESPONSE 14 // Used for both SDP and RFCOMM channel
-
127 
-
128 /* Bluetooth states used by some drivers */
-
129 #define TURN_ON_LED 17
-
130 #define PS3_ENABLE_SIXAXIS 18
-
131 #define WII_CHECK_MOTION_PLUS_STATE 19
-
132 #define WII_CHECK_EXTENSION_STATE 20
-
133 #define WII_INIT_MOTION_PLUS_STATE 21
-
134 
-
135 /* L2CAP event flags for HID Control channel */
-
136 #define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST 0x00000001
-
137 #define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS 0x00000002
-
138 #define L2CAP_FLAG_CONTROL_CONNECTED 0x00000004
-
139 #define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE 0x00000008
-
140 
-
141 /* L2CAP event flags for HID Interrupt channel */
-
142 #define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST 0x00000010
-
143 #define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS 0x00000020
-
144 #define L2CAP_FLAG_INTERRUPT_CONNECTED 0x00000040
-
145 #define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE 0x00000080
-
146 
-
147 /* L2CAP event flags for SDP channel */
-
148 #define L2CAP_FLAG_CONNECTION_SDP_REQUEST 0x00000100
-
149 #define L2CAP_FLAG_CONFIG_SDP_SUCCESS 0x00000200
-
150 #define L2CAP_FLAG_DISCONNECT_SDP_REQUEST 0x00000400
-
151 
-
152 /* L2CAP event flags for RFCOMM channel */
-
153 #define L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST 0x00000800
-
154 #define L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS 0x00001000
-
155 #define L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST 0x00002000
+
126 /* Bluetooth states used by some drivers */
+
127 #define TURN_ON_LED 17
+
128 #define PS3_ENABLE_SIXAXIS 18
+
129 #define WII_CHECK_MOTION_PLUS_STATE 19
+
130 #define WII_CHECK_EXTENSION_STATE 20
+
131 #define WII_INIT_MOTION_PLUS_STATE 21
+
132 
+
133 /* L2CAP event flags for HID Control channel */
+
134 #define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST (1UL << 0)
+
135 #define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS (1UL << 1)
+
136 #define L2CAP_FLAG_CONTROL_CONNECTED (1UL << 2)
+
137 #define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE (1UL << 3)
+
138 
+
139 /* L2CAP event flags for HID Interrupt channel */
+
140 #define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST (1UL << 4)
+
141 #define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS (1UL << 5)
+
142 #define L2CAP_FLAG_INTERRUPT_CONNECTED (1UL << 6)
+
143 #define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE (1UL << 7)
+
144 
+
145 /* L2CAP event flags for SDP channel */
+
146 #define L2CAP_FLAG_CONNECTION_SDP_REQUEST (1UL << 8)
+
147 #define L2CAP_FLAG_CONFIG_SDP_SUCCESS (1UL << 9)
+
148 #define L2CAP_FLAG_DISCONNECT_SDP_REQUEST (1UL << 10)
+
149 
+
150 /* L2CAP event flags for RFCOMM channel */
+
151 #define L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST (1UL << 11)
+
152 #define L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS (1UL << 12)
+
153 #define L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST (1UL << 13)
+
154 
+
155 #define L2CAP_FLAG_DISCONNECT_RESPONSE (1UL << 14)
156 
-
157 #define L2CAP_FLAG_DISCONNECT_RESPONSE 0x00004000
-
158 
-
159 /* Macros for L2CAP event flag tests */
-
160 #define l2cap_check_flag(flag) (l2cap_event_flag & (flag))
-
161 #define l2cap_set_flag(flag) (l2cap_event_flag |= (flag))
-
162 #define l2cap_clear_flag(flag) (l2cap_event_flag &= ~(flag))
-
163 
-
164 /* L2CAP signaling commands */
-
165 #define L2CAP_CMD_COMMAND_REJECT 0x01
-
166 #define L2CAP_CMD_CONNECTION_REQUEST 0x02
-
167 #define L2CAP_CMD_CONNECTION_RESPONSE 0x03
-
168 #define L2CAP_CMD_CONFIG_REQUEST 0x04
-
169 #define L2CAP_CMD_CONFIG_RESPONSE 0x05
-
170 #define L2CAP_CMD_DISCONNECT_REQUEST 0x06
-
171 #define L2CAP_CMD_DISCONNECT_RESPONSE 0x07
-
172 #define L2CAP_CMD_INFORMATION_REQUEST 0x0A
-
173 #define L2CAP_CMD_INFORMATION_RESPONSE 0x0B
-
174 
-
175 // Used For Connection Response - Remember to Include High Byte
-
176 #define PENDING 0x01
-
177 #define SUCCESSFUL 0x00
-
178 
-
179 /* Bluetooth L2CAP PSM - see http://www.bluetooth.org/Technical/AssignedNumbers/logical_link.htm */
-
180 #define SDP_PSM 0x01 // Service Discovery Protocol PSM Value
-
181 #define RFCOMM_PSM 0x03 // RFCOMM PSM Value
-
182 #define HID_CTRL_PSM 0x11 // HID_Control PSM Value
-
183 #define HID_INTR_PSM 0x13 // HID_Interrupt PSM Value
-
184 
-
185 // Used to determine if it is a Bluetooth dongle
-
186 #define WI_SUBCLASS_RF 0x01 // RF Controller
-
187 #define WI_PROTOCOL_BT 0x01 // Bluetooth Programming Interface
-
188 
-
189 #define BTD_MAX_ENDPOINTS 4
-
190 #define BTD_NUM_SERVICES 4 // Max number of Bluetooth services - if you need more than 4 simply increase this number
+
157 /* Macros for L2CAP event flag tests */
+
158 #define l2cap_check_flag(flag) (l2cap_event_flag & (flag))
+
159 #define l2cap_set_flag(flag) (l2cap_event_flag |= (flag))
+
160 #define l2cap_clear_flag(flag) (l2cap_event_flag &= ~(flag))
+
161 
+
162 /* L2CAP signaling commands */
+
163 #define L2CAP_CMD_COMMAND_REJECT 0x01
+
164 #define L2CAP_CMD_CONNECTION_REQUEST 0x02
+
165 #define L2CAP_CMD_CONNECTION_RESPONSE 0x03
+
166 #define L2CAP_CMD_CONFIG_REQUEST 0x04
+
167 #define L2CAP_CMD_CONFIG_RESPONSE 0x05
+
168 #define L2CAP_CMD_DISCONNECT_REQUEST 0x06
+
169 #define L2CAP_CMD_DISCONNECT_RESPONSE 0x07
+
170 #define L2CAP_CMD_INFORMATION_REQUEST 0x0A
+
171 #define L2CAP_CMD_INFORMATION_RESPONSE 0x0B
+
172 
+
173 // Used For Connection Response - Remember to Include High Byte
+
174 #define PENDING 0x01
+
175 #define SUCCESSFUL 0x00
+
176 
+
177 /* Bluetooth L2CAP PSM - see http://www.bluetooth.org/Technical/AssignedNumbers/logical_link.htm */
+
178 #define SDP_PSM 0x01 // Service Discovery Protocol PSM Value
+
179 #define RFCOMM_PSM 0x03 // RFCOMM PSM Value
+
180 #define HID_CTRL_PSM 0x11 // HID_Control PSM Value
+
181 #define HID_INTR_PSM 0x13 // HID_Interrupt PSM Value
+
182 
+
183 // Used to determine if it is a Bluetooth dongle
+
184 #define WI_SUBCLASS_RF 0x01 // RF Controller
+
185 #define WI_PROTOCOL_BT 0x01 // Bluetooth Programming Interface
+
186 
+
187 #define BTD_MAX_ENDPOINTS 4
+
188 #define BTD_NUM_SERVICES 4 // Max number of Bluetooth services - if you need more than 4 simply increase this number
+
189 
+
190 #define PAIR 1
191 
-
192 #define PAIR 1
+
192 class BluetoothService;
193 
-
194 /* acl_handle_ok or it's a new connection */
-
195 #if 0
-
196 #define UHS_ACL_HANDLE_OK(x, y) ((uint16_t)(x[0]) | (uint16_t)(x[1] << 8)) == (y | 0x2000U)
-
197 #else
-
198 /*
-
199  * Better implementation.
-
200  * o One place for this code, it is reused four times in the source.
-
201  * Perhaps it is better as a function.
-
202  * o This should be faster since the && operation can early exit, this means
-
203  * the shift would only be performed if the first byte matches.
-
204  * o Casting is eliminated.
-
205  * o How does this compare in code size? No difference. It is a free optimization.
-
206  */
-
207 #define UHS_ACL_HANDLE_OK(x, y) ((x[0] == (y & 0xff)) && (x[1] == ((y >> 8) | 0x20)))
-
208 #endif
-
209 
-
211 class BluetoothService {
-
212 public:
-
217  virtual void ACLData(uint8_t* ACLData);
-
219  virtual void Run();
-
221  virtual void Reset();
-
223  virtual void disconnect();
-
224 };
-
225 
-
230 class BTD : public USBDeviceConfig, public UsbConfigXtracter {
-
231 public:
-
236  BTD(USB *p);
-
237 
-
246  virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed);
-
254  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
-
259  virtual uint8_t Release();
-
264  virtual uint8_t Poll();
-
265 
-
270  virtual uint8_t GetAddress() {
-
271  return bAddress;
-
272  };
-
273 
-
278  virtual bool isReady() {
-
279  return bPollEnable;
-
280  };
-
281 
-
287  virtual boolean DEVCLASSOK(uint8_t klass) {
-
288  return (klass == USB_CLASS_WIRELESS_CTRL);
-
289  };
-
290 
-
298  virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
-
299  if(vid == IOGEAR_GBU521_VID && pid == IOGEAR_GBU521_PID)
-
300  return true;
-
301  if(my_bdaddr[0] != 0x00 || my_bdaddr[1] != 0x00 || my_bdaddr[2] != 0x00 || my_bdaddr[3] != 0x00 || my_bdaddr[4] != 0x00 || my_bdaddr[5] != 0x00) { // Check if Bluetooth address is set
-
302  if(vid == PS3_VID && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID))
-
303  return true;
-
304  }
-
305  return false;
-
306  };
-
318  virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
-
322  void disconnect() {
-
323  for(uint8_t i = 0; i < BTD_NUM_SERVICES; i++)
-
324  if(btService[i])
-
325  btService[i]->disconnect();
-
326  };
-
327 
-
333  int8_t registerServiceClass(BluetoothService *pService) {
-
334  for(uint8_t i = 0; i < BTD_NUM_SERVICES; i++) {
-
335  if(!btService[i]) {
-
336  btService[i] = pService;
-
337  return i; // Return ID
-
338  }
-
339  }
-
340  return -1; // ErrorregisterServiceClass
-
341  };
-
342 
-
349  void HCI_Command(uint8_t* data, uint16_t nbytes);
-
351  void hci_reset();
-
353  void hci_read_bdaddr();
-
355  void hci_read_local_version_information();
-
360  void hci_set_local_name(const char* name);
-
362  void hci_write_scan_enable();
-
364  void hci_write_scan_disable();
-
366  void hci_remote_name();
-
368  void hci_accept_connection();
-
373  void hci_disconnect(uint16_t handle);
-
379  void hci_pin_code_request_reply();
-
381  void hci_pin_code_negative_request_reply();
-
386  void hci_link_key_request_negative_reply();
-
388  void hci_authentication_request();
-
390  void hci_inquiry();
-
392  void hci_inquiry_cancel();
-
394  void hci_connect();
-
399  void hci_connect(uint8_t *bdaddr);
-
401  void hci_write_class_of_device();
-
413  void L2CAP_Command(uint16_t handle, uint8_t* data, uint8_t nbytes, uint8_t channelLow = 0x01, uint8_t channelHigh = 0x00);
-
421  void l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t* scid, uint16_t psm);
-
430  void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid, uint8_t result);
-
437  void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t* dcid);
-
444  void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t* scid);
-
452  void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);
-
460  void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);
-
467  void l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh);
-
471  bool watingForConnection;
-
473  bool l2capConnectionClaimed;
-
475  bool sdpConnectionClaimed;
-
477  bool rfcommConnectionClaimed;
+
198 class BTD : public USBDeviceConfig, public UsbConfigXtracter {
+
199 public:
+
204  BTD(USB *p);
+
205 
+
214  uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed);
+
222  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
+
227  uint8_t Release();
+
232  uint8_t Poll();
+
233 
+
238  virtual uint8_t GetAddress() {
+
239  return bAddress;
+
240  };
+
241 
+
246  virtual bool isReady() {
+
247  return bPollEnable;
+
248  };
+
249 
+
255  virtual bool DEVCLASSOK(uint8_t klass) {
+
256  return (klass == USB_CLASS_WIRELESS_CTRL);
+
257  };
+
258 
+
266  virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
+
267  if(vid == IOGEAR_GBU521_VID && pid == IOGEAR_GBU521_PID)
+
268  return true;
+
269  if(my_bdaddr[0] != 0x00 || my_bdaddr[1] != 0x00 || my_bdaddr[2] != 0x00 || my_bdaddr[3] != 0x00 || my_bdaddr[4] != 0x00 || my_bdaddr[5] != 0x00) { // Check if Bluetooth address is set
+
270  if(vid == PS3_VID && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID))
+
271  return true;
+
272  }
+
273  return false;
+
274  };
+
286  void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
+
290  void disconnect();
+
291 
+
297  int8_t registerBluetoothService(BluetoothService *pService) {
+
298  for(uint8_t i = 0; i < BTD_NUM_SERVICES; i++) {
+
299  if(!btService[i]) {
+
300  btService[i] = pService;
+
301  return i; // Return ID
+
302  }
+
303  }
+
304  return -1; // Error registering BluetoothService
+
305  };
+
306 
+
313  void HCI_Command(uint8_t* data, uint16_t nbytes);
+
315  void hci_reset();
+
317  void hci_read_bdaddr();
+
319  void hci_read_local_version_information();
+
324  void hci_set_local_name(const char* name);
+
326  void hci_write_scan_enable();
+
328  void hci_write_scan_disable();
+
330  void hci_remote_name();
+
332  void hci_accept_connection();
+
337  void hci_disconnect(uint16_t handle);
+
343  void hci_pin_code_request_reply();
+
345  void hci_pin_code_negative_request_reply();
+
350  void hci_link_key_request_negative_reply();
+
352  void hci_authentication_request();
+
354  void hci_inquiry();
+
356  void hci_inquiry_cancel();
+
358  void hci_connect();
+
363  void hci_connect(uint8_t *bdaddr);
+
365  void hci_write_class_of_device();
+
377  void L2CAP_Command(uint16_t handle, uint8_t* data, uint8_t nbytes, uint8_t channelLow = 0x01, uint8_t channelHigh = 0x00);
+
385  void l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t* scid, uint16_t psm);
+
394  void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid, uint8_t result);
+
401  void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t* dcid);
+
408  void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t* scid);
+
416  void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);
+
424  void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);
+
431  void l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh);
+
435  bool watingForConnection;
+
437  bool l2capConnectionClaimed;
+
439  bool sdpConnectionClaimed;
+
441  bool rfcommConnectionClaimed;
+
442 
+
444  const char* btdName;
+
446  const char* btdPin;
+
447 
+
449  uint8_t my_bdaddr[6];
+
451  uint16_t hci_handle;
+
453  uint8_t disc_bdaddr[6];
+
455  char remote_name[30];
+
461  uint8_t hci_version;
+
462 
+
464  void pairWithWiimote() {
+
465  pairWithWii = true;
+
466  hci_state = HCI_CHECK_DEVICE_SERVICE;
+
467  };
+
469  bool connectToWii;
+
471  bool incomingWii;
+
473  bool pairWithWii;
+
475  bool motionPlusInside;
+
477  bool wiiUProController;
478 
-
480  const char* btdName;
-
482  const char* btdPin;
-
483 
-
485  uint8_t my_bdaddr[6];
-
487  uint16_t hci_handle;
-
489  uint8_t disc_bdaddr[6];
-
491  char remote_name[30];
-
497  uint8_t hci_version;
+
480  void pairWithHID() {
+
481  pairWithHIDDevice = true;
+
482  hci_state = HCI_CHECK_DEVICE_SERVICE;
+
483  };
+
485  bool connectToHIDDevice;
+
487  bool incomingHIDDevice;
+
489  bool pairWithHIDDevice;
+
490 
+
495  uint8_t readPollInterval() {
+
496  return pollInterval;
+
497  };
498 
-
500  void pairWithWiimote() {
-
501  pairWithWii = true;
-
502  hci_state = HCI_CHECK_DEVICE_SERVICE;
-
503  };
-
505  bool connectToWii;
-
507  bool incomingWii;
-
509  bool pairWithWii;
-
511  bool motionPlusInside;
-
513  bool wiiUProController;
-
514 
-
516  void pairWithHID() {
-
517  pairWithHIDDevice = true;
-
518  hci_state = HCI_CHECK_DEVICE_SERVICE;
-
519  };
-
521  bool connectToHIDDevice;
-
523  bool incomingHIDDevice;
-
525  bool pairWithHIDDevice;
-
526 
-
531  uint8_t readPollInterval() {
-
532  return pollInterval;
-
533  };
+
499 protected:
+
501  USB *pUsb;
+
503  uint8_t bAddress;
+
505  EpInfo epInfo[BTD_MAX_ENDPOINTS];
+
506 
+
508  uint8_t bConfNum;
+
510  uint8_t bNumEP;
+
512  uint32_t qNextPollTime;
+
513 
+
515  static const uint8_t BTD_CONTROL_PIPE;
+
517  static const uint8_t BTD_EVENT_PIPE;
+
519  static const uint8_t BTD_DATAIN_PIPE;
+
521  static const uint8_t BTD_DATAOUT_PIPE;
+
522 
+
527  void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr);
+
528 
+
529 private:
+
530  void Initialize(); // Set all variables, endpoint structs etc. to default values
+
531  BluetoothService *btService[BTD_NUM_SERVICES];
+
532 
+
533  uint16_t PID, VID; // PID and VID of device connected
534 
-
535 protected:
-
537  USB *pUsb;
-
539  uint8_t bAddress;
-
541  EpInfo epInfo[BTD_MAX_ENDPOINTS];
-
542 
-
544  uint8_t bConfNum;
-
546  uint8_t bNumEP;
-
548  uint32_t qNextPollTime;
-
549 
-
551  static const uint8_t BTD_CONTROL_PIPE;
-
553  static const uint8_t BTD_EVENT_PIPE;
-
555  static const uint8_t BTD_DATAIN_PIPE;
-
557  static const uint8_t BTD_DATAOUT_PIPE;
-
558 
-
563  void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr);
-
564 
-
565 private:
-
566  void Initialize(); // Set all variables, endpoint structs etc. to default values
-
567  BluetoothService *btService[BTD_NUM_SERVICES];
-
568 
-
569  uint16_t PID, VID; // PID and VID of device connected
-
570 
-
571  uint8_t pollInterval;
-
572  bool bPollEnable;
-
573 
-
574  bool incomingPS4; // True if a PS4 controller is connecting
-
575  uint8_t classOfDevice[3]; // Class of device of last device
-
576 
-
577  /* Variables used by high level HCI task */
-
578  uint8_t hci_state; // Current state of Bluetooth HCI connection
-
579  uint16_t hci_counter; // Counter used for Bluetooth HCI reset loops
-
580  uint16_t hci_num_reset_loops; // This value indicate how many times it should read before trying to reset
-
581  uint16_t hci_event_flag; // HCI flags of received Bluetooth events
-
582  uint8_t inquiry_counter;
-
583 
-
584  uint8_t hcibuf[BULK_MAXPKTSIZE]; // General purpose buffer for HCI data
-
585  uint8_t l2capinbuf[BULK_MAXPKTSIZE]; // General purpose buffer for L2CAP in data
-
586  uint8_t l2capoutbuf[14]; // General purpose buffer for L2CAP out data
-
587 
-
588  /* State machines */
-
589  void HCI_event_task(); // Poll the HCI event pipe
-
590  void HCI_task(); // HCI state machine
-
591  void ACL_event_task(); // ACL input pipe
-
592 
-
593  /* Used to set the Bluetooth Address internally to the PS3 Controllers */
-
594  void setBdaddr(uint8_t* BDADDR);
-
595  void setMoveBdaddr(uint8_t* BDADDR);
-
596 };
-
597 #endif
-
static const uint8_t BTD_DATAOUT_PIPE
Definition: BTD.h:557
-
bool incomingWii
Definition: BTD.h:507
-
void hci_connect()
Definition: BTD.cpp:1042
-
uint8_t bNumEP
Definition: BTD.h:546
-
const char * btdName
Definition: BTD.h:480
-
void hci_reset()
Definition: BTD.cpp:924
-
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1231
-
void l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)
Definition: BTD.cpp:1218
-
bool sdpConnectionClaimed
Definition: BTD.h:475
-
Definition: BTD.h:230
-
virtual boolean DEVCLASSOK(uint8_t klass)
Definition: BTD.h:287
-
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1284
-
bool rfcommConnectionClaimed
Definition: BTD.h:477
-
uint8_t hci_version
Definition: BTD.h:497
-
void hci_inquiry()
Definition: BTD.cpp:1020
-
static const uint8_t BTD_EVENT_PIPE
Definition: BTD.h:553
-
#define PS3MOVE_PID
Definition: BTD.h:27
+
535  uint8_t pollInterval;
+
536  bool bPollEnable;
+
537 
+
538  bool incomingPS4; // True if a PS4 controller is connecting
+
539  uint8_t classOfDevice[3]; // Class of device of last device
+
540 
+
541  /* Variables used by high level HCI task */
+
542  uint8_t hci_state; // Current state of Bluetooth HCI connection
+
543  uint16_t hci_counter; // Counter used for Bluetooth HCI reset loops
+
544  uint16_t hci_num_reset_loops; // This value indicate how many times it should read before trying to reset
+
545  uint16_t hci_event_flag; // HCI flags of received Bluetooth events
+
546  uint8_t inquiry_counter;
+
547 
+
548  uint8_t hcibuf[BULK_MAXPKTSIZE]; // General purpose buffer for HCI data
+
549  uint8_t l2capinbuf[BULK_MAXPKTSIZE]; // General purpose buffer for L2CAP in data
+
550  uint8_t l2capoutbuf[14]; // General purpose buffer for L2CAP out data
+
551 
+
552  /* State machines */
+
553  void HCI_event_task(); // Poll the HCI event pipe
+
554  void HCI_task(); // HCI state machine
+
555  void ACL_event_task(); // ACL input pipe
+
556 
+
557  /* Used to set the Bluetooth Address internally to the PS3 Controllers */
+
558  void setBdaddr(uint8_t* BDADDR);
+
559  void setMoveBdaddr(uint8_t* BDADDR);
+
560 };
+
561 
+
563 class BluetoothService {
+
564 public:
+
565  BluetoothService(BTD *p) : pBtd(p) {
+
566  if(pBtd)
+
567  pBtd->registerBluetoothService(this); // Register it as a Bluetooth service
+
568  };
+
573  virtual void ACLData(uint8_t* ACLData) = 0;
+
575  virtual void Run() = 0;
+
577  virtual void Reset() = 0;
+
579  virtual void disconnect() = 0;
+
580 
+
585  void attachOnInit(void (*funcOnInit)(void)) {
+
586  pFuncOnInit = funcOnInit; // TODO: This really belong in a class of it's own as it is repeated several times
+
587  };
+
588 
+
589 protected:
+
595  virtual void onInit() = 0;
+
596 
+
598  bool checkHciHandle(uint8_t *buf, uint16_t handle) {
+
599  return (buf[0] == (handle & 0xFF)) && (buf[1] == ((handle >> 8) | 0x20));
+
600  }
+
601 
+
603  void (*pFuncOnInit)(void);
+
604 
+
606  BTD *pBtd;
+
607 
+
609  uint16_t hci_handle;
+
610 
+
612  uint32_t l2cap_event_flag;
+
613 
+
615  uint8_t identifier;
+
616 };
+
617 
+
618 #endif
+
static const uint8_t BTD_DATAOUT_PIPE
Definition: BTD.h:521
+
bool incomingWii
Definition: BTD.h:471
+
void hci_connect()
Definition: BTD.cpp:1050
+
uint8_t bNumEP
Definition: BTD.h:510
+
const char * btdName
Definition: BTD.h:444
+
void hci_reset()
Definition: BTD.cpp:932
+
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1239
+
void l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)
Definition: BTD.cpp:1226
+
bool sdpConnectionClaimed
Definition: BTD.h:439
+
Definition: BTD.h:198
+
int8_t registerBluetoothService(BluetoothService *pService)
Definition: BTD.h:297
+
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1292
+
bool rfcommConnectionClaimed
Definition: BTD.h:441
+
uint8_t hci_version
Definition: BTD.h:461
+
+
void hci_inquiry()
Definition: BTD.cpp:1028
+
static const uint8_t BTD_EVENT_PIPE
Definition: BTD.h:517
+
#define PS3MOVE_PID
Definition: BTD.h:28
Definition: usb_ch9.h:141
-
bool pairWithWii
Definition: BTD.h:509
-
void hci_write_scan_disable()
Definition: BTD.cpp:946
-
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: BTD.cpp:314
-
virtual uint8_t GetAddress()
Definition: BTD.h:270
-
#define BTD_NUM_SERVICES
Definition: BTD.h:190
-
const char * btdPin
Definition: BTD.h:482
-
bool motionPlusInside
Definition: BTD.h:511
-
void hci_remote_name()
Definition: BTD.cpp:989
-
Definition: UsbCore.h:119
+
bool pairWithWii
Definition: BTD.h:473
+
uint8_t identifier
Definition: BTD.h:615
+
void hci_write_scan_disable()
Definition: BTD.cpp:954
+
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: BTD.cpp:314
+
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: BTD.h:266
+
virtual uint8_t GetAddress()
Definition: BTD.h:238
+
#define BTD_NUM_SERVICES
Definition: BTD.h:188
+
const char * btdPin
Definition: BTD.h:446
+
bool motionPlusInside
Definition: BTD.h:475
+
void hci_remote_name()
Definition: BTD.cpp:997
+
Definition: UsbCore.h:121
-
#define PS3_VID
Definition: BTD.h:24
+
#define PS3_VID
Definition: BTD.h:25
BTD(USB *p)
Definition: BTD.cpp:27
-
char remote_name[30]
Definition: BTD.h:491
-
uint8_t readPollInterval()
Definition: BTD.h:531
-
virtual void Reset()
-
static const uint8_t BTD_DATAIN_PIPE
Definition: BTD.h:555
-
void hci_set_local_name(const char *name)
Definition: BTD.cpp:1008
-
void hci_write_scan_enable()
Definition: BTD.cpp:933
-
virtual uint8_t Release()
Definition: BTD.cpp:365
-
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1297
-
#define USB_CLASS_WIRELESS_CTRL
Definition: UsbCore.h:69
-
bool watingForConnection
Definition: BTD.h:471
-
bool connectToHIDDevice
Definition: BTD.h:519
-
uint8_t bAddress
Definition: BTD.h:539
-
bool incomingHIDDevice
Definition: BTD.h:523
-
bool pairWithHIDDevice
Definition: BTD.h:525
-
uint32_t qNextPollTime
Definition: BTD.h:548
+
char remote_name[30]
Definition: BTD.h:455
+
uint8_t readPollInterval()
Definition: BTD.h:495
+
virtual void Reset()=0
+
static const uint8_t BTD_DATAIN_PIPE
Definition: BTD.h:519
+
void hci_set_local_name(const char *name)
Definition: BTD.cpp:1016
+
void hci_write_scan_enable()
Definition: BTD.cpp:941
+
uint8_t Release()
Definition: BTD.cpp:365
+
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1305
+
#define USB_CLASS_WIRELESS_CTRL
Definition: UsbCore.h:71
+
bool watingForConnection
Definition: BTD.h:435
+
bool connectToHIDDevice
Definition: BTD.h:483
+
uint8_t bAddress
Definition: BTD.h:503
+
bool incomingHIDDevice
Definition: BTD.h:487
+
bool pairWithHIDDevice
Definition: BTD.h:489
+
uint32_t qNextPollTime
Definition: BTD.h:512
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
Definition: BTD.cpp:346
-
#define IOGEAR_GBU521_PID
Definition: BTD.h:30
-
bool connectToWii
Definition: BTD.h:503
-
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: BTD.cpp:48
-
bool wiiUProController
Definition: BTD.h:513
-
uint16_t hci_handle
Definition: BTD.h:487
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: BTD.cpp:122
+
#define IOGEAR_GBU521_PID
Definition: BTD.h:31
+
bool connectToWii
Definition: BTD.h:467
+
uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: BTD.cpp:48
+
virtual void disconnect()=0
+
bool wiiUProController
Definition: BTD.h:477
+
uint16_t hci_handle
Definition: BTD.h:451
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: BTD.cpp:122
Definition: address.h:32
-
void pairWithHID()
Definition: BTD.h:516
-
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1142
-
Definition: BTD.h:211
-
void hci_read_bdaddr()
Definition: BTD.cpp:955
-
void hci_inquiry_cancel()
Definition: BTD.cpp:1034
-
uint8_t my_bdaddr[6]
Definition: BTD.h:485
-
virtual uint8_t Poll()
Definition: BTD.cpp:371
-
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: BTD.h:298
-
static const uint8_t BTD_CONTROL_PIPE
Definition: BTD.h:551
+
void pairWithHID()
Definition: BTD.h:480
+
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1150
+
Definition: BTD.h:563
+
void hci_read_bdaddr()
Definition: BTD.cpp:963
+
void hci_inquiry_cancel()
Definition: BTD.cpp:1042
+
virtual void Run()=0
+
uint8_t my_bdaddr[6]
Definition: BTD.h:449
+
void(* pFuncOnInit)(void)
Definition: BTD.h:603
+
void attachOnInit(void(*funcOnInit)(void))
Definition: BTD.h:585
+
uint8_t Poll()
Definition: BTD.cpp:371
+
static const uint8_t BTD_CONTROL_PIPE
Definition: BTD.h:515
-
#define BULK_MAXPKTSIZE
Definition: BTD.h:33
-
void disconnect()
Definition: BTD.h:322
-
uint8_t disc_bdaddr[6]
Definition: BTD.h:489
-
int8_t registerServiceClass(BluetoothService *pService)
Definition: BTD.h:333
-
bool l2capConnectionClaimed
Definition: BTD.h:473
-
EpInfo epInfo[BTD_MAX_ENDPOINTS]
Definition: BTD.h:541
-
#define IOGEAR_GBU521_VID
Definition: BTD.h:29
-
virtual void ACLData(uint8_t *ACLData)
-
#define PS3_PID
Definition: BTD.h:25
-
#define BTD_MAX_ENDPOINTS
Definition: BTD.h:189
-
#define PS3NAVIGATION_PID
Definition: BTD.h:26
-
void l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh)
Definition: BTD.cpp:1310
-
void hci_write_class_of_device()
Definition: BTD.cpp:1154
-
void hci_pin_code_negative_request_reply()
Definition: BTD.cpp:1104
-
#define HCI_CHECK_DEVICE_SERVICE
Definition: BTD.h:48
-
Definition: UsbCore.h:190
-
virtual void Run()
-
uint8_t bConfNum
Definition: BTD.h:544
-
void hci_link_key_request_negative_reply()
Definition: BTD.cpp:1118
-
void pairWithWiimote()
Definition: BTD.h:500
-
virtual bool isReady()
Definition: BTD.h:278
-
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1190
-
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1265
-
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1248
-
void hci_pin_code_request_reply()
Definition: BTD.cpp:1068
-
virtual void disconnect()
-
USB * pUsb
Definition: BTD.h:533
-
void hci_authentication_request()
Definition: BTD.cpp:1132
-
void hci_read_local_version_information()
Definition: BTD.cpp:964
-
void hci_accept_connection()
Definition: BTD.cpp:973
-
void HCI_Command(uint8_t *data, uint16_t nbytes)
Definition: BTD.cpp:919
+
BTD * pBtd
Definition: BTD.h:606
+
#define BULK_MAXPKTSIZE
Definition: BTD.h:34
+
void disconnect()
Definition: BTD.cpp:383
+
uint8_t disc_bdaddr[6]
Definition: BTD.h:453
+
bool l2capConnectionClaimed
Definition: BTD.h:437
+
EpInfo epInfo[BTD_MAX_ENDPOINTS]
Definition: BTD.h:505
+
#define IOGEAR_GBU521_VID
Definition: BTD.h:30
+
#define PS3_PID
Definition: BTD.h:26
+
#define BTD_MAX_ENDPOINTS
Definition: BTD.h:187
+
#define PS3NAVIGATION_PID
Definition: BTD.h:27
+
void l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh)
Definition: BTD.cpp:1318
+
BluetoothService(BTD *p)
Definition: BTD.h:565
+
void hci_write_class_of_device()
Definition: BTD.cpp:1162
+
uint16_t hci_handle
Definition: BTD.h:609
+
void hci_pin_code_negative_request_reply()
Definition: BTD.cpp:1112
+
virtual void ACLData(uint8_t *ACLData)=0
+
virtual bool DEVCLASSOK(uint8_t klass)
Definition: BTD.h:255
+
uint32_t l2cap_event_flag
Definition: BTD.h:612
+
#define HCI_CHECK_DEVICE_SERVICE
Definition: BTD.h:46
+
Definition: UsbCore.h:197
+
uint8_t bConfNum
Definition: BTD.h:508
+
void hci_link_key_request_negative_reply()
Definition: BTD.cpp:1126
+
void pairWithWiimote()
Definition: BTD.h:464
+
virtual bool isReady()
Definition: BTD.h:246
+
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1198
+
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1273
+
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1256
+
void hci_pin_code_request_reply()
Definition: BTD.cpp:1076
+
USB * pUsb
Definition: BTD.h:497
+
void hci_authentication_request()
Definition: BTD.cpp:1140
+
void hci_read_local_version_information()
Definition: BTD.cpp:972
+
void hci_accept_connection()
Definition: BTD.cpp:981
+
bool checkHciHandle(uint8_t *buf, uint16_t handle)
Definition: BTD.h:598
+
virtual void onInit()=0
+
void HCI_Command(uint8_t *data, uint16_t nbytes)
Definition: BTD.cpp:927
diff --git a/_b_t_h_i_d_8cpp.html b/_b_t_h_i_d_8cpp.html index 8fda4993..5271f63b 100644 --- a/_b_t_h_i_d_8cpp.html +++ b/_b_t_h_i_d_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: BTHID.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -95,7 +96,7 @@ Include dependency graph for BTHID.cpp:
- +

Go to the source code of this file.

@@ -104,7 +105,7 @@ Include dependency graph for BTHID.cpp: diff --git a/_b_t_h_i_d_8cpp__incl.map b/_b_t_h_i_d_8cpp__incl.map index 28742df1..8347d384 100644 --- a/_b_t_h_i_d_8cpp__incl.map +++ b/_b_t_h_i_d_8cpp__incl.map @@ -1,8 +1,8 @@ - - - + + + - - + + diff --git a/_b_t_h_i_d_8cpp__incl.md5 b/_b_t_h_i_d_8cpp__incl.md5 index ec5d712c..f16726cf 100644 --- a/_b_t_h_i_d_8cpp__incl.md5 +++ b/_b_t_h_i_d_8cpp__incl.md5 @@ -1 +1 @@ -3325b0ff5c79ca7ff5822cbf27f33902 \ No newline at end of file +5019ad894e519a7da9fb09997945ae68 \ No newline at end of file diff --git a/_b_t_h_i_d_8cpp__incl.png b/_b_t_h_i_d_8cpp__incl.png index 40db5220..4878fabe 100644 Binary files a/_b_t_h_i_d_8cpp__incl.png and b/_b_t_h_i_d_8cpp__incl.png differ diff --git a/_b_t_h_i_d_8cpp_source.html b/_b_t_h_i_d_8cpp_source.html index 35339da8..efbdf91c 100644 --- a/_b_t_h_i_d_8cpp_source.html +++ b/_b_t_h_i_d_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: BTHID.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -112,461 +113,462 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
21 //#define PRINTREPORT // Uncomment to print the report send by the HID device
22 
23 BTHID::BTHID(BTD *p, bool pair, const char *pin) :
-
24 pBtd(p), // pointer to USB class instance - mandatory
+
24 BluetoothService(p), // Pointer to USB class instance - mandatory
25 protocolMode(HID_BOOT_PROTOCOL) {
26  for(uint8_t i = 0; i < NUM_PARSERS; i++)
27  pRptParser[i] = NULL;
28 
-
29  if(pBtd)
-
30  pBtd->registerServiceClass(this); // Register it as a Bluetooth service
+
29  pBtd->pairWithHIDDevice = pair;
+
30  pBtd->btdPin = pin;
31 
-
32  pBtd->pairWithHIDDevice = pair;
-
33  pBtd->btdPin = pin;
-
34 
-
35  /* Set device cid for the control and intterrupt channelse - LSB */
-
36  control_dcid[0] = 0x70; // 0x0070
-
37  control_dcid[1] = 0x00;
-
38  interrupt_dcid[0] = 0x71; // 0x0071
-
39  interrupt_dcid[1] = 0x00;
+
32  /* Set device cid for the control and intterrupt channelse - LSB */
+
33  control_dcid[0] = 0x70; // 0x0070
+
34  control_dcid[1] = 0x00;
+
35  interrupt_dcid[0] = 0x71; // 0x0071
+
36  interrupt_dcid[1] = 0x00;
+
37 
+
38  Reset();
+
39 }
40 
-
41  Reset();
-
42 }
-
43 
-
44 void BTHID::Reset() {
-
45  connected = false;
-
46  activeConnection = false;
-
47  l2cap_event_flag = 0; // Reset flags
-
48  l2cap_state = L2CAP_WAIT;
-
49  ResetBTHID();
-
50 }
-
51 
-
52 void BTHID::disconnect() { // Use this void to disconnect the device
-
53  // First the HID interrupt channel has to be disconnected, then the HID control channel and finally the HCI connection
-
54  pBtd->l2cap_disconnection_request(hci_handle, ++identifier, interrupt_scid, interrupt_dcid);
-
55  Reset();
-
56  l2cap_state = L2CAP_INTERRUPT_DISCONNECT;
-
57 }
-
58 
-
59 void BTHID::ACLData(uint8_t* l2capinbuf) {
-
60  if(!pBtd->l2capConnectionClaimed && pBtd->incomingHIDDevice && !connected && !activeConnection) {
-
61  if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
-
62  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_CTRL_PSM) {
-
63  pBtd->incomingHIDDevice = false;
-
64  pBtd->l2capConnectionClaimed = true; // Claim that the incoming connection belongs to this service
-
65  activeConnection = true;
-
66  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
-
67  l2cap_state = L2CAP_WAIT;
-
68  }
-
69  }
-
70  }
-
71  //if((l2capinbuf[0] | (uint16_t)l2capinbuf[1] << 8) == (hci_handle | 0x2000U)) { // acl_handle_ok or it's a new connection
-
72  if(UHS_ACL_HANDLE_OK(l2capinbuf, hci_handle)) { // acl_handle_ok or it's a new connection
-
73  if((l2capinbuf[6] | (l2capinbuf[7] << 8)) == 0x0001U) { // l2cap_control - Channel ID for ACL-U
-
74  if(l2capinbuf[8] == L2CAP_CMD_COMMAND_REJECT) {
-
75 #ifdef DEBUG_USB_HOST
-
76  Notify(PSTR("\r\nL2CAP Command Rejected - Reason: "), 0x80);
-
77  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
-
78  Notify(PSTR(" "), 0x80);
-
79  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
-
80  Notify(PSTR(" "), 0x80);
-
81  D_PrintHex<uint8_t > (l2capinbuf[17], 0x80);
-
82  Notify(PSTR(" "), 0x80);
-
83  D_PrintHex<uint8_t > (l2capinbuf[16], 0x80);
-
84  Notify(PSTR(" "), 0x80);
-
85  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
-
86  Notify(PSTR(" "), 0x80);
-
87  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
-
88 #endif
-
89  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_RESPONSE) {
-
90  if(((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) && ((l2capinbuf[18] | (l2capinbuf[19] << 8)) == SUCCESSFUL)) { // Success
-
91  if(l2capinbuf[14] == control_dcid[0] && l2capinbuf[15] == control_dcid[1]) {
-
92  //Notify(PSTR("\r\nHID Control Connection Complete"), 0x80);
-
93  identifier = l2capinbuf[9];
-
94  control_scid[0] = l2capinbuf[12];
-
95  control_scid[1] = l2capinbuf[13];
-
96  l2cap_set_flag(L2CAP_FLAG_CONTROL_CONNECTED);
-
97  } else if(l2capinbuf[14] == interrupt_dcid[0] && l2capinbuf[15] == interrupt_dcid[1]) {
-
98  //Notify(PSTR("\r\nHID Interrupt Connection Complete"), 0x80);
-
99  identifier = l2capinbuf[9];
-
100  interrupt_scid[0] = l2capinbuf[12];
-
101  interrupt_scid[1] = l2capinbuf[13];
-
102  l2cap_set_flag(L2CAP_FLAG_INTERRUPT_CONNECTED);
-
103  }
-
104  }
-
105  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
-
106 #ifdef EXTRADEBUG
-
107  Notify(PSTR("\r\nL2CAP Connection Request - PSM: "), 0x80);
-
108  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
-
109  Notify(PSTR(" "), 0x80);
-
110  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
-
111  Notify(PSTR(" SCID: "), 0x80);
-
112  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
-
113  Notify(PSTR(" "), 0x80);
-
114  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
-
115  Notify(PSTR(" Identifier: "), 0x80);
-
116  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
-
117 #endif
-
118  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_CTRL_PSM) {
-
119  identifier = l2capinbuf[9];
-
120  control_scid[0] = l2capinbuf[14];
-
121  control_scid[1] = l2capinbuf[15];
-
122  l2cap_set_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST);
-
123  } else if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_INTR_PSM) {
-
124  identifier = l2capinbuf[9];
-
125  interrupt_scid[0] = l2capinbuf[14];
-
126  interrupt_scid[1] = l2capinbuf[15];
-
127  l2cap_set_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST);
-
128  }
-
129  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_RESPONSE) {
-
130  if((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) { // Success
-
131  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
-
132  //Notify(PSTR("\r\nHID Control Configuration Complete"), 0x80);
-
133  identifier = l2capinbuf[9];
-
134  l2cap_set_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS);
-
135  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
-
136  //Notify(PSTR("\r\nHID Interrupt Configuration Complete"), 0x80);
-
137  identifier = l2capinbuf[9];
-
138  l2cap_set_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS);
-
139  }
-
140  }
-
141  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_REQUEST) {
-
142  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
-
143  //Notify(PSTR("\r\nHID Control Configuration Request"), 0x80);
-
144  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], control_scid);
-
145  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
-
146  //Notify(PSTR("\r\nHID Interrupt Configuration Request"), 0x80);
-
147  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], interrupt_scid);
-
148  }
-
149  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_REQUEST) {
-
150  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
-
151 #ifdef DEBUG_USB_HOST
-
152  Notify(PSTR("\r\nDisconnect Request: Control Channel"), 0x80);
-
153 #endif
-
154  identifier = l2capinbuf[9];
-
155  pBtd->l2cap_disconnection_response(hci_handle, identifier, control_dcid, control_scid);
-
156  Reset();
-
157  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
-
158 #ifdef DEBUG_USB_HOST
-
159  Notify(PSTR("\r\nDisconnect Request: Interrupt Channel"), 0x80);
-
160 #endif
-
161  identifier = l2capinbuf[9];
-
162  pBtd->l2cap_disconnection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid);
-
163  Reset();
-
164  }
-
165  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_RESPONSE) {
-
166  if(l2capinbuf[12] == control_scid[0] && l2capinbuf[13] == control_scid[1]) {
-
167  //Notify(PSTR("\r\nDisconnect Response: Control Channel"), 0x80);
-
168  identifier = l2capinbuf[9];
-
169  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE);
-
170  } else if(l2capinbuf[12] == interrupt_scid[0] && l2capinbuf[13] == interrupt_scid[1]) {
-
171  //Notify(PSTR("\r\nDisconnect Response: Interrupt Channel"), 0x80);
-
172  identifier = l2capinbuf[9];
-
173  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE);
-
174  }
-
175  }
-
176 #ifdef EXTRADEBUG
-
177  else {
-
178  identifier = l2capinbuf[9];
-
179  Notify(PSTR("\r\nL2CAP Unknown Signaling Command: "), 0x80);
-
180  D_PrintHex<uint8_t > (l2capinbuf[8], 0x80);
-
181  }
-
182 #endif
-
183  } else if(l2capinbuf[6] == interrupt_dcid[0] && l2capinbuf[7] == interrupt_dcid[1]) { // l2cap_interrupt
-
184 #ifdef PRINTREPORT
-
185  Notify(PSTR("\r\nL2CAP Interrupt: "), 0x80);
-
186  for(uint16_t i = 0; i < ((uint16_t)l2capinbuf[5] << 8 | l2capinbuf[4]); i++) {
-
187  D_PrintHex<uint8_t > (l2capinbuf[i + 8], 0x80);
-
188  Notify(PSTR(" "), 0x80);
-
189  }
-
190 #endif
-
191  if(l2capinbuf[8] == 0xA1) { // HID_THDR_DATA_INPUT
-
192  uint16_t length = ((uint16_t)l2capinbuf[5] << 8 | l2capinbuf[4]);
-
193  ParseBTHIDData((uint8_t)(length - 1), &l2capinbuf[9]);
-
194 
-
195  switch(l2capinbuf[9]) {
-
196  case 0x01: // Keyboard or Joystick events
-
197  if(pRptParser[KEYBOARD_PARSER_ID])
-
198  pRptParser[KEYBOARD_PARSER_ID]->Parse(reinterpret_cast<HID *>(this), 0, (uint8_t)(length - 2), &l2capinbuf[10]); // Use reinterpret_cast again to extract the instance
-
199  break;
-
200 
-
201  case 0x02: // Mouse events
-
202  if(pRptParser[MOUSE_PARSER_ID])
-
203  pRptParser[MOUSE_PARSER_ID]->Parse(reinterpret_cast<HID *>(this), 0, (uint8_t)(length - 2), &l2capinbuf[10]); // Use reinterpret_cast again to extract the instance
-
204  break;
-
205 #ifdef EXTRADEBUG
-
206  default:
-
207  Notify(PSTR("\r\nUnknown Report type: "), 0x80);
-
208  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
-
209  break;
-
210 #endif
-
211  }
-
212  }
-
213  } else if(l2capinbuf[6] == control_dcid[0] && l2capinbuf[7] == control_dcid[1]) { // l2cap_control
-
214 #ifdef PRINTREPORT
-
215  Notify(PSTR("\r\nL2CAP Control: "), 0x80);
-
216  for(uint16_t i = 0; i < ((uint16_t)l2capinbuf[5] << 8 | l2capinbuf[4]); i++) {
-
217  D_PrintHex<uint8_t > (l2capinbuf[i + 8], 0x80);
-
218  Notify(PSTR(" "), 0x80);
-
219  }
-
220 #endif
-
221  }
-
222 #ifdef EXTRADEBUG
-
223  else {
-
224  Notify(PSTR("\r\nUnsupported L2CAP Data - Channel ID: "), 0x80);
-
225  D_PrintHex<uint8_t > (l2capinbuf[7], 0x80);
-
226  Notify(PSTR(" "), 0x80);
-
227  D_PrintHex<uint8_t > (l2capinbuf[6], 0x80);
-
228 
-
229  Notify(PSTR("\r\nData: "), 0x80);
-
230  Notify(PSTR("\r\n"), 0x80);
-
231  for(uint16_t i = 0; i < ((uint16_t)l2capinbuf[5] << 8 | l2capinbuf[4]); i++) {
-
232  D_PrintHex<uint8_t > (l2capinbuf[i + 8], 0x80);
-
233  Notify(PSTR(" "), 0x80);
-
234  }
-
235  }
-
236 #endif
-
237  L2CAP_task();
-
238  }
-
239 }
-
240 
-
241 void BTHID::L2CAP_task() {
-
242  switch(l2cap_state) {
-
243  /* These states are used if the HID device is the host */
-
244  case L2CAP_CONTROL_SUCCESS:
-
245  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)) {
-
246 #ifdef DEBUG_USB_HOST
-
247  Notify(PSTR("\r\nHID Control Successfully Configured"), 0x80);
-
248 #endif
-
249  setProtocol(); // Set protocol before establishing HID interrupt channel
-
250  l2cap_state = L2CAP_INTERRUPT_SETUP;
-
251  }
-
252  break;
-
253 
-
254  case L2CAP_INTERRUPT_SETUP:
-
255  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)) {
-
256 #ifdef DEBUG_USB_HOST
-
257  Notify(PSTR("\r\nHID Interrupt Incoming Connection Request"), 0x80);
-
258 #endif
-
259  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, PENDING);
+
41 void BTHID::Reset() {
+
42  connected = false;
+
43  activeConnection = false;
+
44  l2cap_event_flag = 0; // Reset flags
+
45  l2cap_state = L2CAP_WAIT;
+
46  ResetBTHID();
+
47 }
+
48 
+
49 void BTHID::disconnect() { // Use this void to disconnect the device
+
50  // First the HID interrupt channel has to be disconnected, then the HID control channel and finally the HCI connection
+
51  pBtd->l2cap_disconnection_request(hci_handle, ++identifier, interrupt_scid, interrupt_dcid);
+
52  Reset();
+
53  l2cap_state = L2CAP_INTERRUPT_DISCONNECT;
+
54 }
+
55 
+
56 void BTHID::ACLData(uint8_t* l2capinbuf) {
+
57  if(!pBtd->l2capConnectionClaimed && pBtd->incomingHIDDevice && !connected && !activeConnection) {
+
58  if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
+
59  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_CTRL_PSM) {
+
60  pBtd->incomingHIDDevice = false;
+
61  pBtd->l2capConnectionClaimed = true; // Claim that the incoming connection belongs to this service
+
62  activeConnection = true;
+
63  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
+
64  l2cap_state = L2CAP_WAIT;
+
65  }
+
66  }
+
67  }
+
68 
+
69  if(checkHciHandle(l2capinbuf, hci_handle)) { // acl_handle_ok
+
70  if((l2capinbuf[6] | (l2capinbuf[7] << 8)) == 0x0001U) { // l2cap_control - Channel ID for ACL-U
+
71  if(l2capinbuf[8] == L2CAP_CMD_COMMAND_REJECT) {
+
72 #ifdef DEBUG_USB_HOST
+
73  Notify(PSTR("\r\nL2CAP Command Rejected - Reason: "), 0x80);
+
74  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
+
75  Notify(PSTR(" "), 0x80);
+
76  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
+
77  Notify(PSTR(" "), 0x80);
+
78  D_PrintHex<uint8_t > (l2capinbuf[17], 0x80);
+
79  Notify(PSTR(" "), 0x80);
+
80  D_PrintHex<uint8_t > (l2capinbuf[16], 0x80);
+
81  Notify(PSTR(" "), 0x80);
+
82  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
+
83  Notify(PSTR(" "), 0x80);
+
84  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
+
85 #endif
+
86  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_RESPONSE) {
+
87  if(((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) && ((l2capinbuf[18] | (l2capinbuf[19] << 8)) == SUCCESSFUL)) { // Success
+
88  if(l2capinbuf[14] == control_dcid[0] && l2capinbuf[15] == control_dcid[1]) {
+
89  //Notify(PSTR("\r\nHID Control Connection Complete"), 0x80);
+
90  identifier = l2capinbuf[9];
+
91  control_scid[0] = l2capinbuf[12];
+
92  control_scid[1] = l2capinbuf[13];
+
93  l2cap_set_flag(L2CAP_FLAG_CONTROL_CONNECTED);
+
94  } else if(l2capinbuf[14] == interrupt_dcid[0] && l2capinbuf[15] == interrupt_dcid[1]) {
+
95  //Notify(PSTR("\r\nHID Interrupt Connection Complete"), 0x80);
+
96  identifier = l2capinbuf[9];
+
97  interrupt_scid[0] = l2capinbuf[12];
+
98  interrupt_scid[1] = l2capinbuf[13];
+
99  l2cap_set_flag(L2CAP_FLAG_INTERRUPT_CONNECTED);
+
100  }
+
101  }
+
102  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
+
103 #ifdef EXTRADEBUG
+
104  Notify(PSTR("\r\nL2CAP Connection Request - PSM: "), 0x80);
+
105  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
+
106  Notify(PSTR(" "), 0x80);
+
107  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
+
108  Notify(PSTR(" SCID: "), 0x80);
+
109  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
+
110  Notify(PSTR(" "), 0x80);
+
111  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
+
112  Notify(PSTR(" Identifier: "), 0x80);
+
113  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
+
114 #endif
+
115  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_CTRL_PSM) {
+
116  identifier = l2capinbuf[9];
+
117  control_scid[0] = l2capinbuf[14];
+
118  control_scid[1] = l2capinbuf[15];
+
119  l2cap_set_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST);
+
120  } else if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_INTR_PSM) {
+
121  identifier = l2capinbuf[9];
+
122  interrupt_scid[0] = l2capinbuf[14];
+
123  interrupt_scid[1] = l2capinbuf[15];
+
124  l2cap_set_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST);
+
125  }
+
126  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_RESPONSE) {
+
127  if((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) { // Success
+
128  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
+
129  //Notify(PSTR("\r\nHID Control Configuration Complete"), 0x80);
+
130  identifier = l2capinbuf[9];
+
131  l2cap_set_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS);
+
132  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
+
133  //Notify(PSTR("\r\nHID Interrupt Configuration Complete"), 0x80);
+
134  identifier = l2capinbuf[9];
+
135  l2cap_set_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS);
+
136  }
+
137  }
+
138  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_REQUEST) {
+
139  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
+
140  //Notify(PSTR("\r\nHID Control Configuration Request"), 0x80);
+
141  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], control_scid);
+
142  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
+
143  //Notify(PSTR("\r\nHID Interrupt Configuration Request"), 0x80);
+
144  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], interrupt_scid);
+
145  }
+
146  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_REQUEST) {
+
147  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
+
148 #ifdef DEBUG_USB_HOST
+
149  Notify(PSTR("\r\nDisconnect Request: Control Channel"), 0x80);
+
150 #endif
+
151  identifier = l2capinbuf[9];
+
152  pBtd->l2cap_disconnection_response(hci_handle, identifier, control_dcid, control_scid);
+
153  Reset();
+
154  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
+
155 #ifdef DEBUG_USB_HOST
+
156  Notify(PSTR("\r\nDisconnect Request: Interrupt Channel"), 0x80);
+
157 #endif
+
158  identifier = l2capinbuf[9];
+
159  pBtd->l2cap_disconnection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid);
+
160  Reset();
+
161  }
+
162  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_RESPONSE) {
+
163  if(l2capinbuf[12] == control_scid[0] && l2capinbuf[13] == control_scid[1]) {
+
164  //Notify(PSTR("\r\nDisconnect Response: Control Channel"), 0x80);
+
165  identifier = l2capinbuf[9];
+
166  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE);
+
167  } else if(l2capinbuf[12] == interrupt_scid[0] && l2capinbuf[13] == interrupt_scid[1]) {
+
168  //Notify(PSTR("\r\nDisconnect Response: Interrupt Channel"), 0x80);
+
169  identifier = l2capinbuf[9];
+
170  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE);
+
171  }
+
172  }
+
173 #ifdef EXTRADEBUG
+
174  else {
+
175  identifier = l2capinbuf[9];
+
176  Notify(PSTR("\r\nL2CAP Unknown Signaling Command: "), 0x80);
+
177  D_PrintHex<uint8_t > (l2capinbuf[8], 0x80);
+
178  }
+
179 #endif
+
180  } else if(l2capinbuf[6] == interrupt_dcid[0] && l2capinbuf[7] == interrupt_dcid[1]) { // l2cap_interrupt
+
181 #ifdef PRINTREPORT
+
182  Notify(PSTR("\r\nL2CAP Interrupt: "), 0x80);
+
183  for(uint16_t i = 0; i < ((uint16_t)l2capinbuf[5] << 8 | l2capinbuf[4]); i++) {
+
184  D_PrintHex<uint8_t > (l2capinbuf[i + 8], 0x80);
+
185  Notify(PSTR(" "), 0x80);
+
186  }
+
187 #endif
+
188  if(l2capinbuf[8] == 0xA1) { // HID_THDR_DATA_INPUT
+
189  uint16_t length = ((uint16_t)l2capinbuf[5] << 8 | l2capinbuf[4]);
+
190  ParseBTHIDData((uint8_t)(length - 1), &l2capinbuf[9]);
+
191 
+
192  switch(l2capinbuf[9]) {
+
193  case 0x01: // Keyboard or Joystick events
+
194  if(pRptParser[KEYBOARD_PARSER_ID])
+
195  pRptParser[KEYBOARD_PARSER_ID]->Parse(reinterpret_cast<HID *>(this), 0, (uint8_t)(length - 2), &l2capinbuf[10]); // Use reinterpret_cast again to extract the instance
+
196  break;
+
197 
+
198  case 0x02: // Mouse events
+
199  if(pRptParser[MOUSE_PARSER_ID])
+
200  pRptParser[MOUSE_PARSER_ID]->Parse(reinterpret_cast<HID *>(this), 0, (uint8_t)(length - 2), &l2capinbuf[10]); // Use reinterpret_cast again to extract the instance
+
201  break;
+
202 #ifdef EXTRADEBUG
+
203  default:
+
204  Notify(PSTR("\r\nUnknown Report type: "), 0x80);
+
205  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
+
206  break;
+
207 #endif
+
208  }
+
209  }
+
210  } else if(l2capinbuf[6] == control_dcid[0] && l2capinbuf[7] == control_dcid[1]) { // l2cap_control
+
211 #ifdef PRINTREPORT
+
212  Notify(PSTR("\r\nL2CAP Control: "), 0x80);
+
213  for(uint16_t i = 0; i < ((uint16_t)l2capinbuf[5] << 8 | l2capinbuf[4]); i++) {
+
214  D_PrintHex<uint8_t > (l2capinbuf[i + 8], 0x80);
+
215  Notify(PSTR(" "), 0x80);
+
216  }
+
217 #endif
+
218  }
+
219 #ifdef EXTRADEBUG
+
220  else {
+
221  Notify(PSTR("\r\nUnsupported L2CAP Data - Channel ID: "), 0x80);
+
222  D_PrintHex<uint8_t > (l2capinbuf[7], 0x80);
+
223  Notify(PSTR(" "), 0x80);
+
224  D_PrintHex<uint8_t > (l2capinbuf[6], 0x80);
+
225 
+
226  Notify(PSTR("\r\nData: "), 0x80);
+
227  Notify(PSTR("\r\n"), 0x80);
+
228  for(uint16_t i = 0; i < ((uint16_t)l2capinbuf[5] << 8 | l2capinbuf[4]); i++) {
+
229  D_PrintHex<uint8_t > (l2capinbuf[i + 8], 0x80);
+
230  Notify(PSTR(" "), 0x80);
+
231  }
+
232  }
+
233 #endif
+
234  L2CAP_task();
+
235  }
+
236 }
+
237 
+
238 void BTHID::L2CAP_task() {
+
239  switch(l2cap_state) {
+
240  /* These states are used if the HID device is the host */
+
241  case L2CAP_CONTROL_SUCCESS:
+
242  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)) {
+
243 #ifdef DEBUG_USB_HOST
+
244  Notify(PSTR("\r\nHID Control Successfully Configured"), 0x80);
+
245 #endif
+
246  setProtocol(); // Set protocol before establishing HID interrupt channel
+
247  l2cap_state = L2CAP_INTERRUPT_SETUP;
+
248  }
+
249  break;
+
250 
+
251  case L2CAP_INTERRUPT_SETUP:
+
252  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)) {
+
253 #ifdef DEBUG_USB_HOST
+
254  Notify(PSTR("\r\nHID Interrupt Incoming Connection Request"), 0x80);
+
255 #endif
+
256  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, PENDING);
+
257  delay(1);
+
258  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, SUCCESSFUL);
+
259  identifier++;
260  delay(1);
-
261  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, SUCCESSFUL);
-
262  identifier++;
-
263  delay(1);
-
264  pBtd->l2cap_config_request(hci_handle, identifier, interrupt_scid);
-
265 
-
266  l2cap_state = L2CAP_INTERRUPT_CONFIG_REQUEST;
-
267  }
-
268  break;
-
269 
-
270  /* These states are used if the Arduino is the host */
-
271  case L2CAP_CONTROL_CONNECT_REQUEST:
-
272  if(l2cap_check_flag(L2CAP_FLAG_CONTROL_CONNECTED)) {
-
273 #ifdef DEBUG_USB_HOST
-
274  Notify(PSTR("\r\nSend HID Control Config Request"), 0x80);
-
275 #endif
-
276  identifier++;
-
277  pBtd->l2cap_config_request(hci_handle, identifier, control_scid);
-
278  l2cap_state = L2CAP_CONTROL_CONFIG_REQUEST;
-
279  }
-
280  break;
-
281 
-
282  case L2CAP_CONTROL_CONFIG_REQUEST:
-
283  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)) {
-
284  setProtocol(); // Set protocol before establishing HID interrupt channel
-
285  delay(1); // Short delay between commands - just to be sure
-
286 #ifdef DEBUG_USB_HOST
-
287  Notify(PSTR("\r\nSend HID Interrupt Connection Request"), 0x80);
-
288 #endif
-
289  identifier++;
-
290  pBtd->l2cap_connection_request(hci_handle, identifier, interrupt_dcid, HID_INTR_PSM);
-
291  l2cap_state = L2CAP_INTERRUPT_CONNECT_REQUEST;
-
292  }
-
293  break;
-
294 
-
295  case L2CAP_INTERRUPT_CONNECT_REQUEST:
-
296  if(l2cap_check_flag(L2CAP_FLAG_INTERRUPT_CONNECTED)) {
-
297 #ifdef DEBUG_USB_HOST
-
298  Notify(PSTR("\r\nSend HID Interrupt Config Request"), 0x80);
-
299 #endif
-
300  identifier++;
-
301  pBtd->l2cap_config_request(hci_handle, identifier, interrupt_scid);
-
302  l2cap_state = L2CAP_INTERRUPT_CONFIG_REQUEST;
-
303  }
-
304  break;
-
305 
-
306  case L2CAP_INTERRUPT_CONFIG_REQUEST:
-
307  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)) { // Now the HID channels is established
-
308 #ifdef DEBUG_USB_HOST
-
309  Notify(PSTR("\r\nHID Channels Established"), 0x80);
-
310 #endif
-
311  pBtd->connectToHIDDevice = false;
-
312  pBtd->pairWithHIDDevice = false;
-
313  connected = true;
-
314  onInit();
-
315  l2cap_state = L2CAP_DONE;
-
316  }
+
261  pBtd->l2cap_config_request(hci_handle, identifier, interrupt_scid);
+
262 
+
263  l2cap_state = L2CAP_INTERRUPT_CONFIG_REQUEST;
+
264  }
+
265  break;
+
266 
+
267  /* These states are used if the Arduino is the host */
+
268  case L2CAP_CONTROL_CONNECT_REQUEST:
+
269  if(l2cap_check_flag(L2CAP_FLAG_CONTROL_CONNECTED)) {
+
270 #ifdef DEBUG_USB_HOST
+
271  Notify(PSTR("\r\nSend HID Control Config Request"), 0x80);
+
272 #endif
+
273  identifier++;
+
274  pBtd->l2cap_config_request(hci_handle, identifier, control_scid);
+
275  l2cap_state = L2CAP_CONTROL_CONFIG_REQUEST;
+
276  }
+
277  break;
+
278 
+
279  case L2CAP_CONTROL_CONFIG_REQUEST:
+
280  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)) {
+
281  setProtocol(); // Set protocol before establishing HID interrupt channel
+
282  delay(1); // Short delay between commands - just to be sure
+
283 #ifdef DEBUG_USB_HOST
+
284  Notify(PSTR("\r\nSend HID Interrupt Connection Request"), 0x80);
+
285 #endif
+
286  identifier++;
+
287  pBtd->l2cap_connection_request(hci_handle, identifier, interrupt_dcid, HID_INTR_PSM);
+
288  l2cap_state = L2CAP_INTERRUPT_CONNECT_REQUEST;
+
289  }
+
290  break;
+
291 
+
292  case L2CAP_INTERRUPT_CONNECT_REQUEST:
+
293  if(l2cap_check_flag(L2CAP_FLAG_INTERRUPT_CONNECTED)) {
+
294 #ifdef DEBUG_USB_HOST
+
295  Notify(PSTR("\r\nSend HID Interrupt Config Request"), 0x80);
+
296 #endif
+
297  identifier++;
+
298  pBtd->l2cap_config_request(hci_handle, identifier, interrupt_scid);
+
299  l2cap_state = L2CAP_INTERRUPT_CONFIG_REQUEST;
+
300  }
+
301  break;
+
302 
+
303  case L2CAP_INTERRUPT_CONFIG_REQUEST:
+
304  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)) { // Now the HID channels is established
+
305 #ifdef DEBUG_USB_HOST
+
306  Notify(PSTR("\r\nHID Channels Established"), 0x80);
+
307 #endif
+
308  pBtd->connectToHIDDevice = false;
+
309  pBtd->pairWithHIDDevice = false;
+
310  connected = true;
+
311  onInit();
+
312  l2cap_state = L2CAP_DONE;
+
313  }
+
314  break;
+
315 
+
316  case L2CAP_DONE:
317  break;
318 
-
319  case L2CAP_DONE:
-
320  break;
-
321 
-
322  case L2CAP_INTERRUPT_DISCONNECT:
-
323  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)) {
-
324 #ifdef DEBUG_USB_HOST
-
325  Notify(PSTR("\r\nDisconnected Interrupt Channel"), 0x80);
-
326 #endif
-
327  identifier++;
-
328  pBtd->l2cap_disconnection_request(hci_handle, identifier, control_scid, control_dcid);
-
329  l2cap_state = L2CAP_CONTROL_DISCONNECT;
-
330  }
-
331  break;
-
332 
-
333  case L2CAP_CONTROL_DISCONNECT:
-
334  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)) {
-
335 #ifdef DEBUG_USB_HOST
-
336  Notify(PSTR("\r\nDisconnected Control Channel"), 0x80);
-
337 #endif
-
338  pBtd->hci_disconnect(hci_handle);
-
339  hci_handle = -1; // Reset handle
-
340  l2cap_event_flag = 0; // Reset flags
-
341  l2cap_state = L2CAP_WAIT;
-
342  }
-
343  break;
-
344  }
-
345 }
-
346 
-
347 void BTHID::Run() {
-
348  switch(l2cap_state) {
-
349  case L2CAP_WAIT:
-
350  if(pBtd->connectToHIDDevice && !pBtd->l2capConnectionClaimed && !connected && !activeConnection) {
-
351  pBtd->l2capConnectionClaimed = true;
-
352  activeConnection = true;
-
353 #ifdef DEBUG_USB_HOST
-
354  Notify(PSTR("\r\nSend HID Control Connection Request"), 0x80);
-
355 #endif
-
356  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
-
357  l2cap_event_flag = 0; // Reset flags
-
358  identifier = 0;
-
359  pBtd->l2cap_connection_request(hci_handle, identifier, control_dcid, HID_CTRL_PSM);
-
360  l2cap_state = L2CAP_CONTROL_CONNECT_REQUEST;
-
361  } else if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)) {
-
362 #ifdef DEBUG_USB_HOST
-
363  Notify(PSTR("\r\nHID Control Incoming Connection Request"), 0x80);
-
364 #endif
-
365  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, PENDING);
+
319  case L2CAP_INTERRUPT_DISCONNECT:
+
320  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)) {
+
321 #ifdef DEBUG_USB_HOST
+
322  Notify(PSTR("\r\nDisconnected Interrupt Channel"), 0x80);
+
323 #endif
+
324  identifier++;
+
325  pBtd->l2cap_disconnection_request(hci_handle, identifier, control_scid, control_dcid);
+
326  l2cap_state = L2CAP_CONTROL_DISCONNECT;
+
327  }
+
328  break;
+
329 
+
330  case L2CAP_CONTROL_DISCONNECT:
+
331  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)) {
+
332 #ifdef DEBUG_USB_HOST
+
333  Notify(PSTR("\r\nDisconnected Control Channel"), 0x80);
+
334 #endif
+
335  pBtd->hci_disconnect(hci_handle);
+
336  hci_handle = -1; // Reset handle
+
337  l2cap_event_flag = 0; // Reset flags
+
338  l2cap_state = L2CAP_WAIT;
+
339  }
+
340  break;
+
341  }
+
342 }
+
343 
+
344 void BTHID::Run() {
+
345  switch(l2cap_state) {
+
346  case L2CAP_WAIT:
+
347  if(pBtd->connectToHIDDevice && !pBtd->l2capConnectionClaimed && !connected && !activeConnection) {
+
348  pBtd->l2capConnectionClaimed = true;
+
349  activeConnection = true;
+
350 #ifdef DEBUG_USB_HOST
+
351  Notify(PSTR("\r\nSend HID Control Connection Request"), 0x80);
+
352 #endif
+
353  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
+
354  l2cap_event_flag = 0; // Reset flags
+
355  identifier = 0;
+
356  pBtd->l2cap_connection_request(hci_handle, identifier, control_dcid, HID_CTRL_PSM);
+
357  l2cap_state = L2CAP_CONTROL_CONNECT_REQUEST;
+
358  } else if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)) {
+
359 #ifdef DEBUG_USB_HOST
+
360  Notify(PSTR("\r\nHID Control Incoming Connection Request"), 0x80);
+
361 #endif
+
362  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, PENDING);
+
363  delay(1);
+
364  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, SUCCESSFUL);
+
365  identifier++;
366  delay(1);
-
367  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, SUCCESSFUL);
-
368  identifier++;
-
369  delay(1);
-
370  pBtd->l2cap_config_request(hci_handle, identifier, control_scid);
-
371  l2cap_state = L2CAP_CONTROL_SUCCESS;
-
372  }
-
373  break;
-
374  }
-
375 }
+
367  pBtd->l2cap_config_request(hci_handle, identifier, control_scid);
+
368  l2cap_state = L2CAP_CONTROL_SUCCESS;
+
369  }
+
370  break;
+
371  }
+
372 }
+
373 
+
374 /************************************************************/
+
375 /* HID Commands */
376 
377 /************************************************************/
-
378 /* HID Commands */
-
379 
-
380 /************************************************************/
-
381 void BTHID::setProtocol() {
-
382 #ifdef DEBUG_USB_HOST
-
383  Notify(PSTR("\r\nSet protocol mode: "), 0x80);
-
384  D_PrintHex<uint8_t > (protocolMode, 0x80);
-
385 #endif
-
386  if (protocolMode != HID_BOOT_PROTOCOL && protocolMode != HID_RPT_PROTOCOL) {
-
387 #ifdef DEBUG_USB_HOST
-
388  Notify(PSTR("\r\nNot a valid protocol mode. Using Boot protocol instead."), 0x80);
-
389 #endif
-
390  protocolMode = HID_BOOT_PROTOCOL; // Use Boot Protocol by default
-
391  }
-
392  uint8_t command = 0x70 | protocolMode; // Set Protocol, see Bluetooth HID specs page 33
-
393  pBtd->L2CAP_Command(hci_handle, &command, 1, control_scid[0], control_scid[1]);
-
394 }
-
395 
-
396 void BTHID::setLeds(uint8_t data) {
-
397  uint8_t buf[3];
-
398  buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
-
399  buf[1] = 0x01; // Report ID
-
400  buf[2] = data;
-
401  pBtd->L2CAP_Command(hci_handle, buf, 3, interrupt_scid[0], interrupt_scid[1]);
-
402 }
-
#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE
Definition: BTD.h:139
-
#define UHS_ACL_HANDLE_OK(x, y)
Definition: BTD.h:207
-
#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS
Definition: BTD.h:143
-
#define L2CAP_INTERRUPT_CONFIG_REQUEST
Definition: BTD.h:115
-
#define L2CAP_INTERRUPT_SETUP
Definition: BTD.h:113
-
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1231
-
#define SUCCESSFUL
Definition: BTD.h:177
-
virtual void ACLData(uint8_t *ACLData)
Definition: BTHID.cpp:59
-
void l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)
Definition: BTD.cpp:1218
-
#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST
Definition: BTD.h:142
+
378 void BTHID::setProtocol() {
+
379 #ifdef DEBUG_USB_HOST
+
380  Notify(PSTR("\r\nSet protocol mode: "), 0x80);
+
381  D_PrintHex<uint8_t > (protocolMode, 0x80);
+
382 #endif
+
383  if (protocolMode != HID_BOOT_PROTOCOL && protocolMode != HID_RPT_PROTOCOL) {
+
384 #ifdef DEBUG_USB_HOST
+
385  Notify(PSTR("\r\nNot a valid protocol mode. Using Boot protocol instead."), 0x80);
+
386 #endif
+
387  protocolMode = HID_BOOT_PROTOCOL; // Use Boot Protocol by default
+
388  }
+
389  uint8_t command = 0x70 | protocolMode; // Set Protocol, see Bluetooth HID specs page 33
+
390  pBtd->L2CAP_Command(hci_handle, &command, 1, control_scid[0], control_scid[1]);
+
391 }
+
392 
+
393 void BTHID::setLeds(uint8_t data) {
+
394  uint8_t buf[3];
+
395  buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
+
396  buf[1] = 0x01; // Report ID
+
397  buf[2] = data;
+
398  pBtd->L2CAP_Command(hci_handle, buf, 3, interrupt_scid[0], interrupt_scid[1]);
+
399 }
+
#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE
Definition: BTD.h:137
+
#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS
Definition: BTD.h:141
+
#define L2CAP_INTERRUPT_CONFIG_REQUEST
Definition: BTD.h:113
+
#define L2CAP_INTERRUPT_SETUP
Definition: BTD.h:111
+
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1239
+
#define SUCCESSFUL
Definition: BTD.h:175
+
void ACLData(uint8_t *ACLData)
Definition: BTHID.cpp:56
+
void l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)
Definition: BTD.cpp:1226
+
#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST
Definition: BTD.h:140
#define HID_RPT_PROTOCOL
Definition: hid.h:83
-
Definition: BTD.h:230
-
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1284
-
uint8_t interrupt_scid[2]
Definition: BTHID.h:139
-
bool connected
Definition: BTHID.h:92
-
virtual void Run()
Definition: BTHID.cpp:347
-
const char * btdPin
Definition: BTD.h:482
-
#define L2CAP_DONE
Definition: BTD.h:104
-
#define L2CAP_CONTROL_SUCCESS
Definition: BTD.h:109
-
#define L2CAP_WAIT
Definition: BTD.h:103
-
virtual void ResetBTHID()
Definition: BTHID.h:123
-
virtual void Reset()
Definition: BTHID.cpp:44
-
#define L2CAP_CONTROL_CONFIG_REQUEST
Definition: BTD.h:108
-
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1297
-
uint8_t control_scid[2]
Definition: BTHID.h:136
+
Definition: BTD.h:198
+
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1292
+
uint8_t interrupt_scid[2]
Definition: BTHID.h:137
+
uint8_t identifier
Definition: BTD.h:615
+
bool connected
Definition: BTHID.h:83
+
void Run()
Definition: BTHID.cpp:344
+
const char * btdPin
Definition: BTD.h:446
+
#define L2CAP_DONE
Definition: BTD.h:102
+
#define L2CAP_CONTROL_SUCCESS
Definition: BTD.h:107
+
#define L2CAP_WAIT
Definition: BTD.h:101
+
virtual void ResetBTHID()
Definition: BTHID.h:128
+
void Reset()
Definition: BTHID.cpp:41
+
#define L2CAP_CONTROL_CONFIG_REQUEST
Definition: BTD.h:106
+
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1305
+
uint8_t control_scid[2]
Definition: BTHID.h:134
#define Notify(...)
Definition: message.h:44
-
bool connectToHIDDevice
Definition: BTD.h:519
+
bool connectToHIDDevice
Definition: BTD.h:483
#define HID_BOOT_PROTOCOL
Definition: hid.h:82
-
#define L2CAP_CONTROL_CONNECT_REQUEST
Definition: BTD.h:107
-
#define HID_CTRL_PSM
Definition: BTD.h:182
-
bool incomingHIDDevice
Definition: BTD.h:523
-
bool pairWithHIDDevice
Definition: BTD.h:525
+
#define L2CAP_CONTROL_CONNECT_REQUEST
Definition: BTD.h:105
+
#define HID_CTRL_PSM
Definition: BTD.h:180
+
bool incomingHIDDevice
Definition: BTD.h:487
+
bool pairWithHIDDevice
Definition: BTD.h:489
#define MOUSE_PARSER_ID
Definition: BTHID.h:25
-
uint16_t hci_handle
Definition: BTD.h:487
+
uint16_t hci_handle
Definition: BTD.h:451
-
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1142
-
#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE
Definition: BTD.h:145
-
virtual void disconnect()
Definition: BTHID.cpp:52
-
void setLeds(uint8_t data)
Definition: BTHID.cpp:396
-
virtual void ParseBTHIDData(uint8_t len, uint8_t *buf)
Definition: BTHID.h:115
-
BTD * pBtd
Definition: BTHID.h:129
-
#define l2cap_check_flag(flag)
Definition: BTD.h:160
-
#define L2CAP_CMD_CONFIG_REQUEST
Definition: BTD.h:168
-
#define L2CAP_FLAG_CONTROL_CONNECTED
Definition: BTD.h:138
-
#define L2CAP_CMD_DISCONNECT_REQUEST
Definition: BTD.h:170
-
#define L2CAP_CONTROL_DISCONNECT
Definition: BTD.h:110
-
#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST
Definition: BTD.h:136
-
uint16_t hci_handle
Definition: BTHID.h:132
-
#define HID_INTR_PSM
Definition: BTD.h:183
-
int8_t registerServiceClass(BluetoothService *pService)
Definition: BTD.h:333
-
bool l2capConnectionClaimed
Definition: BTD.h:473
+
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1150
+
Definition: BTD.h:563
+
#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE
Definition: BTD.h:143
+
void disconnect()
Definition: BTHID.cpp:49
+
void setLeds(uint8_t data)
Definition: BTHID.cpp:393
+
virtual void ParseBTHIDData(uint8_t len, uint8_t *buf)
Definition: BTHID.h:120
+
#define l2cap_check_flag(flag)
Definition: BTD.h:158
+
#define L2CAP_CMD_CONFIG_REQUEST
Definition: BTD.h:166
+
#define L2CAP_FLAG_CONTROL_CONNECTED
Definition: BTD.h:136
+
#define PSTR(str)
+
#define L2CAP_CMD_DISCONNECT_REQUEST
Definition: BTD.h:168
+
#define L2CAP_CONTROL_DISCONNECT
Definition: BTD.h:108
+
#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST
Definition: BTD.h:134
+
BTD * pBtd
Definition: BTD.h:606
+
#define HID_INTR_PSM
Definition: BTD.h:181
+
bool l2capConnectionClaimed
Definition: BTD.h:437
virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)=0
-
#define L2CAP_CMD_DISCONNECT_RESPONSE
Definition: BTD.h:171
-
#define L2CAP_CMD_CONNECTION_RESPONSE
Definition: BTD.h:167
-
#define L2CAP_CMD_CONFIG_RESPONSE
Definition: BTD.h:169
+
#define L2CAP_CMD_DISCONNECT_RESPONSE
Definition: BTD.h:169
+
#define L2CAP_CMD_CONNECTION_RESPONSE
Definition: BTD.h:165
+
#define L2CAP_CMD_CONFIG_RESPONSE
Definition: BTD.h:167
+
uint16_t hci_handle
Definition: BTD.h:609
#define NUM_PARSERS
Definition: BTHID.h:26
#define KEYBOARD_PARSER_ID
Definition: BTHID.h:24
-
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1190
-
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1265
-
#define PENDING
Definition: BTD.h:176
-
#define L2CAP_FLAG_INTERRUPT_CONNECTED
Definition: BTD.h:144
-
#define l2cap_set_flag(flag)
Definition: BTD.h:161
-
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1248
-
#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS
Definition: BTD.h:137
-
#define L2CAP_CMD_CONNECTION_REQUEST
Definition: BTD.h:166
+
uint32_t l2cap_event_flag
Definition: BTD.h:612
+
void onInit()
Definition: BTHID.h:107
+
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1198
+
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1273
+
#define PENDING
Definition: BTD.h:174
+
#define L2CAP_FLAG_INTERRUPT_CONNECTED
Definition: BTD.h:142
+
#define l2cap_set_flag(flag)
Definition: BTD.h:159
+
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1256
+
#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS
Definition: BTD.h:135
+
#define L2CAP_CMD_CONNECTION_REQUEST
Definition: BTD.h:164
BTHID(BTD *p, bool pair=false, const char *pin="0000")
Definition: BTHID.cpp:23
-
#define L2CAP_INTERRUPT_CONNECT_REQUEST
Definition: BTD.h:114
-
void pair(void)
Definition: BTHID.h:95
-
#define L2CAP_INTERRUPT_DISCONNECT
Definition: BTD.h:116
-
#define L2CAP_CMD_COMMAND_REJECT
Definition: BTD.h:165
+
bool checkHciHandle(uint8_t *buf, uint16_t handle)
Definition: BTD.h:598
+
#define L2CAP_INTERRUPT_CONNECT_REQUEST
Definition: BTD.h:112
+
void pair(void)
Definition: BTHID.h:86
+
#define L2CAP_INTERRUPT_DISCONNECT
Definition: BTD.h:114
+
#define L2CAP_CMD_COMMAND_REJECT
Definition: BTD.h:163
diff --git a/_b_t_h_i_d_8h.html b/_b_t_h_i_d_8h.html index 831964c6..015e30f9 100644 --- a/_b_t_h_i_d_8h.html +++ b/_b_t_h_i_d_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: BTHID.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -99,7 +100,7 @@ Include dependency graph for BTHID.h:
- +
This graph shows which files directly or indirectly include this file:
@@ -173,7 +174,7 @@ Macros diff --git a/_b_t_h_i_d_8h__dep__incl.md5 b/_b_t_h_i_d_8h__dep__incl.md5 index ca89e4dc..053bda1f 100644 --- a/_b_t_h_i_d_8h__dep__incl.md5 +++ b/_b_t_h_i_d_8h__dep__incl.md5 @@ -1 +1 @@ -98e640defd09cdb6bea449a9af48374c \ No newline at end of file +0205aeed5db75f7b218ba6ecd920ddcd \ No newline at end of file diff --git a/_b_t_h_i_d_8h__incl.map b/_b_t_h_i_d_8h__incl.map index d0f24b36..a49ee964 100644 --- a/_b_t_h_i_d_8h__incl.map +++ b/_b_t_h_i_d_8h__incl.map @@ -1,7 +1,7 @@ - - + + - - + + diff --git a/_b_t_h_i_d_8h__incl.md5 b/_b_t_h_i_d_8h__incl.md5 index f98ecfbe..4f97447f 100644 --- a/_b_t_h_i_d_8h__incl.md5 +++ b/_b_t_h_i_d_8h__incl.md5 @@ -1 +1 @@ -50c98864be761896492416679dad01a4 \ No newline at end of file +28e181610b904ff2ed75411a23593963 \ No newline at end of file diff --git a/_b_t_h_i_d_8h__incl.png b/_b_t_h_i_d_8h__incl.png index 0977c9e4..cd4df365 100644 Binary files a/_b_t_h_i_d_8h__incl.png and b/_b_t_h_i_d_8h__incl.png differ diff --git a/_b_t_h_i_d_8h_source.html b/_b_t_h_i_d_8h_source.html index b7947e85..ef5da9bf 100644 --- a/_b_t_h_i_d_8h_source.html +++ b/_b_t_h_i_d_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: BTHID.h Source File + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -120,116 +121,104 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
30 public:
37  BTHID(BTD *p, bool pair = false, const char *pin = "0000");
38 
-
44  virtual void ACLData(uint8_t* ACLData);
-
46  virtual void Run();
-
48  virtual void Reset();
-
50  virtual void disconnect();
-
58  HIDReportParser *GetReportParser(uint8_t id) {
-
59  if (id >= NUM_PARSERS)
-
60  return NULL;
-
61  return pRptParser[id];
-
62  };
-
63 
-
70  bool SetReportParser(uint8_t id, HIDReportParser *prs) {
-
71  if (id >= NUM_PARSERS)
-
72  return false;
-
73  pRptParser[id] = prs;
-
74  return true;
-
75  };
-
76 
-
81  void setProtocolMode(uint8_t mode) {
-
82  protocolMode = mode;
-
83  };
+
41  void disconnect();
+
49  HIDReportParser *GetReportParser(uint8_t id) {
+
50  if (id >= NUM_PARSERS)
+
51  return NULL;
+
52  return pRptParser[id];
+
53  };
+
54 
+
61  bool SetReportParser(uint8_t id, HIDReportParser *prs) {
+
62  if (id >= NUM_PARSERS)
+
63  return false;
+
64  pRptParser[id] = prs;
+
65  return true;
+
66  };
+
67 
+
72  void setProtocolMode(uint8_t mode) {
+
73  protocolMode = mode;
+
74  };
+
75 
+
80  void setLeds(uint8_t data);
+
81 
+
83  bool connected;
84 
-
89  void setLeds(uint8_t data);
+
86  void pair(void) {
+
87  if(pBtd)
+
88  pBtd->pairWithHID();
+
89  };
90 
-
92  bool connected;
-
93 
-
95  void pair(void) {
-
96  if(pBtd)
-
97  pBtd->pairWithHID();
-
98  };
-
99 
-
104  void attachOnInit(void (*funcOnInit)(void)) {
-
105  pFuncOnInit = funcOnInit;
-
106  };
-
107 
-
108 protected:
-
115  virtual void ParseBTHIDData(uint8_t len, uint8_t *buf) {
-
116  return;
-
117  };
-
119  virtual void OnInitBTHID() {
-
120  return;
-
121  };
-
123  virtual void ResetBTHID() {
-
124  return;
-
125  }
-
129  BTD *pBtd;
-
130 
-
132  uint16_t hci_handle;
-
133 
-
136  uint8_t control_scid[2];
-
137 
-
139  uint8_t interrupt_scid[2];
-
140 
-
141 private:
-
142  HIDReportParser *pRptParser[NUM_PARSERS]; // Pointer to HIDReportParsers.
-
143 
-
145  void setProtocol();
-
146  uint8_t protocolMode;
+
91 protected:
+
97  void ACLData(uint8_t* ACLData);
+
99  void Run();
+
101  void Reset();
+
107  void onInit() {
+
108  if(pFuncOnInit)
+
109  pFuncOnInit(); // Call the user function
+
110  OnInitBTHID();
+
111  };
+
120  virtual void ParseBTHIDData(uint8_t len, uint8_t *buf) {
+
121  return;
+
122  };
+
124  virtual void OnInitBTHID() {
+
125  return;
+
126  };
+
128  virtual void ResetBTHID() {
+
129  return;
+
130  }
+
134  uint8_t control_scid[2];
+
135 
+
137  uint8_t interrupt_scid[2];
+
138 
+
139 private:
+
140  HIDReportParser *pRptParser[NUM_PARSERS]; // Pointer to HIDReportParsers.
+
141 
+
143  void setProtocol();
+
144  uint8_t protocolMode;
+
145 
+
146  void L2CAP_task(); // L2CAP state machine
147 
-
153  void onInit() {
-
154  if(pFuncOnInit)
-
155  pFuncOnInit(); // Call the user function
-
156  OnInitBTHID();
-
157  };
-
158  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
-
159 
-
160  void L2CAP_task(); // L2CAP state machine
-
161 
-
162  bool activeConnection; // Used to indicate if it already has established a connection
-
163 
-
164  /* Variables used for L2CAP communication */
-
165  uint8_t control_dcid[2]; // L2CAP device CID for HID_Control - Always 0x0070
-
166  uint8_t interrupt_dcid[2]; // L2CAP device CID for HID_Interrupt - Always 0x0071
-
167  uint8_t identifier; // Identifier for connection
-
168  uint8_t l2cap_state;
-
169  uint32_t l2cap_event_flag; // l2cap flags of received Bluetooth events
-
170 };
-
171 #endif
+
148  bool activeConnection; // Used to indicate if it already has established a connection
+
149 
+
150  /* Variables used for L2CAP communication */
+
151  uint8_t control_dcid[2]; // L2CAP device CID for HID_Control - Always 0x0070
+
152  uint8_t interrupt_dcid[2]; // L2CAP device CID for HID_Interrupt - Always 0x0071
+
153  uint8_t l2cap_state;
+
154 };
+
155 #endif
-
virtual void OnInitBTHID()
Definition: BTHID.h:119
-
virtual void ACLData(uint8_t *ACLData)
Definition: BTHID.cpp:59
-
Definition: BTD.h:230
-
uint8_t interrupt_scid[2]
Definition: BTHID.h:139
-
bool connected
Definition: BTHID.h:92
-
virtual void Run()
Definition: BTHID.cpp:347
-
virtual void ResetBTHID()
Definition: BTHID.h:123
-
virtual void Reset()
Definition: BTHID.cpp:44
-
uint8_t control_scid[2]
Definition: BTHID.h:136
-
void attachOnInit(void(*funcOnInit)(void))
Definition: BTHID.h:104
-
void pairWithHID()
Definition: BTD.h:516
-
Definition: BTD.h:211
-
virtual void disconnect()
Definition: BTHID.cpp:52
-
HIDReportParser * GetReportParser(uint8_t id)
Definition: BTHID.h:58
-
void setLeds(uint8_t data)
Definition: BTHID.cpp:396
-
virtual void ParseBTHIDData(uint8_t len, uint8_t *buf)
Definition: BTHID.h:115
-
BTD * pBtd
Definition: BTHID.h:129
-
uint16_t hci_handle
Definition: BTHID.h:132
+
virtual void OnInitBTHID()
Definition: BTHID.h:124
+
void ACLData(uint8_t *ACLData)
Definition: BTHID.cpp:56
+
Definition: BTD.h:198
+
uint8_t interrupt_scid[2]
Definition: BTHID.h:137
+
bool connected
Definition: BTHID.h:83
+
void Run()
Definition: BTHID.cpp:344
+
virtual void ResetBTHID()
Definition: BTHID.h:128
+
void Reset()
Definition: BTHID.cpp:41
+
uint8_t control_scid[2]
Definition: BTHID.h:134
+
void pairWithHID()
Definition: BTD.h:480
+
Definition: BTD.h:563
+
void disconnect()
Definition: BTHID.cpp:49
+
HIDReportParser * GetReportParser(uint8_t id)
Definition: BTHID.h:49
+
void setLeds(uint8_t data)
Definition: BTHID.cpp:393
+
virtual void ParseBTHIDData(uint8_t len, uint8_t *buf)
Definition: BTHID.h:120
+
void(* pFuncOnInit)(void)
Definition: BTD.h:603
+
BTD * pBtd
Definition: BTD.h:606
#define NUM_PARSERS
Definition: BTHID.h:26
+
void onInit()
Definition: BTHID.h:107
Definition: hid.h:138
Definition: BTHID.h:29
-
void setProtocolMode(uint8_t mode)
Definition: BTHID.h:81
+
void setProtocolMode(uint8_t mode)
Definition: BTHID.h:72
BTHID(BTD *p, bool pair=false, const char *pin="0000")
Definition: BTHID.cpp:23
-
void pair(void)
Definition: BTHID.h:95
-
bool SetReportParser(uint8_t id, HIDReportParser *prs)
Definition: BTHID.h:70
+
void pair(void)
Definition: BTHID.h:86
+
bool SetReportParser(uint8_t id, HIDReportParser *prs)
Definition: BTHID.h:61
diff --git a/_p_s3_b_t_8cpp.html b/_p_s3_b_t_8cpp.html index 9a866655..d7fde8f4 100644 --- a/_p_s3_b_t_8cpp.html +++ b/_p_s3_b_t_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS3BT.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -95,7 +96,7 @@ Include dependency graph for PS3BT.cpp:
- +

Go to the source code of this file.

@@ -104,7 +105,7 @@ Include dependency graph for PS3BT.cpp: diff --git a/_p_s3_b_t_8cpp__incl.map b/_p_s3_b_t_8cpp__incl.map index 6c9a4e27..c1784287 100644 --- a/_p_s3_b_t_8cpp__incl.map +++ b/_p_s3_b_t_8cpp__incl.map @@ -1,7 +1,9 @@ - - - - - + + + + + + + diff --git a/_p_s3_b_t_8cpp__incl.md5 b/_p_s3_b_t_8cpp__incl.md5 index 972cd9fe..3eddc609 100644 --- a/_p_s3_b_t_8cpp__incl.md5 +++ b/_p_s3_b_t_8cpp__incl.md5 @@ -1 +1 @@ -2a26709935401ef53e5fb70ac8d80eef \ No newline at end of file +4aca24efbdc1291f07e6257ad7bd19ca \ No newline at end of file diff --git a/_p_s3_b_t_8cpp__incl.png b/_p_s3_b_t_8cpp__incl.png index a4ea5f8a..870b0dd6 100644 Binary files a/_p_s3_b_t_8cpp__incl.png and b/_p_s3_b_t_8cpp__incl.png differ diff --git a/_p_s3_b_t_8cpp_source.html b/_p_s3_b_t_8cpp_source.html index 6f3969bb..88140926 100644 --- a/_p_s3_b_t_8cpp_source.html +++ b/_p_s3_b_t_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS3BT.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -112,756 +113,763 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
21 //#define PRINTREPORT // Uncomment to print the report send by the PS3 Controllers
22 
23 PS3BT::PS3BT(BTD *p, uint8_t btadr5, uint8_t btadr4, uint8_t btadr3, uint8_t btadr2, uint8_t btadr1, uint8_t btadr0) :
-
24 pBtd(p) // pointer to USB class instance - mandatory
+
24 BluetoothService(p) // Pointer to USB class instance - mandatory
25 {
-
26  if(pBtd)
-
27  pBtd->registerServiceClass(this); // Register it as a Bluetooth service
-
28 
-
29  pBtd->my_bdaddr[5] = btadr5; // Change to your dongle's Bluetooth address instead
-
30  pBtd->my_bdaddr[4] = btadr4;
-
31  pBtd->my_bdaddr[3] = btadr3;
-
32  pBtd->my_bdaddr[2] = btadr2;
-
33  pBtd->my_bdaddr[1] = btadr1;
-
34  pBtd->my_bdaddr[0] = btadr0;
+
26  pBtd->my_bdaddr[5] = btadr5; // Change to your dongle's Bluetooth address instead
+
27  pBtd->my_bdaddr[4] = btadr4;
+
28  pBtd->my_bdaddr[3] = btadr3;
+
29  pBtd->my_bdaddr[2] = btadr2;
+
30  pBtd->my_bdaddr[1] = btadr1;
+
31  pBtd->my_bdaddr[0] = btadr0;
+
32 
+
33  HIDBuffer[0] = 0x52; // HID BT Set_report (0x50) | Report Type (Output 0x02)
+
34  HIDBuffer[1] = 0x01; // Report ID
35 
-
36  HIDBuffer[0] = 0x52; // HID BT Set_report (0x50) | Report Type (Output 0x02)
-
37  HIDBuffer[1] = 0x01; // Report ID
-
38 
-
39  // Needed for PS3 Move Controller commands to work via bluetooth
-
40  HIDMoveBuffer[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
-
41  HIDMoveBuffer[1] = 0x02; // Report ID
-
42 
-
43  /* Set device cid for the control and intterrupt channelse - LSB */
-
44  control_dcid[0] = 0x40; // 0x0040
-
45  control_dcid[1] = 0x00;
-
46  interrupt_dcid[0] = 0x41; // 0x0041
-
47  interrupt_dcid[1] = 0x00;
+
36  // Needed for PS3 Move Controller commands to work via bluetooth
+
37  HIDMoveBuffer[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
+
38  HIDMoveBuffer[1] = 0x02; // Report ID
+
39 
+
40  /* Set device cid for the control and intterrupt channelse - LSB */
+
41  control_dcid[0] = 0x40; // 0x0040
+
42  control_dcid[1] = 0x00;
+
43  interrupt_dcid[0] = 0x41; // 0x0041
+
44  interrupt_dcid[1] = 0x00;
+
45 
+
46  Reset();
+
47 }
48 
-
49  Reset();
-
50 }
-
51 
-
52 bool PS3BT::getButtonPress(ButtonEnum b) {
-
53  return (ButtonState & pgm_read_dword(&PS3_BUTTONS[(uint8_t)b]));
-
54 }
-
55 
-
56 bool PS3BT::getButtonClick(ButtonEnum b) {
-
57  uint32_t button = pgm_read_dword(&PS3_BUTTONS[(uint8_t)b]);
-
58  bool click = (ButtonClickState & button);
-
59  ButtonClickState &= ~button; // Clear "click" event
-
60  return click;
-
61 }
-
62 
-
63 uint8_t PS3BT::getAnalogButton(ButtonEnum a) {
-
64  return (uint8_t)(l2capinbuf[pgm_read_byte(&PS3_ANALOG_BUTTONS[(uint8_t)a])]);
-
65 }
-
66 
-
67 uint8_t PS3BT::getAnalogHat(AnalogHatEnum a) {
-
68  return (uint8_t)(l2capinbuf[(uint8_t)a + 15]);
-
69 }
-
70 
-
71 int16_t PS3BT::getSensor(SensorEnum a) {
-
72  if(PS3Connected) {
-
73  if(a == aX || a == aY || a == aZ || a == gZ)
-
74  return ((l2capinbuf[(uint16_t)a] << 8) | l2capinbuf[(uint16_t)a + 1]);
-
75  else
-
76  return 0;
-
77  } else if(PS3MoveConnected) {
-
78  if(a == mXmove || a == mYmove) // These are all 12-bits long
-
79  return (((l2capinbuf[(uint16_t)a] & 0x0F) << 8) | (l2capinbuf[(uint16_t)a + 1]));
-
80  else if(a == mZmove || a == tempMove) // The tempearature is also 12 bits long
-
81  return ((l2capinbuf[(uint16_t)a] << 4) | ((l2capinbuf[(uint16_t)a + 1] & 0xF0) >> 4));
-
82  else // aXmove, aYmove, aZmove, gXmove, gYmove and gZmove
-
83  return (l2capinbuf[(uint16_t)a] | (l2capinbuf[(uint16_t)a + 1] << 8));
-
84  } else
-
85  return 0;
-
86 }
+
49 bool PS3BT::getButtonPress(ButtonEnum b) {
+
50  return (ButtonState & pgm_read_dword(&PS3_BUTTONS[(uint8_t)b]));
+
51 }
+
52 
+
53 bool PS3BT::getButtonClick(ButtonEnum b) {
+
54  uint32_t button = pgm_read_dword(&PS3_BUTTONS[(uint8_t)b]);
+
55  bool click = (ButtonClickState & button);
+
56  ButtonClickState &= ~button; // Clear "click" event
+
57  return click;
+
58 }
+
59 
+
60 uint8_t PS3BT::getAnalogButton(ButtonEnum a) {
+
61  return (uint8_t)(l2capinbuf[pgm_read_byte(&PS3_ANALOG_BUTTONS[(uint8_t)a])]);
+
62 }
+
63 
+
64 uint8_t PS3BT::getAnalogHat(AnalogHatEnum a) {
+
65  return (uint8_t)(l2capinbuf[(uint8_t)a + 15]);
+
66 }
+
67 
+
68 int16_t PS3BT::getSensor(SensorEnum a) {
+
69  if(PS3Connected) {
+
70  if(a == aX || a == aY || a == aZ || a == gZ)
+
71  return ((l2capinbuf[(uint16_t)a] << 8) | l2capinbuf[(uint16_t)a + 1]);
+
72  else
+
73  return 0;
+
74  } else if(PS3MoveConnected) {
+
75  if(a == mXmove || a == mYmove) // These are all 12-bits long
+
76  return (((l2capinbuf[(uint16_t)a] & 0x0F) << 8) | (l2capinbuf[(uint16_t)a + 1]));
+
77  else if(a == mZmove || a == tempMove) // The tempearature is also 12 bits long
+
78  return ((l2capinbuf[(uint16_t)a] << 4) | ((l2capinbuf[(uint16_t)a + 1] & 0xF0) >> 4));
+
79  else // aXmove, aYmove, aZmove, gXmove, gYmove and gZmove
+
80  return (l2capinbuf[(uint16_t)a] | (l2capinbuf[(uint16_t)a + 1] << 8));
+
81  } else
+
82  return 0;
+
83 }
+
84 
+
85 double PS3BT::getAngle(AngleEnum a) {
+
86  double accXval, accYval, accZval;
87 
-
88 double PS3BT::getAngle(AngleEnum a) {
-
89  double accXval, accYval, accZval;
-
90 
-
91  if(PS3Connected) {
-
92  // Data for the Kionix KXPC4 used in the DualShock 3
-
93  const double zeroG = 511.5; // 1.65/3.3*1023 (1.65V)
-
94  accXval = -((double)getSensor(aX) - zeroG);
-
95  accYval = -((double)getSensor(aY) - zeroG);
-
96  accZval = -((double)getSensor(aZ) - zeroG);
-
97  } else if(PS3MoveConnected) {
-
98  // It's a Kionix KXSC4 inside the Motion controller
-
99  const uint16_t zeroG = 0x8000;
-
100  accXval = -(int16_t)(getSensor(aXmove) - zeroG);
-
101  accYval = (int16_t)(getSensor(aYmove) - zeroG);
-
102  accZval = (int16_t)(getSensor(aZmove) - zeroG);
-
103  } else
-
104  return 0;
-
105 
-
106  // Convert to 360 degrees resolution
-
107  // atan2 outputs the value of -Ï€ to Ï€ (radians)
-
108  // We are then converting it to 0 to 2Ï€ and then to degrees
-
109  if(a == Pitch)
-
110  return (atan2(accYval, accZval) + PI) * RAD_TO_DEG;
-
111  else
-
112  return (atan2(accXval, accZval) + PI) * RAD_TO_DEG;
-
113 }
-
114 
-
115 double PS3BT::get9DOFValues(SensorEnum a) { // Thanks to Manfred Piendl
-
116  if(!PS3MoveConnected)
-
117  return 0;
-
118  int16_t value = getSensor(a);
-
119  if(a == mXmove || a == mYmove || a == mZmove) {
-
120  if(value > 2047)
-
121  value -= 0x1000;
-
122  return (double)value / 3.2; // unit: muT = 10^(-6) Tesla
-
123  } else if(a == aXmove || a == aYmove || a == aZmove) {
-
124  if(value < 0)
-
125  value += 0x8000;
-
126  else
-
127  value -= 0x8000;
-
128  return (double)value / 442.0; // unit: m/(s^2)
-
129  } else if(a == gXmove || a == gYmove || a == gZmove) {
-
130  if(value < 0)
-
131  value += 0x8000;
-
132  else
-
133  value -= 0x8000;
-
134  if(a == gXmove)
-
135  return (double)value / 11.6; // unit: deg/s
-
136  else if(a == gYmove)
-
137  return (double)value / 11.2; // unit: deg/s
-
138  else // gZmove
-
139  return (double)value / 9.6; // unit: deg/s
-
140  } else
-
141  return 0;
-
142 }
-
143 
-
144 String PS3BT::getTemperature() {
-
145  if(PS3MoveConnected) {
-
146  int16_t input = getSensor(tempMove);
-
147 
-
148  String output = String(input / 100);
-
149  output += ".";
-
150  if(input % 100 < 10)
-
151  output += "0";
-
152  output += String(input % 100);
-
153 
-
154  return output;
-
155  } else
-
156  return "Error";
-
157 }
-
158 
-
159 bool PS3BT::getStatus(StatusEnum c) {
-
160  return (l2capinbuf[(uint16_t)c >> 8] == ((uint8_t)c & 0xff));
-
161 }
-
162 
-
163 void PS3BT::printStatusString() {
-
164  char statusOutput[100]; // Max string length plus null character
-
165  if(PS3Connected || PS3NavigationConnected) {
-
166  strcpy_P(statusOutput, PSTR("ConnectionStatus: "));
-
167 
-
168  if(getStatus(Plugged)) strcat_P(statusOutput, PSTR("Plugged"));
-
169  else if(getStatus(Unplugged)) strcat_P(statusOutput, PSTR("Unplugged"));
-
170  else strcat_P(statusOutput, PSTR("Error"));
-
171 
-
172  strcat_P(statusOutput, PSTR(" - PowerRating: "));
-
173 
-
174  if(getStatus(Charging)) strcat_P(statusOutput, PSTR("Charging"));
-
175  else if(getStatus(NotCharging)) strcat_P(statusOutput, PSTR("Not Charging"));
-
176  else if(getStatus(Shutdown)) strcat_P(statusOutput, PSTR("Shutdown"));
-
177  else if(getStatus(Dying)) strcat_P(statusOutput, PSTR("Dying"));
-
178  else if(getStatus(Low)) strcat_P(statusOutput, PSTR("Low"));
-
179  else if(getStatus(High)) strcat_P(statusOutput, PSTR("High"));
-
180  else if(getStatus(Full)) strcat_P(statusOutput, PSTR("Full"));
-
181  else strcat_P(statusOutput, PSTR("Error"));
-
182 
-
183  strcat_P(statusOutput, PSTR(" - WirelessStatus: "));
-
184 
-
185  if(getStatus(CableRumble)) strcat_P(statusOutput, PSTR("Cable - Rumble is on"));
-
186  else if(getStatus(Cable)) strcat_P(statusOutput, PSTR("Cable - Rumble is off"));
-
187  else if(getStatus(BluetoothRumble)) strcat_P(statusOutput, PSTR("Bluetooth - Rumble is on"));
-
188  else if(getStatus(Bluetooth)) strcat_P(statusOutput, PSTR("Bluetooth - Rumble is off"));
-
189  else strcat_P(statusOutput, PSTR("Error"));
-
190  } else if(PS3MoveConnected) {
-
191  strcpy_P(statusOutput, PSTR("PowerRating: "));
-
192 
-
193  if(getStatus(MoveCharging)) strcat_P(statusOutput, PSTR("Charging"));
-
194  else if(getStatus(MoveNotCharging)) strcat_P(statusOutput, PSTR("Not Charging"));
-
195  else if(getStatus(MoveShutdown)) strcat_P(statusOutput, PSTR("Shutdown"));
-
196  else if(getStatus(MoveDying)) strcat_P(statusOutput, PSTR("Dying"));
-
197  else if(getStatus(MoveLow)) strcat_P(statusOutput, PSTR("Low"));
-
198  else if(getStatus(MoveHigh)) strcat_P(statusOutput, PSTR("High"));
-
199  else if(getStatus(MoveFull)) strcat_P(statusOutput, PSTR("Full"));
-
200  else strcat_P(statusOutput, PSTR("Error"));
-
201  } else
-
202  strcpy_P(statusOutput, PSTR("Error"));
+
88  if(PS3Connected) {
+
89  // Data for the Kionix KXPC4 used in the DualShock 3
+
90  const double zeroG = 511.5; // 1.65/3.3*1023 (1.65V)
+
91  accXval = -((double)getSensor(aX) - zeroG);
+
92  accYval = -((double)getSensor(aY) - zeroG);
+
93  accZval = -((double)getSensor(aZ) - zeroG);
+
94  } else if(PS3MoveConnected) {
+
95  // It's a Kionix KXSC4 inside the Motion controller
+
96  const uint16_t zeroG = 0x8000;
+
97  accXval = -(int16_t)(getSensor(aXmove) - zeroG);
+
98  accYval = (int16_t)(getSensor(aYmove) - zeroG);
+
99  accZval = (int16_t)(getSensor(aZmove) - zeroG);
+
100  } else
+
101  return 0;
+
102 
+
103  // Convert to 360 degrees resolution
+
104  // atan2 outputs the value of -Ï€ to Ï€ (radians)
+
105  // We are then converting it to 0 to 2Ï€ and then to degrees
+
106  if(a == Pitch)
+
107  return (atan2(accYval, accZval) + PI) * RAD_TO_DEG;
+
108  else
+
109  return (atan2(accXval, accZval) + PI) * RAD_TO_DEG;
+
110 }
+
111 
+
112 double PS3BT::get9DOFValues(SensorEnum a) { // Thanks to Manfred Piendl
+
113  if(!PS3MoveConnected)
+
114  return 0;
+
115  int16_t value = getSensor(a);
+
116  if(a == mXmove || a == mYmove || a == mZmove) {
+
117  if(value > 2047)
+
118  value -= 0x1000;
+
119  return (double)value / 3.2; // unit: muT = 10^(-6) Tesla
+
120  } else if(a == aXmove || a == aYmove || a == aZmove) {
+
121  if(value < 0)
+
122  value += 0x8000;
+
123  else
+
124  value -= 0x8000;
+
125  return (double)value / 442.0; // unit: m/(s^2)
+
126  } else if(a == gXmove || a == gYmove || a == gZmove) {
+
127  if(value < 0)
+
128  value += 0x8000;
+
129  else
+
130  value -= 0x8000;
+
131  if(a == gXmove)
+
132  return (double)value / 11.6; // unit: deg/s
+
133  else if(a == gYmove)
+
134  return (double)value / 11.2; // unit: deg/s
+
135  else // gZmove
+
136  return (double)value / 9.6; // unit: deg/s
+
137  } else
+
138  return 0;
+
139 }
+
140 
+
141 String PS3BT::getTemperature() {
+
142  if(PS3MoveConnected) {
+
143  int16_t input = getSensor(tempMove);
+
144 
+
145  String output = String(input / 100);
+
146  output += ".";
+
147  if(input % 100 < 10)
+
148  output += "0";
+
149  output += String(input % 100);
+
150 
+
151  return output;
+
152  } else
+
153  return "Error";
+
154 }
+
155 
+
156 bool PS3BT::getStatus(StatusEnum c) {
+
157  return (l2capinbuf[(uint16_t)c >> 8] == ((uint8_t)c & 0xff));
+
158 }
+
159 
+
160 void PS3BT::printStatusString() {
+
161  char statusOutput[100]; // Max string length plus null character
+
162  if(PS3Connected || PS3NavigationConnected) {
+
163  strcpy_P(statusOutput, PSTR("ConnectionStatus: "));
+
164 
+
165  if(getStatus(Plugged)) strcat_P(statusOutput, PSTR("Plugged"));
+
166  else if(getStatus(Unplugged)) strcat_P(statusOutput, PSTR("Unplugged"));
+
167  else strcat_P(statusOutput, PSTR("Error"));
+
168 
+
169  strcat_P(statusOutput, PSTR(" - PowerRating: "));
+
170 
+
171  if(getStatus(Charging)) strcat_P(statusOutput, PSTR("Charging"));
+
172  else if(getStatus(NotCharging)) strcat_P(statusOutput, PSTR("Not Charging"));
+
173  else if(getStatus(Shutdown)) strcat_P(statusOutput, PSTR("Shutdown"));
+
174  else if(getStatus(Dying)) strcat_P(statusOutput, PSTR("Dying"));
+
175  else if(getStatus(Low)) strcat_P(statusOutput, PSTR("Low"));
+
176  else if(getStatus(High)) strcat_P(statusOutput, PSTR("High"));
+
177  else if(getStatus(Full)) strcat_P(statusOutput, PSTR("Full"));
+
178  else strcat_P(statusOutput, PSTR("Error"));
+
179 
+
180  strcat_P(statusOutput, PSTR(" - WirelessStatus: "));
+
181 
+
182  if(getStatus(CableRumble)) strcat_P(statusOutput, PSTR("Cable - Rumble is on"));
+
183  else if(getStatus(Cable)) strcat_P(statusOutput, PSTR("Cable - Rumble is off"));
+
184  else if(getStatus(BluetoothRumble)) strcat_P(statusOutput, PSTR("Bluetooth - Rumble is on"));
+
185  else if(getStatus(Bluetooth)) strcat_P(statusOutput, PSTR("Bluetooth - Rumble is off"));
+
186  else strcat_P(statusOutput, PSTR("Error"));
+
187  } else if(PS3MoveConnected) {
+
188  strcpy_P(statusOutput, PSTR("PowerRating: "));
+
189 
+
190  if(getStatus(MoveCharging)) strcat_P(statusOutput, PSTR("Charging"));
+
191  else if(getStatus(MoveNotCharging)) strcat_P(statusOutput, PSTR("Not Charging"));
+
192  else if(getStatus(MoveShutdown)) strcat_P(statusOutput, PSTR("Shutdown"));
+
193  else if(getStatus(MoveDying)) strcat_P(statusOutput, PSTR("Dying"));
+
194  else if(getStatus(MoveLow)) strcat_P(statusOutput, PSTR("Low"));
+
195  else if(getStatus(MoveHigh)) strcat_P(statusOutput, PSTR("High"));
+
196  else if(getStatus(MoveFull)) strcat_P(statusOutput, PSTR("Full"));
+
197  else strcat_P(statusOutput, PSTR("Error"));
+
198  } else
+
199  strcpy_P(statusOutput, PSTR("Error"));
+
200 
+
201  USB_HOST_SERIAL.write(statusOutput);
+
202 }
203 
-
204  USB_HOST_SERIAL.write(statusOutput);
-
205 }
-
206 
-
207 void PS3BT::Reset() {
-
208  PS3Connected = false;
-
209  PS3MoveConnected = false;
-
210  PS3NavigationConnected = false;
-
211  activeConnection = false;
-
212  l2cap_event_flag = 0; // Reset flags
-
213  l2cap_state = L2CAP_WAIT;
-
214 
-
215  // Needed for PS3 Dualshock Controller commands to work via Bluetooth
-
216  for(uint8_t i = 0; i < PS3_REPORT_BUFFER_SIZE; i++)
-
217  HIDBuffer[i + 2] = pgm_read_byte(&PS3_REPORT_BUFFER[i]); // First two bytes reserved for report type and ID
-
218 }
-
219 
-
220 void PS3BT::disconnect() { // Use this void to disconnect any of the controllers
-
221  // First the HID interrupt channel has to be disconnected, then the HID control channel and finally the HCI connection
-
222  pBtd->l2cap_disconnection_request(hci_handle, ++identifier, interrupt_scid, interrupt_dcid);
-
223  Reset();
-
224  l2cap_state = L2CAP_INTERRUPT_DISCONNECT;
-
225 }
-
226 
-
227 void PS3BT::ACLData(uint8_t* ACLData) {
-
228  if(!pBtd->l2capConnectionClaimed && !PS3Connected && !PS3MoveConnected && !PS3NavigationConnected && !activeConnection && !pBtd->connectToWii && !pBtd->incomingWii && !pBtd->pairWithWii) {
-
229  if(ACLData[8] == L2CAP_CMD_CONNECTION_REQUEST) {
-
230  if((ACLData[12] | (ACLData[13] << 8)) == HID_CTRL_PSM) {
-
231  pBtd->l2capConnectionClaimed = true; // Claim that the incoming connection belongs to this service
-
232  activeConnection = true;
-
233  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
-
234  l2cap_state = L2CAP_WAIT;
-
235  for(uint8_t i = 0; i < 30; i++)
-
236  remote_name[i] = pBtd->remote_name[i]; // Store the remote name for the connection
-
237 #ifdef DEBUG_USB_HOST
-
238  if(pBtd->hci_version < 3) { // Check the HCI Version of the Bluetooth dongle
-
239  Notify(PSTR("\r\nYour dongle may not support reading the analog buttons, sensors and status\r\nYour HCI Version is: "), 0x80);
-
240  Notify(pBtd->hci_version, 0x80);
-
241  Notify(PSTR("\r\nBut should be at least 3\r\nThis means that it doesn't support Bluetooth Version 2.0+EDR"), 0x80);
-
242  }
-
243 #endif
-
244  }
-
245  }
-
246  }
-
247  //if((ACLData[0] | (uint16_t)ACLData[1] << 8) == (hci_handle | 0x2000U)) { //acl_handle_ok
-
248  if(UHS_ACL_HANDLE_OK(ACLData, hci_handle)) { //acl_handle_ok
-
249  memcpy(l2capinbuf, ACLData, BULK_MAXPKTSIZE);
-
250  if((l2capinbuf[6] | (l2capinbuf[7] << 8)) == 0x0001U) { //l2cap_control - Channel ID for ACL-U
-
251  if(l2capinbuf[8] == L2CAP_CMD_COMMAND_REJECT) {
-
252 #ifdef DEBUG_USB_HOST
-
253  Notify(PSTR("\r\nL2CAP Command Rejected - Reason: "), 0x80);
-
254  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
-
255  Notify(PSTR(" "), 0x80);
-
256  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
-
257  Notify(PSTR(" Data: "), 0x80);
-
258  D_PrintHex<uint8_t > (l2capinbuf[17], 0x80);
-
259  Notify(PSTR(" "), 0x80);
-
260  D_PrintHex<uint8_t > (l2capinbuf[16], 0x80);
-
261  Notify(PSTR(" "), 0x80);
-
262  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
-
263  Notify(PSTR(" "), 0x80);
-
264  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
-
265 #endif
-
266  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
-
267 #ifdef EXTRADEBUG
-
268  Notify(PSTR("\r\nL2CAP Connection Request - PSM: "), 0x80);
-
269  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
-
270  Notify(PSTR(" "), 0x80);
-
271  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
-
272  Notify(PSTR(" SCID: "), 0x80);
-
273  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
-
274  Notify(PSTR(" "), 0x80);
-
275  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
-
276  Notify(PSTR(" Identifier: "), 0x80);
-
277  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
-
278 #endif
-
279  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_CTRL_PSM) {
-
280  identifier = l2capinbuf[9];
-
281  control_scid[0] = l2capinbuf[14];
-
282  control_scid[1] = l2capinbuf[15];
-
283  l2cap_set_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST);
-
284  } else if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_INTR_PSM) {
-
285  identifier = l2capinbuf[9];
-
286  interrupt_scid[0] = l2capinbuf[14];
-
287  interrupt_scid[1] = l2capinbuf[15];
-
288  l2cap_set_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST);
-
289  }
-
290  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_RESPONSE) {
-
291  if((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) { // Success
-
292  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
-
293  //Notify(PSTR("\r\nHID Control Configuration Complete"), 0x80);
-
294  l2cap_set_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS);
-
295  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
-
296  //Notify(PSTR("\r\nHID Interrupt Configuration Complete"), 0x80);
-
297  l2cap_set_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS);
-
298  }
-
299  }
-
300  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_REQUEST) {
-
301  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
-
302  //Notify(PSTR("\r\nHID Control Configuration Request"), 0x80);
-
303  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], control_scid);
-
304  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
-
305  //Notify(PSTR("\r\nHID Interrupt Configuration Request"), 0x80);
-
306  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], interrupt_scid);
-
307  }
-
308  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_REQUEST) {
-
309  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
-
310 #ifdef DEBUG_USB_HOST
-
311  Notify(PSTR("\r\nDisconnect Request: Control Channel"), 0x80);
-
312 #endif
-
313  identifier = l2capinbuf[9];
-
314  pBtd->l2cap_disconnection_response(hci_handle, identifier, control_dcid, control_scid);
-
315  Reset();
-
316  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
-
317 #ifdef DEBUG_USB_HOST
-
318  Notify(PSTR("\r\nDisconnect Request: Interrupt Channel"), 0x80);
-
319 #endif
-
320  identifier = l2capinbuf[9];
-
321  pBtd->l2cap_disconnection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid);
-
322  Reset();
-
323  }
-
324  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_RESPONSE) {
-
325  if(l2capinbuf[12] == control_scid[0] && l2capinbuf[13] == control_scid[1]) {
-
326  //Notify(PSTR("\r\nDisconnect Response: Control Channel"), 0x80);
-
327  identifier = l2capinbuf[9];
-
328  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE);
-
329  } else if(l2capinbuf[12] == interrupt_scid[0] && l2capinbuf[13] == interrupt_scid[1]) {
-
330  //Notify(PSTR("\r\nDisconnect Response: Interrupt Channel"), 0x80);
-
331  identifier = l2capinbuf[9];
-
332  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE);
-
333  }
-
334  }
-
335 #ifdef EXTRADEBUG
-
336  else {
-
337  Notify(PSTR("\r\nL2CAP Unknown Signaling Command: "), 0x80);
-
338  D_PrintHex<uint8_t > (l2capinbuf[8], 0x80);
-
339  }
-
340 #endif
-
341  } else if(l2capinbuf[6] == interrupt_dcid[0] && l2capinbuf[7] == interrupt_dcid[1]) { // l2cap_interrupt
-
342  //Notify(PSTR("\r\nL2CAP Interrupt"), 0x80);
-
343  if(PS3Connected || PS3MoveConnected || PS3NavigationConnected) {
-
344  /* Read Report */
-
345  if(l2capinbuf[8] == 0xA1) { // HID_THDR_DATA_INPUT
-
346  lastMessageTime = millis(); // Store the last message time
-
347 
-
348  if(PS3Connected || PS3NavigationConnected)
-
349  ButtonState = (uint32_t)(l2capinbuf[11] | ((uint16_t)l2capinbuf[12] << 8) | ((uint32_t)l2capinbuf[13] << 16));
-
350  else if(PS3MoveConnected)
-
351  ButtonState = (uint32_t)(l2capinbuf[10] | ((uint16_t)l2capinbuf[11] << 8) | ((uint32_t)l2capinbuf[12] << 16));
-
352 
-
353  //Notify(PSTR("\r\nButtonState", 0x80);
-
354  //PrintHex<uint32_t>(ButtonState, 0x80);
-
355 
-
356  if(ButtonState != OldButtonState) {
-
357  ButtonClickState = ButtonState & ~OldButtonState; // Update click state variable
-
358  OldButtonState = ButtonState;
-
359  }
-
360 
-
361 #ifdef PRINTREPORT // Uncomment "#define PRINTREPORT" to print the report send by the PS3 Controllers
-
362  for(uint8_t i = 10; i < 58; i++) {
-
363  D_PrintHex<uint8_t > (l2capinbuf[i], 0x80);
-
364  Notify(PSTR(" "), 0x80);
-
365  }
-
366  Notify(PSTR("\r\n"), 0x80);
-
367 #endif
-
368  }
-
369  }
-
370  }
-
371  L2CAP_task();
-
372  }
-
373 }
-
374 
-
375 void PS3BT::L2CAP_task() {
-
376  switch(l2cap_state) {
-
377  case L2CAP_WAIT:
-
378  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)) {
-
379 #ifdef DEBUG_USB_HOST
-
380  Notify(PSTR("\r\nHID Control Incoming Connection Request"), 0x80);
-
381 #endif
-
382  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, PENDING);
-
383  delay(1);
-
384  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, SUCCESSFUL);
-
385  identifier++;
-
386  delay(1);
-
387  pBtd->l2cap_config_request(hci_handle, identifier, control_scid);
-
388  l2cap_state = L2CAP_CONTROL_SUCCESS;
-
389  }
-
390  break;
-
391 
-
392  case L2CAP_CONTROL_SUCCESS:
-
393  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)) {
-
394 #ifdef DEBUG_USB_HOST
-
395  Notify(PSTR("\r\nHID Control Successfully Configured"), 0x80);
-
396 #endif
-
397  l2cap_state = L2CAP_INTERRUPT_SETUP;
-
398  }
-
399  break;
-
400 
-
401  case L2CAP_INTERRUPT_SETUP:
-
402  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)) {
-
403 #ifdef DEBUG_USB_HOST
-
404  Notify(PSTR("\r\nHID Interrupt Incoming Connection Request"), 0x80);
-
405 #endif
-
406  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, PENDING);
-
407  delay(1);
-
408  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, SUCCESSFUL);
-
409  identifier++;
-
410  delay(1);
-
411  pBtd->l2cap_config_request(hci_handle, identifier, interrupt_scid);
+
204 void PS3BT::Reset() {
+
205  PS3Connected = false;
+
206  PS3MoveConnected = false;
+
207  PS3NavigationConnected = false;
+
208  activeConnection = false;
+
209  l2cap_event_flag = 0; // Reset flags
+
210  l2cap_state = L2CAP_WAIT;
+
211 
+
212  // Needed for PS3 Dualshock Controller commands to work via Bluetooth
+
213  for(uint8_t i = 0; i < PS3_REPORT_BUFFER_SIZE; i++)
+
214  HIDBuffer[i + 2] = pgm_read_byte(&PS3_REPORT_BUFFER[i]); // First two bytes reserved for report type and ID
+
215 }
+
216 
+
217 void PS3BT::disconnect() { // Use this void to disconnect any of the controllers
+
218  // First the HID interrupt channel has to be disconnected, then the HID control channel and finally the HCI connection
+
219  pBtd->l2cap_disconnection_request(hci_handle, ++identifier, interrupt_scid, interrupt_dcid);
+
220  Reset();
+
221  l2cap_state = L2CAP_INTERRUPT_DISCONNECT;
+
222 }
+
223 
+
224 void PS3BT::ACLData(uint8_t* ACLData) {
+
225  if(!pBtd->l2capConnectionClaimed && !PS3Connected && !PS3MoveConnected && !PS3NavigationConnected && !activeConnection && !pBtd->connectToWii && !pBtd->incomingWii && !pBtd->pairWithWii) {
+
226  if(ACLData[8] == L2CAP_CMD_CONNECTION_REQUEST) {
+
227  if((ACLData[12] | (ACLData[13] << 8)) == HID_CTRL_PSM) {
+
228  pBtd->l2capConnectionClaimed = true; // Claim that the incoming connection belongs to this service
+
229  activeConnection = true;
+
230  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
+
231  l2cap_state = L2CAP_WAIT;
+
232  remote_name_first = pBtd->remote_name[0]; // Store the first letter in remote name for the connection
+
233 #ifdef DEBUG_USB_HOST
+
234  if(pBtd->hci_version < 3) { // Check the HCI Version of the Bluetooth dongle
+
235  Notify(PSTR("\r\nYour dongle may not support reading the analog buttons, sensors and status\r\nYour HCI Version is: "), 0x80);
+
236  Notify(pBtd->hci_version, 0x80);
+
237  Notify(PSTR("\r\nBut should be at least 3\r\nThis means that it doesn't support Bluetooth Version 2.0+EDR"), 0x80);
+
238  }
+
239 #endif
+
240  }
+
241  }
+
242  }
+
243 
+
244  if(checkHciHandle(ACLData, hci_handle)) { // acl_handle_ok
+
245  memcpy(l2capinbuf, ACLData, BULK_MAXPKTSIZE);
+
246  if((l2capinbuf[6] | (l2capinbuf[7] << 8)) == 0x0001U) { // l2cap_control - Channel ID for ACL-U
+
247  if(l2capinbuf[8] == L2CAP_CMD_COMMAND_REJECT) {
+
248 #ifdef DEBUG_USB_HOST
+
249  Notify(PSTR("\r\nL2CAP Command Rejected - Reason: "), 0x80);
+
250  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
+
251  Notify(PSTR(" "), 0x80);
+
252  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
+
253  Notify(PSTR(" Data: "), 0x80);
+
254  D_PrintHex<uint8_t > (l2capinbuf[17], 0x80);
+
255  Notify(PSTR(" "), 0x80);
+
256  D_PrintHex<uint8_t > (l2capinbuf[16], 0x80);
+
257  Notify(PSTR(" "), 0x80);
+
258  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
+
259  Notify(PSTR(" "), 0x80);
+
260  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
+
261 #endif
+
262  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
+
263 #ifdef EXTRADEBUG
+
264  Notify(PSTR("\r\nL2CAP Connection Request - PSM: "), 0x80);
+
265  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
+
266  Notify(PSTR(" "), 0x80);
+
267  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
+
268  Notify(PSTR(" SCID: "), 0x80);
+
269  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
+
270  Notify(PSTR(" "), 0x80);
+
271  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
+
272  Notify(PSTR(" Identifier: "), 0x80);
+
273  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
+
274 #endif
+
275  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_CTRL_PSM) {
+
276  identifier = l2capinbuf[9];
+
277  control_scid[0] = l2capinbuf[14];
+
278  control_scid[1] = l2capinbuf[15];
+
279  l2cap_set_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST);
+
280  } else if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_INTR_PSM) {
+
281  identifier = l2capinbuf[9];
+
282  interrupt_scid[0] = l2capinbuf[14];
+
283  interrupt_scid[1] = l2capinbuf[15];
+
284  l2cap_set_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST);
+
285  }
+
286  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_RESPONSE) {
+
287  if((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) { // Success
+
288  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
+
289  //Notify(PSTR("\r\nHID Control Configuration Complete"), 0x80);
+
290  l2cap_set_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS);
+
291  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
+
292  //Notify(PSTR("\r\nHID Interrupt Configuration Complete"), 0x80);
+
293  l2cap_set_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS);
+
294  }
+
295  }
+
296  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_REQUEST) {
+
297  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
+
298  //Notify(PSTR("\r\nHID Control Configuration Request"), 0x80);
+
299  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], control_scid);
+
300  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
+
301  //Notify(PSTR("\r\nHID Interrupt Configuration Request"), 0x80);
+
302  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], interrupt_scid);
+
303  }
+
304  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_REQUEST) {
+
305  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
+
306 #ifdef DEBUG_USB_HOST
+
307  Notify(PSTR("\r\nDisconnect Request: Control Channel"), 0x80);
+
308 #endif
+
309  identifier = l2capinbuf[9];
+
310  pBtd->l2cap_disconnection_response(hci_handle, identifier, control_dcid, control_scid);
+
311  Reset();
+
312  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
+
313 #ifdef DEBUG_USB_HOST
+
314  Notify(PSTR("\r\nDisconnect Request: Interrupt Channel"), 0x80);
+
315 #endif
+
316  identifier = l2capinbuf[9];
+
317  pBtd->l2cap_disconnection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid);
+
318  Reset();
+
319  }
+
320  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_RESPONSE) {
+
321  if(l2capinbuf[12] == control_scid[0] && l2capinbuf[13] == control_scid[1]) {
+
322  //Notify(PSTR("\r\nDisconnect Response: Control Channel"), 0x80);
+
323  identifier = l2capinbuf[9];
+
324  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE);
+
325  } else if(l2capinbuf[12] == interrupt_scid[0] && l2capinbuf[13] == interrupt_scid[1]) {
+
326  //Notify(PSTR("\r\nDisconnect Response: Interrupt Channel"), 0x80);
+
327  identifier = l2capinbuf[9];
+
328  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE);
+
329  }
+
330  }
+
331 #ifdef EXTRADEBUG
+
332  else {
+
333  Notify(PSTR("\r\nL2CAP Unknown Signaling Command: "), 0x80);
+
334  D_PrintHex<uint8_t > (l2capinbuf[8], 0x80);
+
335  }
+
336 #endif
+
337  } else if(l2capinbuf[6] == interrupt_dcid[0] && l2capinbuf[7] == interrupt_dcid[1]) { // l2cap_interrupt
+
338  //Notify(PSTR("\r\nL2CAP Interrupt"), 0x80);
+
339  if(PS3Connected || PS3MoveConnected || PS3NavigationConnected) {
+
340  /* Read Report */
+
341  if(l2capinbuf[8] == 0xA1) { // HID_THDR_DATA_INPUT
+
342  lastMessageTime = millis(); // Store the last message time
+
343 
+
344  if(PS3Connected || PS3NavigationConnected)
+
345  ButtonState = (uint32_t)(l2capinbuf[11] | ((uint16_t)l2capinbuf[12] << 8) | ((uint32_t)l2capinbuf[13] << 16));
+
346  else if(PS3MoveConnected)
+
347  ButtonState = (uint32_t)(l2capinbuf[10] | ((uint16_t)l2capinbuf[11] << 8) | ((uint32_t)l2capinbuf[12] << 16));
+
348 
+
349  //Notify(PSTR("\r\nButtonState", 0x80);
+
350  //PrintHex<uint32_t>(ButtonState, 0x80);
+
351 
+
352  if(ButtonState != OldButtonState) {
+
353  ButtonClickState = ButtonState & ~OldButtonState; // Update click state variable
+
354  OldButtonState = ButtonState;
+
355  }
+
356 
+
357 #ifdef PRINTREPORT // Uncomment "#define PRINTREPORT" to print the report send by the PS3 Controllers
+
358  for(uint8_t i = 10; i < 58; i++) {
+
359  D_PrintHex<uint8_t > (l2capinbuf[i], 0x80);
+
360  Notify(PSTR(" "), 0x80);
+
361  }
+
362  Notify(PSTR("\r\n"), 0x80);
+
363 #endif
+
364  }
+
365  }
+
366  }
+
367  L2CAP_task();
+
368  }
+
369 }
+
370 
+
371 void PS3BT::L2CAP_task() {
+
372  switch(l2cap_state) {
+
373  case L2CAP_WAIT:
+
374  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)) {
+
375 #ifdef DEBUG_USB_HOST
+
376  Notify(PSTR("\r\nHID Control Incoming Connection Request"), 0x80);
+
377 #endif
+
378  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, PENDING);
+
379  delay(1);
+
380  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, SUCCESSFUL);
+
381  identifier++;
+
382  delay(1);
+
383  pBtd->l2cap_config_request(hci_handle, identifier, control_scid);
+
384  l2cap_state = L2CAP_CONTROL_SUCCESS;
+
385  }
+
386  break;
+
387 
+
388  case L2CAP_CONTROL_SUCCESS:
+
389  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)) {
+
390 #ifdef DEBUG_USB_HOST
+
391  Notify(PSTR("\r\nHID Control Successfully Configured"), 0x80);
+
392 #endif
+
393  l2cap_state = L2CAP_INTERRUPT_SETUP;
+
394  }
+
395  break;
+
396 
+
397  case L2CAP_INTERRUPT_SETUP:
+
398  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)) {
+
399 #ifdef DEBUG_USB_HOST
+
400  Notify(PSTR("\r\nHID Interrupt Incoming Connection Request"), 0x80);
+
401 #endif
+
402  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, PENDING);
+
403  delay(1);
+
404  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, SUCCESSFUL);
+
405  identifier++;
+
406  delay(1);
+
407  pBtd->l2cap_config_request(hci_handle, identifier, interrupt_scid);
+
408 
+
409  l2cap_state = L2CAP_INTERRUPT_CONFIG_REQUEST;
+
410  }
+
411  break;
412 
-
413  l2cap_state = L2CAP_INTERRUPT_CONFIG_REQUEST;
-
414  }
-
415  break;
-
416 
-
417  case L2CAP_INTERRUPT_CONFIG_REQUEST:
-
418  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)) { // Now the HID channels is established
-
419 #ifdef DEBUG_USB_HOST
-
420  Notify(PSTR("\r\nHID Interrupt Successfully Configured"), 0x80);
-
421 #endif
-
422  if(remote_name[0] == 'M') { // First letter in Motion Controller ('M')
-
423  memset(l2capinbuf, 0, BULK_MAXPKTSIZE); // Reset l2cap in buffer as it sometimes read it as a button has been pressed
-
424  l2cap_state = TURN_ON_LED;
-
425  } else
-
426  l2cap_state = PS3_ENABLE_SIXAXIS;
-
427  timer = millis();
-
428  }
-
429  break;
-
430 
-
431  /* These states are handled in Run() */
-
432 
-
433  case L2CAP_INTERRUPT_DISCONNECT:
-
434  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)) {
-
435 #ifdef DEBUG_USB_HOST
-
436  Notify(PSTR("\r\nDisconnected Interrupt Channel"), 0x80);
-
437 #endif
-
438  identifier++;
-
439  pBtd->l2cap_disconnection_request(hci_handle, identifier, control_scid, control_dcid);
-
440  l2cap_state = L2CAP_CONTROL_DISCONNECT;
-
441  }
-
442  break;
-
443 
-
444  case L2CAP_CONTROL_DISCONNECT:
-
445  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)) {
-
446 #ifdef DEBUG_USB_HOST
-
447  Notify(PSTR("\r\nDisconnected Control Channel"), 0x80);
-
448 #endif
-
449  pBtd->hci_disconnect(hci_handle);
-
450  hci_handle = -1; // Reset handle
-
451  l2cap_event_flag = 0; // Reset flags
-
452  l2cap_state = L2CAP_WAIT;
-
453  }
-
454  break;
-
455  }
-
456 }
-
457 
-
458 void PS3BT::Run() {
-
459  switch(l2cap_state) {
-
460  case PS3_ENABLE_SIXAXIS:
-
461  if(millis() - timer > 1000) { // loop 1 second before sending the command
-
462  memset(l2capinbuf, 0, BULK_MAXPKTSIZE); // Reset l2cap in buffer as it sometimes read it as a button has been pressed
-
463  for(uint8_t i = 15; i < 19; i++)
-
464  l2capinbuf[i] = 0x7F; // Set the analog joystick values to center position
-
465  enable_sixaxis();
-
466  l2cap_state = TURN_ON_LED;
-
467  timer = millis();
-
468  }
-
469  break;
-
470 
-
471  case TURN_ON_LED:
-
472  if(millis() - timer > 1000) { // loop 1 second before sending the command
-
473  if(remote_name[0] == 'P') { // First letter in PLAYSTATION(R)3 Controller ('P')
-
474 #ifdef DEBUG_USB_HOST
-
475  Notify(PSTR("\r\nDualshock 3 Controller Enabled\r\n"), 0x80);
-
476 #endif
-
477  PS3Connected = true;
-
478  } else if(remote_name[0] == 'N') { // First letter in Navigation Controller ('N')
-
479 #ifdef DEBUG_USB_HOST
-
480  Notify(PSTR("\r\nNavigation Controller Enabled\r\n"), 0x80);
-
481 #endif
-
482  PS3NavigationConnected = true;
-
483  } else if(remote_name[0] == 'M') { // First letter in Motion Controller ('M')
-
484  timerBulbRumble = millis();
-
485 #ifdef DEBUG_USB_HOST
-
486  Notify(PSTR("\r\nMotion Controller Enabled\r\n"), 0x80);
-
487 #endif
-
488  PS3MoveConnected = true;
-
489  }
-
490  ButtonState = 0; // Clear all values
-
491  OldButtonState = 0;
-
492  ButtonClickState = 0;
-
493 
-
494  onInit(); // Turn on the LED on the controller
-
495  l2cap_state = L2CAP_DONE;
-
496  }
-
497  break;
-
498 
-
499  case L2CAP_DONE:
-
500  if(PS3MoveConnected) { // The Bulb and rumble values, has to be send at aproximatly every 5th second for it to stay on
-
501  if(millis() - timerBulbRumble > 4000) { // Send at least every 4th second
-
502  HIDMove_Command(HIDMoveBuffer, HID_BUFFERSIZE); // The Bulb and rumble values, has to be written again and again, for it to stay turned on
-
503  timerBulbRumble = millis();
-
504  }
-
505  }
-
506  break;
-
507  }
-
508 }
+
413  case L2CAP_INTERRUPT_CONFIG_REQUEST:
+
414  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)) { // Now the HID channels is established
+
415 #ifdef DEBUG_USB_HOST
+
416  Notify(PSTR("\r\nHID Interrupt Successfully Configured"), 0x80);
+
417 #endif
+
418  if(remote_name_first == 'M') { // First letter in Motion Controller ('M')
+
419  memset(l2capinbuf, 0, BULK_MAXPKTSIZE); // Reset l2cap in buffer as it sometimes read it as a button has been pressed
+
420  l2cap_state = TURN_ON_LED;
+
421  } else
+
422  l2cap_state = PS3_ENABLE_SIXAXIS;
+
423  timer = millis();
+
424  }
+
425  break;
+
426 
+
427  /* These states are handled in Run() */
+
428 
+
429  case L2CAP_INTERRUPT_DISCONNECT:
+
430  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)) {
+
431 #ifdef DEBUG_USB_HOST
+
432  Notify(PSTR("\r\nDisconnected Interrupt Channel"), 0x80);
+
433 #endif
+
434  identifier++;
+
435  pBtd->l2cap_disconnection_request(hci_handle, identifier, control_scid, control_dcid);
+
436  l2cap_state = L2CAP_CONTROL_DISCONNECT;
+
437  }
+
438  break;
+
439 
+
440  case L2CAP_CONTROL_DISCONNECT:
+
441  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)) {
+
442 #ifdef DEBUG_USB_HOST
+
443  Notify(PSTR("\r\nDisconnected Control Channel"), 0x80);
+
444 #endif
+
445  pBtd->hci_disconnect(hci_handle);
+
446  hci_handle = -1; // Reset handle
+
447  l2cap_event_flag = 0; // Reset flags
+
448  l2cap_state = L2CAP_WAIT;
+
449  }
+
450  break;
+
451  }
+
452 }
+
453 
+
454 void PS3BT::Run() {
+
455  switch(l2cap_state) {
+
456  case PS3_ENABLE_SIXAXIS:
+
457  if(millis() - timer > 1000) { // loop 1 second before sending the command
+
458  memset(l2capinbuf, 0, BULK_MAXPKTSIZE); // Reset l2cap in buffer as it sometimes read it as a button has been pressed
+
459  for(uint8_t i = 15; i < 19; i++)
+
460  l2capinbuf[i] = 0x7F; // Set the analog joystick values to center position
+
461  enable_sixaxis();
+
462  l2cap_state = TURN_ON_LED;
+
463  timer = millis();
+
464  }
+
465  break;
+
466 
+
467  case TURN_ON_LED:
+
468  if(millis() - timer > 1000) { // loop 1 second before sending the command
+
469  if(remote_name_first == 'P') { // First letter in PLAYSTATION(R)3 Controller ('P')
+
470 #ifdef DEBUG_USB_HOST
+
471  Notify(PSTR("\r\nDualshock 3 Controller Enabled\r\n"), 0x80);
+
472 #endif
+
473  PS3Connected = true;
+
474  } else if(remote_name_first == 'N') { // First letter in Navigation Controller ('N')
+
475 #ifdef DEBUG_USB_HOST
+
476  Notify(PSTR("\r\nNavigation Controller Enabled\r\n"), 0x80);
+
477 #endif
+
478  PS3NavigationConnected = true;
+
479  } else if(remote_name_first == 'M') { // First letter in Motion Controller ('M')
+
480  timer = millis();
+
481 #ifdef DEBUG_USB_HOST
+
482  Notify(PSTR("\r\nMotion Controller Enabled\r\n"), 0x80);
+
483 #endif
+
484  PS3MoveConnected = true;
+
485  }
+
486  ButtonState = 0; // Clear all values
+
487  OldButtonState = 0;
+
488  ButtonClickState = 0;
+
489 
+
490  onInit(); // Turn on the LED on the controller
+
491  l2cap_state = L2CAP_DONE;
+
492  }
+
493  break;
+
494 
+
495  case L2CAP_DONE:
+
496  if(PS3MoveConnected) { // The Bulb and rumble values, has to be send at approximately every 5th second for it to stay on
+
497  if(millis() - timer > 4000) { // Send at least every 4th second
+
498  HIDMove_Command(HIDMoveBuffer, HID_BUFFERSIZE); // The Bulb and rumble values, has to be written again and again, for it to stay turned on
+
499  timer = millis();
+
500  }
+
501  }
+
502  break;
+
503  }
+
504 }
+
505 
+
506 /************************************************************/
+
507 /* HID Commands */
+
508 /************************************************************/
509 
-
510 /************************************************************/
-
511 /* HID Commands */
-
512 /************************************************************/
-
513 
-
514 // Playstation Sixaxis Dualshock and Navigation Controller commands
-
515 
-
516 void PS3BT::HID_Command(uint8_t* data, uint8_t nbytes) {
-
517  if(millis() - timerHID <= 150) // Check if is has been more than 150ms since last command
-
518  delay((uint32_t)(150 - (millis() - timerHID))); // There have to be a delay between commands
-
519  pBtd->L2CAP_Command(hci_handle, data, nbytes, control_scid[0], control_scid[1]); // Both the Navigation and Dualshock controller sends data via the control channel
-
520  timerHID = millis();
-
521 }
-
522 
-
523 void PS3BT::setAllOff() {
-
524  HIDBuffer[3] = 0x00; // Rumble bytes
-
525  HIDBuffer[4] = 0x00;
-
526  HIDBuffer[5] = 0x00;
-
527  HIDBuffer[6] = 0x00;
-
528 
-
529  HIDBuffer[11] = 0x00; // LED byte
-
530 
-
531  HID_Command(HIDBuffer, HID_BUFFERSIZE);
-
532 }
-
533 
-
534 void PS3BT::setRumbleOff() {
-
535  HIDBuffer[3] = 0x00;
-
536  HIDBuffer[4] = 0x00;
-
537  HIDBuffer[5] = 0x00;
-
538  HIDBuffer[6] = 0x00;
-
539 
-
540  HID_Command(HIDBuffer, HID_BUFFERSIZE);
-
541 }
-
542 
-
543 void PS3BT::setRumbleOn(RumbleEnum mode) {
-
544  uint8_t power[2] = {0xff, 0x00}; // Defaults to RumbleLow
-
545  if(mode == RumbleHigh) {
-
546  power[0] = 0x00;
-
547  power[1] = 0xff;
-
548  }
-
549  setRumbleOn(0xfe, power[0], 0xfe, power[1]);
-
550 }
-
551 
-
552 void PS3BT::setRumbleOn(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower) {
-
553  HIDBuffer[3] = rightDuration;
-
554  HIDBuffer[4] = rightPower;
-
555  HIDBuffer[5] = leftDuration;
-
556  HIDBuffer[6] = leftPower;
-
557  HID_Command(HIDBuffer, HID_BUFFERSIZE);
-
558 }
-
559 
-
560 void PS3BT::setLedRaw(uint8_t value) {
-
561  HIDBuffer[11] = value << 1;
-
562  HID_Command(HIDBuffer, HID_BUFFERSIZE);
-
563 }
-
564 
-
565 void PS3BT::setLedOff(LEDEnum a) {
-
566  HIDBuffer[11] &= ~((uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1));
-
567  HID_Command(HIDBuffer, HID_BUFFERSIZE);
-
568 }
-
569 
-
570 void PS3BT::setLedOn(LEDEnum a) {
-
571  if(a == OFF)
-
572  setLedRaw(0);
-
573  else {
-
574  HIDBuffer[11] |= (uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1);
-
575  HID_Command(HIDBuffer, HID_BUFFERSIZE);
-
576  }
-
577 }
-
578 
-
579 void PS3BT::setLedToggle(LEDEnum a) {
-
580  HIDBuffer[11] ^= (uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1);
-
581  HID_Command(HIDBuffer, HID_BUFFERSIZE);
-
582 }
-
583 
-
584 void PS3BT::enable_sixaxis() { // Command used to enable the Dualshock 3 and Navigation controller to send data via Bluetooth
-
585  uint8_t cmd_buf[6];
-
586  cmd_buf[0] = 0x53; // HID BT Set_report (0x50) | Report Type (Feature 0x03)
-
587  cmd_buf[1] = 0xF4; // Report ID
-
588  cmd_buf[2] = 0x42; // Special PS3 Controller enable commands
-
589  cmd_buf[3] = 0x03;
-
590  cmd_buf[4] = 0x00;
-
591  cmd_buf[5] = 0x00;
-
592 
-
593  HID_Command(cmd_buf, 6);
-
594 }
-
595 
-
596 // Playstation Move Controller commands
-
597 
-
598 void PS3BT::HIDMove_Command(uint8_t* data, uint8_t nbytes) {
-
599  if(millis() - timerHID <= 150)// Check if is has been less than 150ms since last command
-
600  delay((uint32_t)(150 - (millis() - timerHID))); // There have to be a delay between commands
-
601  pBtd->L2CAP_Command(hci_handle, data, nbytes, interrupt_scid[0], interrupt_scid[1]); // The Move controller sends it's data via the intterrupt channel
-
602  timerHID = millis();
-
603 }
-
604 
-
605 void PS3BT::moveSetBulb(uint8_t r, uint8_t g, uint8_t b) { // Use this to set the Color using RGB values
-
606  // Set the Bulb's values into the write buffer
-
607  HIDMoveBuffer[3] = r;
-
608  HIDMoveBuffer[4] = g;
-
609  HIDMoveBuffer[5] = b;
-
610 
-
611  HIDMove_Command(HIDMoveBuffer, HID_BUFFERSIZE);
+
510 // Playstation Sixaxis Dualshock and Navigation Controller commands
+
511 
+
512 void PS3BT::HID_Command(uint8_t* data, uint8_t nbytes) {
+
513  if(millis() - timerHID <= 150) // Check if is has been more than 150ms since last command
+
514  delay((uint32_t)(150 - (millis() - timerHID))); // There have to be a delay between commands
+
515  pBtd->L2CAP_Command(hci_handle, data, nbytes, control_scid[0], control_scid[1]); // Both the Navigation and Dualshock controller sends data via the control channel
+
516  timerHID = millis();
+
517 }
+
518 
+
519 void PS3BT::setAllOff() {
+
520  HIDBuffer[3] = 0x00; // Rumble bytes
+
521  HIDBuffer[4] = 0x00;
+
522  HIDBuffer[5] = 0x00;
+
523  HIDBuffer[6] = 0x00;
+
524 
+
525  HIDBuffer[11] = 0x00; // LED byte
+
526 
+
527  HID_Command(HIDBuffer, HID_BUFFERSIZE);
+
528 }
+
529 
+
530 void PS3BT::setRumbleOff() {
+
531  HIDBuffer[3] = 0x00;
+
532  HIDBuffer[4] = 0x00;
+
533  HIDBuffer[5] = 0x00;
+
534  HIDBuffer[6] = 0x00;
+
535 
+
536  HID_Command(HIDBuffer, HID_BUFFERSIZE);
+
537 }
+
538 
+
539 void PS3BT::setRumbleOn(RumbleEnum mode) {
+
540  uint8_t power[2] = {0xff, 0x00}; // Defaults to RumbleLow
+
541  if(mode == RumbleHigh) {
+
542  power[0] = 0x00;
+
543  power[1] = 0xff;
+
544  }
+
545  setRumbleOn(0xfe, power[0], 0xfe, power[1]);
+
546 }
+
547 
+
548 void PS3BT::setRumbleOn(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower) {
+
549  HIDBuffer[3] = rightDuration;
+
550  HIDBuffer[4] = rightPower;
+
551  HIDBuffer[5] = leftDuration;
+
552  HIDBuffer[6] = leftPower;
+
553  HID_Command(HIDBuffer, HID_BUFFERSIZE);
+
554 }
+
555 
+
556 void PS3BT::setLedRaw(uint8_t value) {
+
557  HIDBuffer[11] = value << 1;
+
558  HID_Command(HIDBuffer, HID_BUFFERSIZE);
+
559 }
+
560 
+
561 void PS3BT::setLedOff(LEDEnum a) {
+
562  HIDBuffer[11] &= ~((uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1));
+
563  HID_Command(HIDBuffer, HID_BUFFERSIZE);
+
564 }
+
565 
+
566 void PS3BT::setLedOn(LEDEnum a) {
+
567  if(a == OFF)
+
568  setLedRaw(0);
+
569  else {
+
570  HIDBuffer[11] |= (uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1);
+
571  HID_Command(HIDBuffer, HID_BUFFERSIZE);
+
572  }
+
573 }
+
574 
+
575 void PS3BT::setLedToggle(LEDEnum a) {
+
576  HIDBuffer[11] ^= (uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1);
+
577  HID_Command(HIDBuffer, HID_BUFFERSIZE);
+
578 }
+
579 
+
580 void PS3BT::enable_sixaxis() { // Command used to enable the Dualshock 3 and Navigation controller to send data via Bluetooth
+
581  uint8_t cmd_buf[6];
+
582  cmd_buf[0] = 0x53; // HID BT Set_report (0x50) | Report Type (Feature 0x03)
+
583  cmd_buf[1] = 0xF4; // Report ID
+
584  cmd_buf[2] = 0x42; // Special PS3 Controller enable commands
+
585  cmd_buf[3] = 0x03;
+
586  cmd_buf[4] = 0x00;
+
587  cmd_buf[5] = 0x00;
+
588 
+
589  HID_Command(cmd_buf, 6);
+
590 }
+
591 
+
592 // Playstation Move Controller commands
+
593 
+
594 void PS3BT::HIDMove_Command(uint8_t* data, uint8_t nbytes) {
+
595  if(millis() - timerHID <= 150)// Check if is has been less than 150ms since last command
+
596  delay((uint32_t)(150 - (millis() - timerHID))); // There have to be a delay between commands
+
597  pBtd->L2CAP_Command(hci_handle, data, nbytes, interrupt_scid[0], interrupt_scid[1]); // The Move controller sends it's data via the intterrupt channel
+
598  timerHID = millis();
+
599 }
+
600 
+
601 void PS3BT::moveSetBulb(uint8_t r, uint8_t g, uint8_t b) { // Use this to set the Color using RGB values
+
602  // Set the Bulb's values into the write buffer
+
603  HIDMoveBuffer[3] = r;
+
604  HIDMoveBuffer[4] = g;
+
605  HIDMoveBuffer[5] = b;
+
606 
+
607  HIDMove_Command(HIDMoveBuffer, HID_BUFFERSIZE);
+
608 }
+
609 
+
610 void PS3BT::moveSetBulb(ColorsEnum color) { // Use this to set the Color using the predefined colors in enum
+
611  moveSetBulb((uint8_t)(color >> 16), (uint8_t)(color >> 8), (uint8_t)(color));
612 }
613 
-
614 void PS3BT::moveSetBulb(ColorsEnum color) { // Use this to set the Color using the predefined colors in enum
-
615  moveSetBulb((uint8_t)(color >> 16), (uint8_t)(color >> 8), (uint8_t)(color));
-
616 }
-
617 
-
618 void PS3BT::moveSetRumble(uint8_t rumble) {
-
619 #ifdef DEBUG_USB_HOST
-
620  if(rumble < 64 && rumble != 0) // The rumble value has to at least 64, or approximately 25% (64/255*100)
-
621  Notify(PSTR("\r\nThe rumble value has to at least 64, or approximately 25%"), 0x80);
-
622 #endif
-
623  // Set the rumble value into the write buffer
-
624  HIDMoveBuffer[7] = rumble;
-
625 
-
626  HIDMove_Command(HIDMoveBuffer, HID_BUFFERSIZE);
-
627 }
-
628 
-
629 void PS3BT::onInit() {
-
630  if(pFuncOnInit)
-
631  pFuncOnInit(); // Call the user function
-
632  else {
-
633  if(PS3MoveConnected)
-
634  moveSetBulb(Red);
-
635  else // Dualshock 3 or Navigation controller
-
636  setLedOn(LED1);
-
637  }
-
638 }
-
#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE
Definition: BTD.h:139
-
bool incomingWii
Definition: BTD.h:507
-
#define UHS_ACL_HANDLE_OK(x, y)
Definition: BTD.h:207
+
614 void PS3BT::moveSetRumble(uint8_t rumble) {
+
615 #ifdef DEBUG_USB_HOST
+
616  if(rumble < 64 && rumble != 0) // The rumble value has to at least 64, or approximately 25% (64/255*100)
+
617  Notify(PSTR("\r\nThe rumble value has to at least 64, or approximately 25%"), 0x80);
+
618 #endif
+
619  // Set the rumble value into the write buffer
+
620  HIDMoveBuffer[7] = rumble;
+
621 
+
622  HIDMove_Command(HIDMoveBuffer, HID_BUFFERSIZE);
+
623 }
+
624 
+
625 void PS3BT::onInit() {
+
626  if(pFuncOnInit)
+
627  pFuncOnInit(); // Call the user function
+
628  else {
+
629  if(PS3MoveConnected)
+
630  moveSetBulb(Red);
+
631  else // Dualshock 3 or Navigation controller
+
632  setLedOn(LED1);
+
633  }
+
634 }
+
#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE
Definition: BTD.h:137
+
bool incomingWii
Definition: BTD.h:471
Definition: PS3Enums.h:124
Definition: PS3Enums.h:117
-
bool PS3NavigationConnected
Definition: PS3BT.h:201
+
#define pgm_read_dword(addr)
+
bool PS3NavigationConnected
Definition: PS3BT.h:184
Definition: PS3Enums.h:131
-
#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS
Definition: BTD.h:143
-
#define L2CAP_INTERRUPT_CONFIG_REQUEST
Definition: BTD.h:115
-
#define L2CAP_INTERRUPT_SETUP
Definition: BTD.h:113
-
bool getStatus(StatusEnum c)
Definition: PS3BT.cpp:159
-
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1231
-
virtual void Run()
Definition: PS3BT.cpp:458
-
#define SUCCESSFUL
Definition: BTD.h:177
-
#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST
Definition: BTD.h:142
-
Definition: BTD.h:230
+
#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS
Definition: BTD.h:141
+
#define L2CAP_INTERRUPT_CONFIG_REQUEST
Definition: BTD.h:113
+
#define L2CAP_INTERRUPT_SETUP
Definition: BTD.h:111
+
bool getStatus(StatusEnum c)
Definition: PS3BT.cpp:156
+
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1239
+
void Run()
Definition: PS3BT.cpp:454
+
#define SUCCESSFUL
Definition: BTD.h:175
+
#define strcpy_P(dest, src)
+
#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST
Definition: BTD.h:140
+
Definition: BTD.h:198
-
void setLedOn(LEDEnum a)
Definition: PS3BT.cpp:570
-
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1284
+
void setLedOn(LEDEnum a)
Definition: PS3BT.cpp:566
+
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1292
Definition: PS3Enums.h:127
Definition: PS3Enums.h:135
-
uint8_t hci_version
Definition: BTD.h:497
+
uint8_t hci_version
Definition: BTD.h:461
-
bool pairWithWii
Definition: BTD.h:509
+
bool pairWithWii
Definition: BTD.h:473
+
uint8_t identifier
Definition: BTD.h:615
Definition: PS3Enums.h:138
-
String getTemperature()
Definition: PS3BT.cpp:144
+
String getTemperature()
Definition: PS3BT.cpp:141
AnalogHatEnum
-
void moveSetRumble(uint8_t rumble)
Definition: PS3BT.cpp:618
-
#define TURN_ON_LED
Definition: BTD.h:129
+
void moveSetRumble(uint8_t rumble)
Definition: PS3BT.cpp:614
+
#define TURN_ON_LED
Definition: BTD.h:127
-
void printStatusString()
Definition: PS3BT.cpp:163
-
void setAllOff()
Definition: PS3BT.cpp:523
+
void printStatusString()
Definition: PS3BT.cpp:160
+
void setAllOff()
Definition: PS3BT.cpp:519
-
#define L2CAP_DONE
Definition: BTD.h:104
+
#define L2CAP_DONE
Definition: BTD.h:102
Definition: PS3Enums.h:121
Definition: PS3Enums.h:119
-
#define L2CAP_CONTROL_SUCCESS
Definition: BTD.h:109
-
#define L2CAP_WAIT
Definition: BTD.h:103
+
#define L2CAP_CONTROL_SUCCESS
Definition: BTD.h:107
+
#define L2CAP_WAIT
Definition: BTD.h:101
StatusEnum
Definition: PS3Enums.h:113
#define HID_BUFFERSIZE
Definition: PS3BT.h:24
-
virtual void Reset()
Definition: PS3BT.cpp:207
+
void Reset()
Definition: PS3BT.cpp:204
+
#define pgm_read_byte(addr)
-
char remote_name[30]
Definition: BTD.h:491
+
char remote_name[30]
Definition: BTD.h:455
const uint32_t PS3_BUTTONS[]
Definition: PS3Enums.h:62
-
bool getButtonPress(ButtonEnum b)
Definition: PS3BT.cpp:52
+
bool getButtonPress(ButtonEnum b)
Definition: PS3BT.cpp:49
LEDEnum
-
int16_t getSensor(SensorEnum a)
Definition: PS3BT.cpp:71
-
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1297
+
int16_t getSensor(SensorEnum a)
Definition: PS3BT.cpp:68
+
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1305
#define Notify(...)
Definition: message.h:44
-
double getAngle(AngleEnum a)
Definition: PS3BT.cpp:88
+
double getAngle(AngleEnum a)
Definition: PS3BT.cpp:85
RumbleEnum
#define USB_HOST_SERIAL
Definition: settings.h:34
-
#define HID_CTRL_PSM
Definition: BTD.h:182
+
#define HID_CTRL_PSM
Definition: BTD.h:180
Definition: PS3Enums.h:122
Definition: PS3Enums.h:123
-
bool connectToWii
Definition: BTD.h:503
+
bool connectToWii
Definition: BTD.h:467
-
uint8_t getAnalogHat(AnalogHatEnum a)
Definition: PS3BT.cpp:67
-
uint16_t hci_handle
Definition: BTD.h:487
-
bool PS3Connected
Definition: PS3BT.h:193
-
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1142
-
#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE
Definition: BTD.h:145
+
uint8_t getAnalogHat(AnalogHatEnum a)
Definition: PS3BT.cpp:64
+
uint16_t hci_handle
Definition: BTD.h:451
+
bool PS3Connected
Definition: PS3BT.h:176
+
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1150
+
Definition: BTD.h:563
+
#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE
Definition: BTD.h:143
ButtonEnum
-
void moveSetBulb(uint8_t r, uint8_t g, uint8_t b)
Definition: PS3BT.cpp:605
-
bool PS3MoveConnected
Definition: PS3BT.h:199
-
uint8_t my_bdaddr[6]
Definition: BTD.h:485
+
void moveSetBulb(uint8_t r, uint8_t g, uint8_t b)
Definition: PS3BT.cpp:601
+
bool PS3MoveConnected
Definition: PS3BT.h:182
+
uint8_t my_bdaddr[6]
Definition: BTD.h:449
-
void setRumbleOn(RumbleEnum mode)
Definition: PS3BT.cpp:543
+
void setRumbleOn(RumbleEnum mode)
Definition: PS3BT.cpp:539
+
void(* pFuncOnInit)(void)
Definition: BTD.h:603
const uint8_t PS3_LEDS[]
Definition: PS3Enums.h:43
-
#define l2cap_check_flag(flag)
Definition: BTD.h:160
+
#define l2cap_check_flag(flag)
Definition: BTD.h:158
Definition: PS3Enums.h:133
Definition: PS3Enums.h:116
-
#define L2CAP_CMD_CONFIG_REQUEST
Definition: BTD.h:168
-
#define L2CAP_CMD_DISCONNECT_REQUEST
Definition: BTD.h:170
-
#define L2CAP_CONTROL_DISCONNECT
Definition: BTD.h:110
-
#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST
Definition: BTD.h:136
+
#define L2CAP_CMD_CONFIG_REQUEST
Definition: BTD.h:166
+
#define PSTR(str)
+
#define L2CAP_CMD_DISCONNECT_REQUEST
Definition: BTD.h:168
+
#define L2CAP_CONTROL_DISCONNECT
Definition: BTD.h:108
+
#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST
Definition: BTD.h:134
ColorsEnum
-
#define BULK_MAXPKTSIZE
Definition: BTD.h:33
+
BTD * pBtd
Definition: BTD.h:606
+
#define BULK_MAXPKTSIZE
Definition: BTD.h:34
-
#define HID_INTR_PSM
Definition: BTD.h:183
+
#define HID_INTR_PSM
Definition: BTD.h:181
const uint8_t PS3_ANALOG_BUTTONS[]
Definition: PS3Enums.h:92
-
int8_t registerServiceClass(BluetoothService *pService)
Definition: BTD.h:333
-
bool l2capConnectionClaimed
Definition: BTD.h:473
+
bool l2capConnectionClaimed
Definition: BTD.h:437
AngleEnum
-
#define PS3_ENABLE_SIXAXIS
Definition: BTD.h:130
+
#define PS3_ENABLE_SIXAXIS
Definition: BTD.h:128
Definition: PS3Enums.h:129
-
#define L2CAP_CMD_DISCONNECT_RESPONSE
Definition: BTD.h:171
+
#define L2CAP_CMD_DISCONNECT_RESPONSE
Definition: BTD.h:169
Definition: PS3Enums.h:136
Definition: PS3Enums.h:132
-
virtual void ACLData(uint8_t *ACLData)
Definition: PS3BT.cpp:227
-
#define L2CAP_CMD_CONFIG_RESPONSE
Definition: BTD.h:169
+
void ACLData(uint8_t *ACLData)
Definition: PS3BT.cpp:224
+
#define L2CAP_CMD_CONFIG_RESPONSE
Definition: BTD.h:167
Definition: PS3Enums.h:137
+
uint16_t hci_handle
Definition: BTD.h:609
Definition: PS3Enums.h:120
-
void setLedOff()
Definition: PS3BT.h:147
+
void setLedOff()
Definition: PS3BT.h:138
-
void setLedToggle(LEDEnum a)
Definition: PS3BT.cpp:579
+
#define strcat_P(dest, src)
+
void setLedToggle(LEDEnum a)
Definition: PS3BT.cpp:575
+
uint32_t l2cap_event_flag
Definition: BTD.h:612
#define PS3_REPORT_BUFFER_SIZE
Definition: PS3Enums.h:24
Definition: PS3Enums.h:130
-
virtual void disconnect()
Definition: PS3BT.cpp:220
+
void disconnect()
Definition: PS3BT.cpp:217
-
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1190
-
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1265
-
#define PENDING
Definition: BTD.h:176
-
#define l2cap_set_flag(flag)
Definition: BTD.h:161
-
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1248
-
#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS
Definition: BTD.h:137
+
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1198
+
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1273
+
#define PENDING
Definition: BTD.h:174
+
#define l2cap_set_flag(flag)
Definition: BTD.h:159
+
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1256
+
#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS
Definition: BTD.h:135
SensorEnum
Definition: PS3Enums.h:128
-
#define L2CAP_CMD_CONNECTION_REQUEST
Definition: BTD.h:166
-
double get9DOFValues(SensorEnum a)
Definition: PS3BT.cpp:115
-
uint8_t getAnalogButton(ButtonEnum a)
Definition: PS3BT.cpp:63
+
#define L2CAP_CMD_CONNECTION_REQUEST
Definition: BTD.h:164
+
double get9DOFValues(SensorEnum a)
Definition: PS3BT.cpp:112
+
uint8_t getAnalogButton(ButtonEnum a)
Definition: PS3BT.cpp:60
-
void setLedRaw(uint8_t value)
Definition: PS3BT.cpp:560
+
void setLedRaw(uint8_t value)
Definition: PS3BT.cpp:556
PS3BT(BTD *pBtd, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0)
Definition: PS3BT.cpp:23
+
bool checkHciHandle(uint8_t *buf, uint16_t handle)
Definition: BTD.h:598
+
void onInit()
Definition: PS3BT.cpp:625
Definition: PS3Enums.h:125
-
#define L2CAP_INTERRUPT_DISCONNECT
Definition: BTD.h:116
-
void setRumbleOff()
Definition: PS3BT.cpp:534
-
bool getButtonClick(ButtonEnum b)
Definition: PS3BT.cpp:56
+
#define L2CAP_INTERRUPT_DISCONNECT
Definition: BTD.h:114
+
void setRumbleOff()
Definition: PS3BT.cpp:530
+
bool getButtonClick(ButtonEnum b)
Definition: PS3BT.cpp:53
const uint8_t PS3_REPORT_BUFFER[PS3_REPORT_BUFFER_SIZE]
Definition: PS3Enums.h:27
-
#define L2CAP_CMD_COMMAND_REJECT
Definition: BTD.h:165
+
#define L2CAP_CMD_COMMAND_REJECT
Definition: BTD.h:163
diff --git a/_p_s3_b_t_8h.html b/_p_s3_b_t_8h.html index 24e2303e..4055de16 100644 --- a/_p_s3_b_t_8h.html +++ b/_p_s3_b_t_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS3BT.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -99,7 +100,7 @@ Include dependency graph for PS3BT.h:
- +
This graph shows which files directly or indirectly include this file:
@@ -141,7 +142,7 @@ Macros diff --git a/_p_s3_b_t_8h__dep__incl.md5 b/_p_s3_b_t_8h__dep__incl.md5 index fd5774bf..80c124ec 100644 --- a/_p_s3_b_t_8h__dep__incl.md5 +++ b/_p_s3_b_t_8h__dep__incl.md5 @@ -1 +1 @@ -bb28c7be8b59850aa707116e8edbd78a \ No newline at end of file +eba794dfcd5eea5cd385cf4d1f0cee96 \ No newline at end of file diff --git a/_p_s3_b_t_8h__incl.map b/_p_s3_b_t_8h__incl.map index 98bfc2c7..31057af2 100644 --- a/_p_s3_b_t_8h__incl.map +++ b/_p_s3_b_t_8h__incl.map @@ -1,6 +1,8 @@ - - - - + + + + + + diff --git a/_p_s3_b_t_8h__incl.md5 b/_p_s3_b_t_8h__incl.md5 index bb85c356..5dcb1eae 100644 --- a/_p_s3_b_t_8h__incl.md5 +++ b/_p_s3_b_t_8h__incl.md5 @@ -1 +1 @@ -a835b66fa43df95b77c40211831fd028 \ No newline at end of file +22ecfc90e081038b1c871acb1a43b6d4 \ No newline at end of file diff --git a/_p_s3_b_t_8h__incl.png b/_p_s3_b_t_8h__incl.png index 727e4394..b36c56dc 100644 Binary files a/_p_s3_b_t_8h__incl.png and b/_p_s3_b_t_8h__incl.png differ diff --git a/_p_s3_b_t_8h_source.html b/_p_s3_b_t_8h_source.html index 74503589..b4703185 100644 --- a/_p_s3_b_t_8h_source.html +++ b/_p_s3_b_t_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS3BT.h Source File + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -116,148 +117,137 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
25 
32 class PS3BT : public BluetoothService {
33 public:
-
41  PS3BT(BTD *pBtd, uint8_t btadr5 = 0, uint8_t btadr4 = 0, uint8_t btadr3 = 0, uint8_t btadr2 = 0, uint8_t btadr1 = 0, uint8_t btadr0 = 0);
+
41  PS3BT(BTD *pBtd, uint8_t btadr5 = 0, uint8_t btadr4 = 0, uint8_t btadr3 = 0, uint8_t btadr2 = 0, uint8_t btadr1 = 0, uint8_t btadr0 = 0);
42 
-
48  virtual void ACLData(uint8_t* ACLData);
-
50  virtual void Run();
-
52  virtual void Reset();
-
54  virtual void disconnect();
-
68  bool getButtonPress(ButtonEnum b);
-
69  bool getButtonClick(ButtonEnum b);
-
80  uint8_t getAnalogButton(ButtonEnum a);
-
86  uint8_t getAnalogHat(AnalogHatEnum a);
-
95  int16_t getSensor(SensorEnum a);
-
101  double getAngle(AngleEnum a);
-
107  double get9DOFValues(SensorEnum a);
-
113  bool getStatus(StatusEnum c);
-
115  void printStatusString();
-
120  String getTemperature();
-
121 
-
123  void setAllOff();
-
125  void setRumbleOff();
-
130  void setRumbleOn(RumbleEnum mode);
-
138  void setRumbleOn(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower);
-
139 
-
144  void setLedRaw(uint8_t value);
-
145 
-
147  void setLedOff() {
-
148  setLedRaw(0);
-
149  };
-
154  void setLedOff(LEDEnum a);
-
159  void setLedOn(LEDEnum a);
-
164  void setLedToggle(LEDEnum a);
-
165 
-
170  void moveSetBulb(uint8_t r, uint8_t g, uint8_t b);
-
175  void moveSetBulb(ColorsEnum color);
-
180  void moveSetRumble(uint8_t rumble);
-
181 
-
183  uint32_t getLastMessageTime() {
-
184  return lastMessageTime;
-
185  };
-
186 
-
191  void attachOnInit(void (*funcOnInit)(void)) {
-
192  pFuncOnInit = funcOnInit;
-
193  };
-
197  bool PS3Connected;
-
199  bool PS3MoveConnected;
-
201  bool PS3NavigationConnected;
-
202 
-
203 private:
-
204  /* Mandatory members */
-
205  BTD *pBtd;
+
45  void disconnect();
+
59  bool getButtonPress(ButtonEnum b);
+
60  bool getButtonClick(ButtonEnum b);
+
71  uint8_t getAnalogButton(ButtonEnum a);
+
77  uint8_t getAnalogHat(AnalogHatEnum a);
+
86  int16_t getSensor(SensorEnum a);
+
92  double getAngle(AngleEnum a);
+
98  double get9DOFValues(SensorEnum a);
+
104  bool getStatus(StatusEnum c);
+
106  void printStatusString();
+
111  String getTemperature();
+
112 
+
114  void setAllOff();
+
116  void setRumbleOff();
+
121  void setRumbleOn(RumbleEnum mode);
+
129  void setRumbleOn(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower);
+
130 
+
135  void setLedRaw(uint8_t value);
+
136 
+
138  void setLedOff() {
+
139  setLedRaw(0);
+
140  };
+
145  void setLedOff(LEDEnum a);
+
150  void setLedOn(LEDEnum a);
+
155  void setLedToggle(LEDEnum a);
+
156 
+
161  void moveSetBulb(uint8_t r, uint8_t g, uint8_t b);
+
166  void moveSetBulb(ColorsEnum color);
+
171  void moveSetRumble(uint8_t rumble);
+
172 
+
174  uint32_t getLastMessageTime() {
+
175  return lastMessageTime;
+
176  };
+
180  bool PS3Connected;
+
182  bool PS3MoveConnected;
+
184  bool PS3NavigationConnected;
+
185 
+
186 protected:
+
192  void ACLData(uint8_t* ACLData);
+
194  void Run();
+
196  void Reset();
+
202  void onInit();
+
205 private:
206 
-
212  void onInit();
-
213  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
-
214 
-
215  void L2CAP_task(); // L2CAP state machine
-
216 
-
217  /* Variables filled from HCI event management */
-
218  int16_t hci_handle;
-
219  uint8_t remote_name[30]; // First 30 chars of remote name
-
220  bool activeConnection; // Used to indicate if it's already has established a connection
+
207  void L2CAP_task(); // L2CAP state machine
+
208 
+
209  /* Variables filled from HCI event management */
+
210  char remote_name_first; // First letter in remote name
+
211  bool activeConnection; // Used to indicate if it's already has established a connection
+
212 
+
213  /* Variables used by high level L2CAP task */
+
214  uint8_t l2cap_state;
+
215 
+
216  uint32_t lastMessageTime; // Variable used to store the millis value of the last message.
+
217 
+
218  uint32_t ButtonState;
+
219  uint32_t OldButtonState;
+
220  uint32_t ButtonClickState;
221 
-
222  /* Variables used by high level L2CAP task */
-
223  uint8_t l2cap_state;
-
224  uint32_t l2cap_event_flag; // L2CAP flags of received Bluetooth events
-
225 
-
226  uint32_t lastMessageTime; // Variable used to store the millis value of the last message.
-
227 
-
228  unsigned long timer;
-
229 
-
230  uint32_t ButtonState;
-
231  uint32_t OldButtonState;
-
232  uint32_t ButtonClickState;
-
233 
-
234  uint32_t timerHID; // Timer used see if there has to be a delay before a new HID command
-
235  uint32_t timerBulbRumble; // used to continuously set PS3 Move controller Bulb and rumble values
-
236 
-
237  uint8_t l2capinbuf[BULK_MAXPKTSIZE]; // General purpose buffer for L2CAP in data
-
238  uint8_t HIDBuffer[HID_BUFFERSIZE]; // Used to store HID commands
-
239  uint8_t HIDMoveBuffer[HID_BUFFERSIZE]; // Used to store HID commands for the Move controller
-
240 
-
241  /* L2CAP Channels */
-
242  uint8_t control_scid[2]; // L2CAP source CID for HID_Control
-
243  uint8_t control_dcid[2]; // 0x0040
-
244  uint8_t interrupt_scid[2]; // L2CAP source CID for HID_Interrupt
-
245  uint8_t interrupt_dcid[2]; // 0x0041
-
246  uint8_t identifier; // Identifier for connection
-
247 
-
248  /* HID Commands */
-
249  void HID_Command(uint8_t* data, uint8_t nbytes);
-
250  void HIDMove_Command(uint8_t* data, uint8_t nbytes);
-
251  void enable_sixaxis(); // Command used to enable the Dualshock 3 and Navigation controller to send data via Bluetooth
-
252 };
-
253 #endif
-
bool PS3NavigationConnected
Definition: PS3BT.h:201
-
bool getStatus(StatusEnum c)
Definition: PS3BT.cpp:159
-
virtual void Run()
Definition: PS3BT.cpp:458
-
Definition: BTD.h:230
-
void setLedOn(LEDEnum a)
Definition: PS3BT.cpp:570
-
String getTemperature()
Definition: PS3BT.cpp:144
+
222  uint32_t timer; // Timer used to limit time between messages and also used to continuously set PS3 Move controller Bulb and rumble values
+
223  uint32_t timerHID; // Timer used see if there has to be a delay before a new HID command
+
224 
+
225  uint8_t l2capinbuf[BULK_MAXPKTSIZE]; // General purpose buffer for L2CAP in data
+
226  uint8_t HIDBuffer[HID_BUFFERSIZE]; // Used to store HID commands
+
227  uint8_t HIDMoveBuffer[HID_BUFFERSIZE]; // Used to store HID commands for the Move controller
+
228 
+
229  /* L2CAP Channels */
+
230  uint8_t control_scid[2]; // L2CAP source CID for HID_Control
+
231  uint8_t control_dcid[2]; // 0x0040
+
232  uint8_t interrupt_scid[2]; // L2CAP source CID for HID_Interrupt
+
233  uint8_t interrupt_dcid[2]; // 0x0041
+
234 
+
235  /* HID Commands */
+
236  void HID_Command(uint8_t* data, uint8_t nbytes);
+
237  void HIDMove_Command(uint8_t* data, uint8_t nbytes);
+
238  void enable_sixaxis(); // Command used to enable the Dualshock 3 and Navigation controller to send data via Bluetooth
+
239 };
+
240 #endif
+
bool PS3NavigationConnected
Definition: PS3BT.h:184
+
bool getStatus(StatusEnum c)
Definition: PS3BT.cpp:156
+
void Run()
Definition: PS3BT.cpp:454
+
Definition: BTD.h:198
+
void setLedOn(LEDEnum a)
Definition: PS3BT.cpp:566
+
String getTemperature()
Definition: PS3BT.cpp:141
AnalogHatEnum
-
void moveSetRumble(uint8_t rumble)
Definition: PS3BT.cpp:618
-
void printStatusString()
Definition: PS3BT.cpp:163
-
void setAllOff()
Definition: PS3BT.cpp:523
+
void moveSetRumble(uint8_t rumble)
Definition: PS3BT.cpp:614
+
void printStatusString()
Definition: PS3BT.cpp:160
+
void setAllOff()
Definition: PS3BT.cpp:519
StatusEnum
Definition: PS3Enums.h:113
#define HID_BUFFERSIZE
Definition: PS3BT.h:24
-
virtual void Reset()
Definition: PS3BT.cpp:207
-
bool getButtonPress(ButtonEnum b)
Definition: PS3BT.cpp:52
+
void Reset()
Definition: PS3BT.cpp:204
+
bool getButtonPress(ButtonEnum b)
Definition: PS3BT.cpp:49
LEDEnum
-
int16_t getSensor(SensorEnum a)
Definition: PS3BT.cpp:71
+
int16_t getSensor(SensorEnum a)
Definition: PS3BT.cpp:68
-
double getAngle(AngleEnum a)
Definition: PS3BT.cpp:88
+
double getAngle(AngleEnum a)
Definition: PS3BT.cpp:85
RumbleEnum
Definition: PS3BT.h:32
-
void attachOnInit(void(*funcOnInit)(void))
Definition: PS3BT.h:191
-
uint8_t getAnalogHat(AnalogHatEnum a)
Definition: PS3BT.cpp:67
-
bool PS3Connected
Definition: PS3BT.h:193
-
Definition: BTD.h:211
+
uint8_t getAnalogHat(AnalogHatEnum a)
Definition: PS3BT.cpp:64
+
bool PS3Connected
Definition: PS3BT.h:176
+
Definition: BTD.h:563
ButtonEnum
-
void moveSetBulb(uint8_t r, uint8_t g, uint8_t b)
Definition: PS3BT.cpp:605
-
bool PS3MoveConnected
Definition: PS3BT.h:199
-
void setRumbleOn(RumbleEnum mode)
Definition: PS3BT.cpp:543
+
void moveSetBulb(uint8_t r, uint8_t g, uint8_t b)
Definition: PS3BT.cpp:601
+
bool PS3MoveConnected
Definition: PS3BT.h:182
+
void setRumbleOn(RumbleEnum mode)
Definition: PS3BT.cpp:539
ColorsEnum
-
#define BULK_MAXPKTSIZE
Definition: BTD.h:33
+
BTD * pBtd
Definition: BTD.h:606
+
#define BULK_MAXPKTSIZE
Definition: BTD.h:34
AngleEnum
-
virtual void ACLData(uint8_t *ACLData)
Definition: PS3BT.cpp:227
-
void setLedOff()
Definition: PS3BT.h:147
-
void setLedToggle(LEDEnum a)
Definition: PS3BT.cpp:579
-
virtual void disconnect()
Definition: PS3BT.cpp:220
+
void ACLData(uint8_t *ACLData)
Definition: PS3BT.cpp:224
+
void setLedOff()
Definition: PS3BT.h:138
+
void setLedToggle(LEDEnum a)
Definition: PS3BT.cpp:575
+
void disconnect()
Definition: PS3BT.cpp:217
SensorEnum
-
double get9DOFValues(SensorEnum a)
Definition: PS3BT.cpp:115
-
uint8_t getAnalogButton(ButtonEnum a)
Definition: PS3BT.cpp:63
-
void setLedRaw(uint8_t value)
Definition: PS3BT.cpp:560
+
double get9DOFValues(SensorEnum a)
Definition: PS3BT.cpp:112
+
uint8_t getAnalogButton(ButtonEnum a)
Definition: PS3BT.cpp:60
+
void setLedRaw(uint8_t value)
Definition: PS3BT.cpp:556
PS3BT(BTD *pBtd, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0)
Definition: PS3BT.cpp:23
-
uint32_t getLastMessageTime()
Definition: PS3BT.h:183
-
void setRumbleOff()
Definition: PS3BT.cpp:534
-
bool getButtonClick(ButtonEnum b)
Definition: PS3BT.cpp:56
+
uint32_t getLastMessageTime()
Definition: PS3BT.h:174
+
void onInit()
Definition: PS3BT.cpp:625
+
void setRumbleOff()
Definition: PS3BT.cpp:530
+
bool getButtonClick(ButtonEnum b)
Definition: PS3BT.cpp:53
diff --git a/_p_s3_enums_8h.html b/_p_s3_enums_8h.html index 22fe4a48..c791bb8e 100644 --- a/_p_s3_enums_8h.html +++ b/_p_s3_enums_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS3Enums.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -384,7 +385,7 @@ Variables diff --git a/_p_s3_enums_8h__dep__incl.md5 b/_p_s3_enums_8h__dep__incl.md5 index 1a523eaa..7e6c593e 100644 --- a/_p_s3_enums_8h__dep__incl.md5 +++ b/_p_s3_enums_8h__dep__incl.md5 @@ -1 +1 @@ -632aeb814444892cb4235318575b2052 \ No newline at end of file +2ee6fe4e5f4f5bb8864f711284e44ace \ No newline at end of file diff --git a/_p_s3_enums_8h__incl.md5 b/_p_s3_enums_8h__incl.md5 index 1892a863..a2b68ead 100644 --- a/_p_s3_enums_8h__incl.md5 +++ b/_p_s3_enums_8h__incl.md5 @@ -1 +1 @@ -8cf971386ed8276013189d149241a27d \ No newline at end of file +1b975049347183489796e6dc1da09be9 \ No newline at end of file diff --git a/_p_s3_enums_8h_source.html b/_p_s3_enums_8h_source.html index 3c1833b7..9f038e2f 100644 --- a/_p_s3_enums_8h_source.html +++ b/_p_s3_enums_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS3Enums.h Source File + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -250,7 +251,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/_p_s3_u_s_b_8cpp.html b/_p_s3_u_s_b_8cpp.html index 2cb01647..6976f899 100644 --- a/_p_s3_u_s_b_8cpp.html +++ b/_p_s3_u_s_b_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS3USB.cpp File Reference + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -95,7 +96,7 @@ Include dependency graph for PS3USB.cpp:
- +

Go to the source code of this file.

@@ -104,7 +105,7 @@ Include dependency graph for PS3USB.cpp: diff --git a/_p_s3_u_s_b_8cpp__incl.map b/_p_s3_u_s_b_8cpp__incl.map index a68640b2..bbc02762 100644 --- a/_p_s3_u_s_b_8cpp__incl.map +++ b/_p_s3_u_s_b_8cpp__incl.map @@ -1,6 +1,8 @@ - - - - + + + + + + diff --git a/_p_s3_u_s_b_8cpp__incl.md5 b/_p_s3_u_s_b_8cpp__incl.md5 index afd63d3f..ab8a99a6 100644 --- a/_p_s3_u_s_b_8cpp__incl.md5 +++ b/_p_s3_u_s_b_8cpp__incl.md5 @@ -1 +1 @@ -68d8fca935dc486bd7b23a04cf3b7f24 \ No newline at end of file +a2824aebe89d82dcd9d4b1ac1984f3c8 \ No newline at end of file diff --git a/_p_s3_u_s_b_8cpp__incl.png b/_p_s3_u_s_b_8cpp__incl.png index e9f8e56b..2565402b 100644 Binary files a/_p_s3_u_s_b_8cpp__incl.png and b/_p_s3_u_s_b_8cpp__incl.png differ diff --git a/_p_s3_u_s_b_8cpp_source.html b/_p_s3_u_s_b_8cpp_source.html index bce3f351..7d6b0888 100644 --- a/_p_s3_u_s_b_8cpp_source.html +++ b/_p_s3_u_s_b_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS3USB.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -146,12 +147,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
55  // get memory address of USB device address pool
56  AddressPool &addrPool = pUsb->GetAddressPool();
57 #ifdef EXTRADEBUG
-
58  Notify(PSTR("\r\nPS3USB Init"), 0x80);
+
58  Notify(PSTR("\r\nPS3USB Init"), 0x80);
59 #endif
60  // check if address has already been assigned to an instance
61  if(bAddress) {
62 #ifdef DEBUG_USB_HOST
-
63  Notify(PSTR("\r\nAddress in use"), 0x80);
+
63  Notify(PSTR("\r\nAddress in use"), 0x80);
64 #endif
65  return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE;
66  }
@@ -161,14 +162,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
70 
71  if(!p) {
72 #ifdef DEBUG_USB_HOST
-
73  Notify(PSTR("\r\nAddress not found"), 0x80);
+
73  Notify(PSTR("\r\nAddress not found"), 0x80);
74 #endif
75  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
76  }
77 
78  if(!p->epinfo) {
79 #ifdef DEBUG_USB_HOST
-
80  Notify(PSTR("\r\nepinfo is null"), 0x80);
+
80  Notify(PSTR("\r\nepinfo is null"), 0x80);
81 #endif
82  return USB_ERROR_EPINFO_IS_NULL;
83  }
@@ -211,13 +212,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
120  addrPool.FreeAddress(bAddress);
121  bAddress = 0;
122 #ifdef DEBUG_USB_HOST
-
123  Notify(PSTR("\r\nsetAddr: "), 0x80);
+
123  Notify(PSTR("\r\nsetAddr: "), 0x80);
124  D_PrintHex<uint8_t > (rcode, 0x80);
125 #endif
126  return rcode;
127  }
128 #ifdef EXTRADEBUG
-
129  Notify(PSTR("\r\nAddr: "), 0x80);
+
129  Notify(PSTR("\r\nAddr: "), 0x80);
130  D_PrintHex<uint8_t > (bAddress, 0x80);
131 #endif
132  //delay(300); // Spec says you should wait at least 200ms
@@ -243,13 +244,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
152 
153  /* Initialize data structures for endpoints of device */
154  epInfo[ PS3_OUTPUT_PIPE ].epAddr = 0x02; // PS3 output endpoint
-
155  epInfo[ PS3_OUTPUT_PIPE ].epAttribs = EP_INTERRUPT;
+
155  epInfo[ PS3_OUTPUT_PIPE ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
156  epInfo[ PS3_OUTPUT_PIPE ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
157  epInfo[ PS3_OUTPUT_PIPE ].maxPktSize = EP_MAXPKTSIZE;
158  epInfo[ PS3_OUTPUT_PIPE ].bmSndToggle = 0;
159  epInfo[ PS3_OUTPUT_PIPE ].bmRcvToggle = 0;
160  epInfo[ PS3_INPUT_PIPE ].epAddr = 0x01; // PS3 report endpoint
-
161  epInfo[ PS3_INPUT_PIPE ].epAttribs = EP_INTERRUPT;
+
161  epInfo[ PS3_INPUT_PIPE ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
162  epInfo[ PS3_INPUT_PIPE ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
163  epInfo[ PS3_INPUT_PIPE ].maxPktSize = EP_MAXPKTSIZE;
164  epInfo[ PS3_INPUT_PIPE ].bmSndToggle = 0;
@@ -268,12 +269,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
177  if(PID == PS3_PID || PID == PS3NAVIGATION_PID) {
178  if(PID == PS3_PID) {
179 #ifdef DEBUG_USB_HOST
-
180  Notify(PSTR("\r\nDualshock 3 Controller Connected"), 0x80);
+
180  Notify(PSTR("\r\nDualshock 3 Controller Connected"), 0x80);
181 #endif
182  PS3Connected = true;
183  } else { // must be a navigation controller
184 #ifdef DEBUG_USB_HOST
-
185  Notify(PSTR("\r\nNavigation Controller Connected"), 0x80);
+
185  Notify(PSTR("\r\nNavigation Controller Connected"), 0x80);
186 #endif
187  PS3NavigationConnected = true;
188  }
@@ -281,13 +282,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
190 
191  // Needed for PS3 Dualshock and Navigation commands to work
192  for(uint8_t i = 0; i < PS3_REPORT_BUFFER_SIZE; i++)
-
193  writeBuf[i] = pgm_read_byte(&PS3_REPORT_BUFFER[i]);
+
193  writeBuf[i] = pgm_read_byte(&PS3_REPORT_BUFFER[i]);
194 
195  for(uint8_t i = 6; i < 10; i++)
196  readBuf[i] = 0x7F; // Set the analog joystick values to center position
197  } else { // must be a Motion controller
198 #ifdef DEBUG_USB_HOST
-
199  Notify(PSTR("\r\nMotion Controller Connected"), 0x80);
+
199  Notify(PSTR("\r\nMotion Controller Connected"), 0x80);
200 #endif
201  PS3MoveConnected = true;
202  writeBuf[0] = 0x02; // Set report ID, this is needed for Move commands to work
@@ -299,10 +300,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
208  setBdaddr(my_bdaddr); // Set internal Bluetooth address
209 
210 #ifdef DEBUG_USB_HOST
-
211  Notify(PSTR("\r\nBluetooth Address was set to: "), 0x80);
+
211  Notify(PSTR("\r\nBluetooth Address was set to: "), 0x80);
212  for(int8_t i = 5; i > 0; i--) {
213  D_PrintHex<uint8_t > (my_bdaddr[i], 0x80);
-
214  Notify(PSTR(":"), 0x80);
+
214  Notify(PSTR(":"), 0x80);
215  }
216  D_PrintHex<uint8_t > (my_bdaddr[0], 0x80);
217 #endif
@@ -310,7 +311,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
219  onInit();
220 
221  bPollEnable = true;
-
222  Notify(PSTR("\r\n"), 0x80);
+
222  Notify(PSTR("\r\n"), 0x80);
223  timer = millis();
224  return 0; // Successful configuration
225 
@@ -341,7 +342,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
250 
251 Fail:
252 #ifdef DEBUG_USB_HOST
-
253  Notify(PSTR("\r\nPS3 Init Failed, error code: "), 0x80);
+
253  Notify(PSTR("\r\nPS3 Init Failed, error code: "), 0x80);
254  NotifyFail(rcode);
255 #endif
256  Release();
@@ -397,25 +398,25 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
306 #ifdef PRINTREPORT
307  for(uint8_t i = 0; i < PS3_REPORT_BUFFER_SIZE; i++) {
308  D_PrintHex<uint8_t > (readBuf[i], 0x80);
-
309  Notify(PSTR(" "), 0x80);
+
309  Notify(PSTR(" "), 0x80);
310  }
-
311  Notify(PSTR("\r\n"), 0x80);
+
311  Notify(PSTR("\r\n"), 0x80);
312 #endif
313 }
314 
315 bool PS3USB::getButtonPress(ButtonEnum b) {
-
316  return (ButtonState & pgm_read_dword(&PS3_BUTTONS[(uint8_t)b]));
+
316  return (ButtonState & pgm_read_dword(&PS3_BUTTONS[(uint8_t)b]));
317 }
318 
319 bool PS3USB::getButtonClick(ButtonEnum b) {
-
320  uint32_t button = pgm_read_dword(&PS3_BUTTONS[(uint8_t)b]);
+
320  uint32_t button = pgm_read_dword(&PS3_BUTTONS[(uint8_t)b]);
321  bool click = (ButtonClickState & button);
322  ButtonClickState &= ~button; // Clear "click" event
323  return click;
324 }
325 
326 uint8_t PS3USB::getAnalogButton(ButtonEnum a) {
-
327  return (uint8_t)(readBuf[(pgm_read_byte(&PS3_ANALOG_BUTTONS[(uint8_t)a])) - 9]);
+
327  return (uint8_t)(readBuf[(pgm_read_byte(&PS3_ANALOG_BUTTONS[(uint8_t)a])) - 9]);
328 }
329 
330 uint8_t PS3USB::getAnalogHat(AnalogHatEnum a) {
@@ -456,32 +457,32 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
365 void PS3USB::printStatusString() {
366  char statusOutput[100]; // Max string length plus null character
367  if(PS3Connected || PS3NavigationConnected) {
-
368  strcpy_P(statusOutput, PSTR("ConnectionStatus: "));
+
368  strcpy_P(statusOutput, PSTR("ConnectionStatus: "));
369 
-
370  if(getStatus(Plugged)) strcat_P(statusOutput, PSTR("Plugged"));
-
371  else if(getStatus(Unplugged)) strcat_P(statusOutput, PSTR("Unplugged"));
-
372  else strcat_P(statusOutput, PSTR("Error"));
+
370  if(getStatus(Plugged)) strcat_P(statusOutput, PSTR("Plugged"));
+
371  else if(getStatus(Unplugged)) strcat_P(statusOutput, PSTR("Unplugged"));
+
372  else strcat_P(statusOutput, PSTR("Error"));
373 
-
374  strcat_P(statusOutput, PSTR(" - PowerRating: "));
+
374  strcat_P(statusOutput, PSTR(" - PowerRating: "));
375 
-
376  if(getStatus(Charging)) strcat_P(statusOutput, PSTR("Charging"));
-
377  else if(getStatus(NotCharging)) strcat_P(statusOutput, PSTR("Not Charging"));
-
378  else if(getStatus(Shutdown)) strcat_P(statusOutput, PSTR("Shutdown"));
-
379  else if(getStatus(Dying)) strcat_P(statusOutput, PSTR("Dying"));
-
380  else if(getStatus(Low)) strcat_P(statusOutput, PSTR("Low"));
-
381  else if(getStatus(High)) strcat_P(statusOutput, PSTR("High"));
-
382  else if(getStatus(Full)) strcat_P(statusOutput, PSTR("Full"));
-
383  else strcat_P(statusOutput, PSTR("Error"));
+
376  if(getStatus(Charging)) strcat_P(statusOutput, PSTR("Charging"));
+
377  else if(getStatus(NotCharging)) strcat_P(statusOutput, PSTR("Not Charging"));
+
378  else if(getStatus(Shutdown)) strcat_P(statusOutput, PSTR("Shutdown"));
+
379  else if(getStatus(Dying)) strcat_P(statusOutput, PSTR("Dying"));
+
380  else if(getStatus(Low)) strcat_P(statusOutput, PSTR("Low"));
+
381  else if(getStatus(High)) strcat_P(statusOutput, PSTR("High"));
+
382  else if(getStatus(Full)) strcat_P(statusOutput, PSTR("Full"));
+
383  else strcat_P(statusOutput, PSTR("Error"));
384 
-
385  strcat_P(statusOutput, PSTR(" - WirelessStatus: "));
+
385  strcat_P(statusOutput, PSTR(" - WirelessStatus: "));
386 
-
387  if(getStatus(CableRumble)) strcat_P(statusOutput, PSTR("Cable - Rumble is on"));
-
388  else if(getStatus(Cable)) strcat_P(statusOutput, PSTR("Cable - Rumble is off"));
-
389  else if(getStatus(BluetoothRumble)) strcat_P(statusOutput, PSTR("Bluetooth - Rumble is on"));
-
390  else if(getStatus(Bluetooth)) strcat_P(statusOutput, PSTR("Bluetooth - Rumble is off"));
-
391  else strcat_P(statusOutput, PSTR("Error"));
+
387  if(getStatus(CableRumble)) strcat_P(statusOutput, PSTR("Cable - Rumble is on"));
+
388  else if(getStatus(Cable)) strcat_P(statusOutput, PSTR("Cable - Rumble is off"));
+
389  else if(getStatus(BluetoothRumble)) strcat_P(statusOutput, PSTR("Bluetooth - Rumble is on"));
+
390  else if(getStatus(Bluetooth)) strcat_P(statusOutput, PSTR("Bluetooth - Rumble is off"));
+
391  else strcat_P(statusOutput, PSTR("Error"));
392  } else
-
393  strcpy_P(statusOutput, PSTR("Error"));
+
393  strcpy_P(statusOutput, PSTR("Error"));
394 
395  USB_HOST_SERIAL.write(statusOutput);
396 }
@@ -489,12 +490,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
398 /* Playstation Sixaxis Dualshock and Navigation Controller commands */
399 void PS3USB::PS3_Command(uint8_t *data, uint16_t nbytes) {
400  // bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x01), Report Type (Output 0x02), interface (0x00), datalength, datalength, data)
-
401  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x01, 0x02, 0x00, nbytes, nbytes, data, NULL);
+
401  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x01, 0x02, 0x00, nbytes, nbytes, data, NULL);
402 }
403 
404 void PS3USB::setAllOff() {
405  for(uint8_t i = 0; i < PS3_REPORT_BUFFER_SIZE; i++)
-
406  writeBuf[i] = pgm_read_byte(&PS3_REPORT_BUFFER[i]); // Reset buffer
+
406  writeBuf[i] = pgm_read_byte(&PS3_REPORT_BUFFER[i]); // Reset buffer
407 
408  PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
409 }
@@ -533,7 +534,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
442 }
443 
444 void PS3USB::setLedOff(LEDEnum a) {
-
445  writeBuf[9] &= ~((uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1));
+
445  writeBuf[9] &= ~((uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1));
446  PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
447 }
448 
@@ -541,13 +542,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
450  if(a == OFF)
451  setLedRaw(0);
452  else {
-
453  writeBuf[9] |= (uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1);
+
453  writeBuf[9] |= (uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1);
454  PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
455  }
456 }
457 
458 void PS3USB::setLedToggle(LEDEnum a) {
-
459  writeBuf[9] ^= (uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1);
+
459  writeBuf[9] ^= (uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1);
460  PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
461 }
462 
@@ -561,14 +562,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
470  buf[i + 2] = bdaddr[5 - i]; // Copy into buffer, has to be written reversed, so it is MSB first
471 
472  // bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF5), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data
-
473  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);
+
473  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);
474 }
475 
476 void PS3USB::getBdaddr(uint8_t *bdaddr) {
477  uint8_t buf[8];
478 
479  // bmRequest = Device to host (0x80) | Class (0x20) | Interface (0x01) = 0xA1, bRequest = Get Report (0x01), Report ID (0xF5), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data
-
480  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_IN, HID_REQUEST_GET_REPORT, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);
+
480  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_IN, HID_REQUEST_GET_REPORT, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);
481 
482  for(uint8_t i = 0; i < 6; i++)
483  bdaddr[5 - i] = buf[i + 2]; // Copy into buffer reversed, so it is LSB first
@@ -582,7 +583,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
491  cmd_buf[3] = 0x00;
492 
493  // bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF4), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)
-
494  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0xF4, 0x03, 0x00, 4, 4, cmd_buf, NULL);
+
494  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0xF4, 0x03, 0x00, 4, 4, cmd_buf, NULL);
495 }
496 
497 /* Playstation Move Controller commands */
@@ -606,7 +607,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
515 void PS3USB::moveSetRumble(uint8_t rumble) {
516 #ifdef DEBUG_USB_HOST
517  if(rumble < 64 && rumble != 0) // The rumble value has to at least 64, or approximately 25% (64/255*100)
-
518  Notify(PSTR("\r\nThe rumble value has to at least 64, or approximately 25%"), 0x80);
+
518  Notify(PSTR("\r\nThe rumble value has to at least 64, or approximately 25%"), 0x80);
519 #endif
520  writeBuf[6] = rumble; // Set the rumble value into the write buffer
521 
@@ -626,14 +627,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
535  buf[i + 1] = bdaddr[i];
536 
537  // bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x05), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data
-
538  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x05, 0x03, 0x00, 11, 11, buf, NULL);
+
538  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x05, 0x03, 0x00, 11, 11, buf, NULL);
539 }
540 
541 void PS3USB::getMoveBdaddr(uint8_t *bdaddr) {
542  uint8_t buf[16];
543 
544  // bmRequest = Device to host (0x80) | Class (0x20) | Interface (0x01) = 0xA1, bRequest = Get Report (0x01), Report ID (0x04), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data
-
545  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_IN, HID_REQUEST_GET_REPORT, 0x04, 0x03, 0x00, 16, 16, buf, NULL);
+
545  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_IN, HID_REQUEST_GET_REPORT, 0x04, 0x03, 0x00, 16, 16, buf, NULL);
546 
547  for(uint8_t i = 0; i < 6; i++)
548  bdaddr[i] = buf[10 + i];
@@ -644,7 +645,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
553 
554  for(uint8_t i = 0; i < 3; i++) {
555  // bmRequest = Device to host (0x80) | Class (0x20) | Interface (0x01) = 0xA1, bRequest = Get Report (0x01), Report ID (0x10), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data
-
556  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_IN, HID_REQUEST_GET_REPORT, 0x10, 0x03, 0x00, 49, 49, buf, NULL);
+
556  pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_IN, HID_REQUEST_GET_REPORT, 0x10, 0x03, 0x00, 49, 49, buf, NULL);
557 
558  for(byte j = 0; j < 49; j++)
559  data[49 * i + j] = buf[j];
@@ -666,34 +667,40 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
Definition: address.h:83
void getBdaddr(uint8_t *bdaddr)
Definition: PS3USB.cpp:476
Definition: PS3Enums.h:117
+
#define pgm_read_dword(addr)
EpInfo * epinfo
Definition: address.h:76
bool lowspeed
Definition: address.h:79
-
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:81
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
+
#define strcpy_P(dest, src)
uint8_t bmNakPower
Definition: address.h:42
void setLedRaw(uint8_t value)
Definition: PS3USB.cpp:439
-
bool PS3NavigationConnected
Definition: PS3USB.h:273
-
void setLedOff()
Definition: PS3USB.h:224
-
#define PS3_INPUT_PIPE
Definition: PS3USB.h:33
+
bool PS3NavigationConnected
Definition: PS3USB.h:264
+
void setLedOff()
Definition: PS3USB.h:215
+
#define PS3_INPUT_PIPE
Definition: PS3USB.h:31
Definition: address.h:75
Definition: PS3Enums.h:135
-
#define PS3MOVE_PID
Definition: BTD.h:27
+
#define PS3MOVE_PID
Definition: BTD.h:28
void setBdaddr(uint8_t *bdaddr)
Definition: PS3USB.cpp:463
-
virtual uint8_t Release()
Definition: PS3USB.cpp:261
+
#define HID_REQUEST_SET_REPORT
Definition: hid.h:72
+
uint8_t Release()
Definition: PS3USB.cpp:261
Definition: PS3Enums.h:138
bool getButtonPress(ButtonEnum b)
Definition: PS3USB.cpp:315
-
#define PS3_OUTPUT_PIPE
Definition: PS3USB.h:32
+
#define PS3_OUTPUT_PIPE
Definition: PS3USB.h:30
#define NotifyFail(...)
Definition: message.h:55
-
bool PS3MoveConnected
Definition: PS3USB.h:271
+
bool PS3MoveConnected
Definition: PS3USB.h:262
AnalogHatEnum
-
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:805
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
Definition: PS3Enums.h:121
+
#define bmREQ_HID_OUT
Definition: hid.h:63
Definition: PS3Enums.h:119
+
#define USB_TRANSFER_TYPE_INTERRUPT
Definition: usb_ch9.h:86
StatusEnum
Definition: PS3Enums.h:113
void getMoveBdaddr(uint8_t *bdaddr)
Definition: PS3USB.cpp:541
-
#define PS3_VID
Definition: BTD.h:24
+
#define PS3_VID
Definition: BTD.h:25
+
#define pgm_read_byte(addr)
#define NotifyFailGetDevDescr(...)
Definition: message.h:50
uint8_t getAnalogButton(ButtonEnum a)
Definition: PS3USB.cpp:326
@@ -701,17 +708,17 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
void setRumbleOff()
Definition: PS3USB.cpp:411
const uint32_t PS3_BUTTONS[]
Definition: PS3Enums.h:62
-
#define EP_MAXPKTSIZE
Definition: PS3USB.h:25
-
bool PS3Connected
Definition: PS3USB.h:265
+
#define EP_MAXPKTSIZE
Definition: PS3USB.h:26
+
bool PS3Connected
Definition: PS3USB.h:256
virtual void FreeAddress(uint8_t addr)=0
LEDEnum
uint8_t epAttribs
Definition: address.h:37
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
Definition: Usb.cpp:126
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
#define Notify(...)
Definition: message.h:44
-
#define PS3_CONTROL_PIPE
Definition: PS3USB.h:31
+
#define PS3_CONTROL_PIPE
Definition: PS3USB.h:29
RumbleEnum
-
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:796
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
#define USB_HOST_SERIAL
Definition: settings.h:34
void setLedToggle(LEDEnum a)
Definition: PS3USB.cpp:458
uint8_t epAddr
Definition: address.h:33
@@ -720,8 +727,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
void moveSetBulb(uint8_t r, uint8_t g, uint8_t b)
Definition: PS3USB.cpp:502
Definition: PS3Enums.h:122
Definition: PS3Enums.h:123
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: PS3USB.cpp:46
-
#define EP_INTERRUPT
Definition: PS3USB.h:28
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: PS3USB.cpp:46
Definition: address.h:32
#define MOVE_REPORT_BUFFER_SIZE
Definition: PS3Enums.h:40
void printStatusString()
Definition: PS3USB.cpp:365
@@ -729,55 +735,55 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
Definition: Usb.cpp:292
ButtonEnum
-
#define HID_REQUEST_SET_REPORT
Definition: BTD.h:39
#define HID_REQUEST_GET_REPORT
Definition: hid.h:69
const uint8_t PS3_LEDS[]
Definition: PS3Enums.h:43
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
Definition: PS3Enums.h:116
uint8_t bmSndToggle
Definition: address.h:40
uint8_t getAnalogHat(AnalogHatEnum a)
Definition: PS3USB.cpp:330
-
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:83
-
USB * pUsb
Definition: PS3USB.h:277
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
+
#define PSTR(str)
+
USB * pUsb
Definition: PS3USB.h:268
ColorsEnum
const uint8_t PS3_ANALOG_BUTTONS[]
Definition: PS3Enums.h:92
#define USB_NAK_NOWAIT
Definition: address.h:29
AngleEnum
double getAngle(AngleEnum a)
Definition: PS3USB.cpp:338
-
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:80
-
#define PS3_PID
Definition: BTD.h:25
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
+
#define PS3_PID
Definition: BTD.h:26
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
Definition: Usb.cpp:206
-
#define PS3NAVIGATION_PID
Definition: BTD.h:26
+
#define PS3NAVIGATION_PID
Definition: BTD.h:27
void moveSetRumble(uint8_t rumble)
Definition: PS3USB.cpp:515
-
virtual uint8_t Poll()
Definition: PS3USB.cpp:271
-
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:75
+
uint8_t Poll()
Definition: PS3USB.cpp:271
+
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:77
Definition: PS3Enums.h:136
-
#define PS3_MAX_ENDPOINTS
Definition: PS3USB.h:48
-
EpInfo epInfo[PS3_MAX_ENDPOINTS]
Definition: PS3USB.h:281
+
#define PS3_MAX_ENDPOINTS
Definition: PS3USB.h:39
+
EpInfo epInfo[PS3_MAX_ENDPOINTS]
Definition: PS3USB.h:272
void setRumbleOn(RumbleEnum mode)
Definition: PS3USB.cpp:420
+
#define bmREQ_HID_IN
Definition: hid.h:64
Definition: PS3Enums.h:137
-
#define bmREQ_HID_OUT
Definition: BTD.h:38
-
#define bmREQ_HID_IN
Definition: PS3USB.h:43
Definition: PS3Enums.h:120
-
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:78
+
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:80
void setLedOn(LEDEnum a)
Definition: PS3USB.cpp:449
+
#define strcat_P(dest, src)
uint8_t maxPktSize
Definition: address.h:34
-
AddressPool & GetAddressPool()
Definition: UsbCore.h:206
-
uint8_t bAddress
Definition: PS3USB.h:279
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
uint8_t bAddress
Definition: PS3USB.h:270
void setMoveBdaddr(uint8_t *bdaddr)
Definition: PS3USB.cpp:525
#define PS3_REPORT_BUFFER_SIZE
Definition: PS3Enums.h:24
-
Definition: UsbCore.h:190
+
Definition: UsbCore.h:197
SensorEnum
-
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:210
+
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:217
#define NotifyFailSetConfDescr(...)
Definition: message.h:53
PS3USB(USB *pUsb, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0)
Definition: PS3USB.cpp:23
void getMoveCalibration(uint8_t *data)
Definition: PS3USB.cpp:551
Definition: PS3Enums.h:125
bool getStatus(StatusEnum c)
Definition: PS3USB.cpp:361
-
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:761
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:51
const uint8_t PS3_REPORT_BUFFER[PS3_REPORT_BUFFER_SIZE]
Definition: PS3Enums.h:27
bool getButtonClick(ButtonEnum b)
Definition: PS3USB.cpp:319
@@ -787,7 +793,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/_p_s3_u_s_b_8h.html b/_p_s3_u_s_b_8h.html index b55ee6fa..6ff336c4 100644 --- a/_p_s3_u_s_b_8h.html +++ b/_p_s3_u_s_b_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS3USB.h File Reference + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -93,13 +94,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
#include "Usb.h"
+#include "hid.h"
#include "PS3Enums.h"
Include dependency graph for PS3USB.h:
- +
This graph shows which files directly or indirectly include this file:
@@ -120,8 +122,6 @@ Classes Macros #define EP_MAXPKTSIZE   64   -#define EP_INTERRUPT   0x03 -  #define PS3_CONTROL_PIPE   0   #define PS3_OUTPUT_PIPE   1 @@ -136,14 +136,6 @@ Macros   #define PS3MOVE_PID   0x03D5   -#define bmREQ_HID_OUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE -  -#define bmREQ_HID_IN   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE -  -#define HID_REQUEST_GET_REPORT   0x01 -  -#define HID_REQUEST_SET_REPORT   0x09 -  #define PS3_MAX_ENDPOINTS   3   @@ -158,21 +150,7 @@ Macros
-

Definition at line 25 of file PS3USB.h.

- -
-
- -
-
- - - - -
#define EP_INTERRUPT   0x03
-
- -

Definition at line 28 of file PS3USB.h.

+

Definition at line 26 of file PS3USB.h.

@@ -186,7 +164,7 @@ Macros
-

Definition at line 31 of file PS3USB.h.

+

Definition at line 29 of file PS3USB.h.

@@ -200,7 +178,7 @@ Macros
-

Definition at line 32 of file PS3USB.h.

+

Definition at line 30 of file PS3USB.h.

@@ -214,7 +192,7 @@ Macros
-

Definition at line 33 of file PS3USB.h.

+

Definition at line 31 of file PS3USB.h.

@@ -228,7 +206,7 @@ Macros
-

Definition at line 36 of file PS3USB.h.

+

Definition at line 34 of file PS3USB.h.

@@ -242,7 +220,7 @@ Macros
-

Definition at line 37 of file PS3USB.h.

+

Definition at line 35 of file PS3USB.h.

@@ -256,7 +234,7 @@ Macros
-

Definition at line 38 of file PS3USB.h.

+

Definition at line 36 of file PS3USB.h.

@@ -270,63 +248,7 @@ Macros
-

Definition at line 39 of file PS3USB.h.

- -
- - -
-
- - - - -
#define bmREQ_HID_OUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
-
- -

Definition at line 42 of file PS3USB.h.

- -
-
- -
-
- - - - -
#define bmREQ_HID_IN   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
-
- -

Definition at line 43 of file PS3USB.h.

- -
-
- -
-
- - - - -
#define HID_REQUEST_GET_REPORT   0x01
-
- -

Definition at line 45 of file PS3USB.h.

- -
-
- -
-
- - - - -
#define HID_REQUEST_SET_REPORT   0x09
-
- -

Definition at line 46 of file PS3USB.h.

+

Definition at line 37 of file PS3USB.h.

@@ -340,7 +262,7 @@ Macros
-

Definition at line 48 of file PS3USB.h.

+

Definition at line 39 of file PS3USB.h.

@@ -349,7 +271,7 @@ Macros diff --git a/_p_s3_u_s_b_8h__dep__incl.md5 b/_p_s3_u_s_b_8h__dep__incl.md5 index b91d38d1..12e5013f 100644 --- a/_p_s3_u_s_b_8h__dep__incl.md5 +++ b/_p_s3_u_s_b_8h__dep__incl.md5 @@ -1 +1 @@ -10cd044b5bf58467538f65c844ab1455 \ No newline at end of file +0475266e9b2a94b52ed82e482fd5e58c \ No newline at end of file diff --git a/_p_s3_u_s_b_8h__incl.map b/_p_s3_u_s_b_8h__incl.map index 220e1654..168f5b6f 100644 --- a/_p_s3_u_s_b_8h__incl.map +++ b/_p_s3_u_s_b_8h__incl.map @@ -1,5 +1,7 @@ - - - + + + + + diff --git a/_p_s3_u_s_b_8h__incl.md5 b/_p_s3_u_s_b_8h__incl.md5 index 7be15006..177300e5 100644 --- a/_p_s3_u_s_b_8h__incl.md5 +++ b/_p_s3_u_s_b_8h__incl.md5 @@ -1 +1 @@ -d7ca50c1f7f20fdedd5d4e89b29bcaf5 \ No newline at end of file +2b18542091cc595d838d40ff497d2b2f \ No newline at end of file diff --git a/_p_s3_u_s_b_8h__incl.png b/_p_s3_u_s_b_8h__incl.png index 4dac0627..8986c495 100644 Binary files a/_p_s3_u_s_b_8h__incl.png and b/_p_s3_u_s_b_8h__incl.png differ diff --git a/_p_s3_u_s_b_8h_source.html b/_p_s3_u_s_b_8h_source.html index 1621d40c..502eabde 100644 --- a/_p_s3_u_s_b_8h_source.html +++ b/_p_s3_u_s_b_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS3USB.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -110,186 +111,178 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
19 #define _ps3usb_h_
20 
21 #include "Usb.h"
-
22 #include "PS3Enums.h"
-
23 
-
24 /* PS3 data taken from descriptors */
-
25 #define EP_MAXPKTSIZE 64 // max size for data via USB
-
26 
-
27 /* Endpoint types */
-
28 #define EP_INTERRUPT 0x03
-
29 
-
30 /* Names we give to the 3 ps3 pipes - this is only used for setting the bluetooth address into the ps3 controllers */
-
31 #define PS3_CONTROL_PIPE 0
-
32 #define PS3_OUTPUT_PIPE 1
-
33 #define PS3_INPUT_PIPE 2
-
34 
-
35 //PID and VID of the different devices
-
36 #define PS3_VID 0x054C // Sony Corporation
-
37 #define PS3_PID 0x0268 // PS3 Controller DualShock 3
-
38 #define PS3NAVIGATION_PID 0x042F // Navigation controller
-
39 #define PS3MOVE_PID 0x03D5 // Motion controller
+
22 #include "hid.h"
+
23 #include "PS3Enums.h"
+
24 
+
25 /* PS3 data taken from descriptors */
+
26 #define EP_MAXPKTSIZE 64 // max size for data via USB
+
27 
+
28 /* Names we give to the 3 ps3 pipes - this is only used for setting the bluetooth address into the ps3 controllers */
+
29 #define PS3_CONTROL_PIPE 0
+
30 #define PS3_OUTPUT_PIPE 1
+
31 #define PS3_INPUT_PIPE 2
+
32 
+
33 //PID and VID of the different devices
+
34 #define PS3_VID 0x054C // Sony Corporation
+
35 #define PS3_PID 0x0268 // PS3 Controller DualShock 3
+
36 #define PS3NAVIGATION_PID 0x042F // Navigation controller
+
37 #define PS3MOVE_PID 0x03D5 // Motion controller
+
38 
+
39 #define PS3_MAX_ENDPOINTS 3
40 
-
41 // Used in control endpoint header for HID Commands
-
42 #define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
-
43 #define bmREQ_HID_IN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
-
44 
-
45 #define HID_REQUEST_GET_REPORT 0x01
-
46 #define HID_REQUEST_SET_REPORT 0x09
-
47 
-
48 #define PS3_MAX_ENDPOINTS 3
-
49 
-
58 class PS3USB : public USBDeviceConfig {
-
59 public:
-
67  PS3USB(USB *pUsb, uint8_t btadr5 = 0, uint8_t btadr4 = 0, uint8_t btadr3 = 0, uint8_t btadr2 = 0, uint8_t btadr1 = 0, uint8_t btadr0 = 0);
-
68 
-
77  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
-
82  virtual uint8_t Release();
-
87  virtual uint8_t Poll();
-
88 
-
93  virtual uint8_t GetAddress() {
-
94  return bAddress;
-
95  };
-
96 
-
101  virtual bool isReady() {
-
102  return bPollEnable;
-
103  };
-
104 
-
111  virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
-
112  return (vid == PS3_VID && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID));
-
113  };
-
121  void setBdaddr(uint8_t *bdaddr);
-
127  void getBdaddr(uint8_t *bdaddr);
-
128 
-
134  void setMoveBdaddr(uint8_t *bdaddr);
-
140  void getMoveBdaddr(uint8_t *bdaddr);
-
145  void getMoveCalibration(uint8_t *data);
-
146 
-
158  bool getButtonPress(ButtonEnum b);
-
159  bool getButtonClick(ButtonEnum b);
-
170  uint8_t getAnalogButton(ButtonEnum a);
-
176  uint8_t getAnalogHat(AnalogHatEnum a);
-
183  uint16_t getSensor(SensorEnum a);
-
189  double getAngle(AngleEnum a);
-
195  bool getStatus(StatusEnum c);
-
197  void printStatusString();
-
198 
-
200  void setAllOff();
-
202  void setRumbleOff();
-
207  void setRumbleOn(RumbleEnum mode);
-
215  void setRumbleOn(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower);
-
216 
-
221  void setLedRaw(uint8_t value);
-
222 
-
224  void setLedOff() {
-
225  setLedRaw(0);
-
226  }
-
231  void setLedOff(LEDEnum a);
-
236  void setLedOn(LEDEnum a);
-
241  void setLedToggle(LEDEnum a);
-
242 
-
247  void moveSetBulb(uint8_t r, uint8_t g, uint8_t b);
-
252  void moveSetBulb(ColorsEnum color);
-
257  void moveSetRumble(uint8_t rumble);
-
258 
-
263  void attachOnInit(void (*funcOnInit)(void)) {
-
264  pFuncOnInit = funcOnInit;
-
265  };
-
269  bool PS3Connected;
-
271  bool PS3MoveConnected;
-
273  bool PS3NavigationConnected;
-
274 
-
275 protected:
-
277  USB *pUsb;
-
279  uint8_t bAddress;
-
281  EpInfo epInfo[PS3_MAX_ENDPOINTS];
+
49 class PS3USB : public USBDeviceConfig {
+
50 public:
+
58  PS3USB(USB *pUsb, uint8_t btadr5 = 0, uint8_t btadr4 = 0, uint8_t btadr3 = 0, uint8_t btadr2 = 0, uint8_t btadr1 = 0, uint8_t btadr0 = 0);
+
59 
+
68  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
+
73  uint8_t Release();
+
78  uint8_t Poll();
+
79 
+
84  virtual uint8_t GetAddress() {
+
85  return bAddress;
+
86  };
+
87 
+
92  virtual bool isReady() {
+
93  return bPollEnable;
+
94  };
+
95 
+
102  virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
+
103  return (vid == PS3_VID && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID));
+
104  };
+
112  void setBdaddr(uint8_t *bdaddr);
+
118  void getBdaddr(uint8_t *bdaddr);
+
119 
+
125  void setMoveBdaddr(uint8_t *bdaddr);
+
131  void getMoveBdaddr(uint8_t *bdaddr);
+
136  void getMoveCalibration(uint8_t *data);
+
137 
+
149  bool getButtonPress(ButtonEnum b);
+
150  bool getButtonClick(ButtonEnum b);
+
161  uint8_t getAnalogButton(ButtonEnum a);
+
167  uint8_t getAnalogHat(AnalogHatEnum a);
+
174  uint16_t getSensor(SensorEnum a);
+
180  double getAngle(AngleEnum a);
+
186  bool getStatus(StatusEnum c);
+
188  void printStatusString();
+
189 
+
191  void setAllOff();
+
193  void setRumbleOff();
+
198  void setRumbleOn(RumbleEnum mode);
+
206  void setRumbleOn(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower);
+
207 
+
212  void setLedRaw(uint8_t value);
+
213 
+
215  void setLedOff() {
+
216  setLedRaw(0);
+
217  }
+
222  void setLedOff(LEDEnum a);
+
227  void setLedOn(LEDEnum a);
+
232  void setLedToggle(LEDEnum a);
+
233 
+
238  void moveSetBulb(uint8_t r, uint8_t g, uint8_t b);
+
243  void moveSetBulb(ColorsEnum color);
+
248  void moveSetRumble(uint8_t rumble);
+
249 
+
254  void attachOnInit(void (*funcOnInit)(void)) {
+
255  pFuncOnInit = funcOnInit;
+
256  };
+
260  bool PS3Connected;
+
262  bool PS3MoveConnected;
+
264  bool PS3NavigationConnected;
+
265 
+
266 protected:
+
268  USB *pUsb;
+
270  uint8_t bAddress;
+
272  EpInfo epInfo[PS3_MAX_ENDPOINTS];
+
273 
+
274 private:
+
280  void onInit();
+
281  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
282 
-
283 private:
-
289  void onInit();
-
290  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
-
291 
-
292  bool bPollEnable;
-
293 
-
294  uint32_t timer; // used to continuously set PS3 Move controller Bulb and rumble values
-
295 
-
296  uint32_t ButtonState;
-
297  uint32_t OldButtonState;
-
298  uint32_t ButtonClickState;
-
299 
-
300  uint8_t my_bdaddr[6]; // Change to your dongles Bluetooth address in the constructor
-
301  uint8_t readBuf[EP_MAXPKTSIZE]; // General purpose buffer for input data
-
302  uint8_t writeBuf[EP_MAXPKTSIZE]; // General purpose buffer for output data
-
303 
-
304  void readReport(); // read incoming data
-
305  void printReport(); // print incoming date - Uncomment for debugging
-
306 
-
307  /* Private commands */
-
308  void PS3_Command(uint8_t *data, uint16_t nbytes);
-
309  void enable_sixaxis(); // Command used to enable the Dualshock 3 and Navigation controller to send data via USB
-
310  void Move_Command(uint8_t *data, uint16_t nbytes);
-
311 };
-
312 #endif
+
283  bool bPollEnable;
+
284 
+
285  uint32_t timer; // used to continuously set PS3 Move controller Bulb and rumble values
+
286 
+
287  uint32_t ButtonState;
+
288  uint32_t OldButtonState;
+
289  uint32_t ButtonClickState;
+
290 
+
291  uint8_t my_bdaddr[6]; // Change to your dongles Bluetooth address in the constructor
+
292  uint8_t readBuf[EP_MAXPKTSIZE]; // General purpose buffer for input data
+
293  uint8_t writeBuf[EP_MAXPKTSIZE]; // General purpose buffer for output data
+
294 
+
295  void readReport(); // read incoming data
+
296  void printReport(); // print incoming date - Uncomment for debugging
+
297 
+
298  /* Private commands */
+
299  void PS3_Command(uint8_t *data, uint16_t nbytes);
+
300  void enable_sixaxis(); // Command used to enable the Dualshock 3 and Navigation controller to send data via USB
+
301  void Move_Command(uint8_t *data, uint16_t nbytes);
+
302 };
+
303 #endif
void getBdaddr(uint8_t *bdaddr)
Definition: PS3USB.cpp:476
-
Definition: PS3USB.h:58
+
Definition: PS3USB.h:49
void setLedRaw(uint8_t value)
Definition: PS3USB.cpp:439
-
bool PS3NavigationConnected
Definition: PS3USB.h:273
-
void setLedOff()
Definition: PS3USB.h:224
+
bool PS3NavigationConnected
Definition: PS3USB.h:264
+
void setLedOff()
Definition: PS3USB.h:215
+
void setBdaddr(uint8_t *bdaddr)
Definition: PS3USB.cpp:463
-
virtual uint8_t Release()
Definition: PS3USB.cpp:261
+
uint8_t Release()
Definition: PS3USB.cpp:261
bool getButtonPress(ButtonEnum b)
Definition: PS3USB.cpp:315
-
bool PS3MoveConnected
Definition: PS3USB.h:271
+
bool PS3MoveConnected
Definition: PS3USB.h:262
AnalogHatEnum
StatusEnum
Definition: PS3Enums.h:113
-
Definition: UsbCore.h:119
+
Definition: UsbCore.h:121
void getMoveBdaddr(uint8_t *bdaddr)
Definition: PS3USB.cpp:541
uint8_t getAnalogButton(ButtonEnum a)
Definition: PS3USB.cpp:326
uint16_t getSensor(SensorEnum a)
Definition: PS3USB.cpp:334
void setRumbleOff()
Definition: PS3USB.cpp:411
-
#define EP_MAXPKTSIZE
Definition: PS3USB.h:25
-
bool PS3Connected
Definition: PS3USB.h:265
+
#define EP_MAXPKTSIZE
Definition: PS3USB.h:26
+
bool PS3Connected
Definition: PS3USB.h:256
LEDEnum
-
virtual uint8_t GetAddress()
Definition: PS3USB.h:93
+
virtual uint8_t GetAddress()
Definition: PS3USB.h:84
RumbleEnum
-
void attachOnInit(void(*funcOnInit)(void))
Definition: PS3USB.h:263
+
void attachOnInit(void(*funcOnInit)(void))
Definition: PS3USB.h:254
void setLedToggle(LEDEnum a)
Definition: PS3USB.cpp:458
void moveSetBulb(uint8_t r, uint8_t g, uint8_t b)
Definition: PS3USB.cpp:502
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: PS3USB.cpp:46
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: PS3USB.cpp:46
Definition: address.h:32
void printStatusString()
Definition: PS3USB.cpp:365
void setAllOff()
Definition: PS3USB.cpp:404
ButtonEnum
-
#define PS3_PID
Definition: PS3USB.h:37
+
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: PS3USB.h:102
+
#define PS3_PID
Definition: PS3USB.h:35
uint8_t getAnalogHat(AnalogHatEnum a)
Definition: PS3USB.cpp:330
-
USB * pUsb
Definition: PS3USB.h:277
+
USB * pUsb
Definition: PS3USB.h:268
ColorsEnum
AngleEnum
double getAngle(AngleEnum a)
Definition: PS3USB.cpp:338
void moveSetRumble(uint8_t rumble)
Definition: PS3USB.cpp:515
-
virtual uint8_t Poll()
Definition: PS3USB.cpp:271
-
#define PS3MOVE_PID
Definition: PS3USB.h:39
-
#define PS3_MAX_ENDPOINTS
Definition: PS3USB.h:48
-
EpInfo epInfo[PS3_MAX_ENDPOINTS]
Definition: PS3USB.h:281
+
uint8_t Poll()
Definition: PS3USB.cpp:271
+
#define PS3MOVE_PID
Definition: PS3USB.h:37
+
#define PS3_MAX_ENDPOINTS
Definition: PS3USB.h:39
+
EpInfo epInfo[PS3_MAX_ENDPOINTS]
Definition: PS3USB.h:272
void setRumbleOn(RumbleEnum mode)
Definition: PS3USB.cpp:420
-
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: PS3USB.h:111
void setLedOn(LEDEnum a)
Definition: PS3USB.cpp:449
-
#define PS3NAVIGATION_PID
Definition: PS3USB.h:38
-
#define PS3_VID
Definition: PS3USB.h:36
-
uint8_t bAddress
Definition: PS3USB.h:279
+
#define PS3NAVIGATION_PID
Definition: PS3USB.h:36
+
#define PS3_VID
Definition: PS3USB.h:34
+
uint8_t bAddress
Definition: PS3USB.h:270
void setMoveBdaddr(uint8_t *bdaddr)
Definition: PS3USB.cpp:525
-
Definition: UsbCore.h:190
+
Definition: UsbCore.h:197
SensorEnum
PS3USB(USB *pUsb, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0)
Definition: PS3USB.cpp:23
void getMoveCalibration(uint8_t *data)
Definition: PS3USB.cpp:551
bool getStatus(StatusEnum c)
Definition: PS3USB.cpp:361
-
virtual bool isReady()
Definition: PS3USB.h:101
+
virtual bool isReady()
Definition: PS3USB.h:92
bool getButtonClick(ButtonEnum b)
Definition: PS3USB.cpp:319
diff --git a/_p_s4_b_t_8h.html b/_p_s4_b_t_8h.html index ee64645b..2ca09d29 100644 --- a/_p_s4_b_t_8h.html +++ b/_p_s4_b_t_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS4BT.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -98,7 +99,7 @@ Include dependency graph for PS4BT.h:
- +

Go to the source code of this file.

@@ -113,7 +114,7 @@ Classes diff --git a/_p_s4_b_t_8h__incl.map b/_p_s4_b_t_8h__incl.map index 5717dd5c..52b1ba70 100644 --- a/_p_s4_b_t_8h__incl.map +++ b/_p_s4_b_t_8h__incl.map @@ -1,10 +1,10 @@ - - - - - - - - + + + + + + + + diff --git a/_p_s4_b_t_8h__incl.md5 b/_p_s4_b_t_8h__incl.md5 index 2832c4ad..3ce4b4b2 100644 --- a/_p_s4_b_t_8h__incl.md5 +++ b/_p_s4_b_t_8h__incl.md5 @@ -1 +1 @@ -105dd8723b891d12cb3a66169e6fa9c1 \ No newline at end of file +ce812a189234822fb9d18733d5d06169 \ No newline at end of file diff --git a/_p_s4_b_t_8h__incl.png b/_p_s4_b_t_8h__incl.png index 5858851f..37f3d228 100644 Binary files a/_p_s4_b_t_8h__incl.png and b/_p_s4_b_t_8h__incl.png differ diff --git a/_p_s4_b_t_8h_source.html b/_p_s4_b_t_8h_source.html index 55dd551a..2b8eb546 100644 --- a/_p_s4_b_t_8h_source.html +++ b/_p_s4_b_t_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS4BT.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -123,106 +124,100 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
46  return BTHID::connected;
47  };
48 
-
53  void attachOnInit(void (*funcOnInit)(void)) {
-
54  pFuncOnInit = funcOnInit;
-
55  };
-
56 
-
57 protected:
-
64  virtual void ParseBTHIDData(uint8_t len, uint8_t *buf) {
-
65  PS4Parser::Parse(len, buf);
-
66  };
-
67 
-
73  virtual void OnInitBTHID() {
-
74  PS4Parser::Reset();
-
75  enable_sixaxis(); // Make the controller send out the entire output report
-
76  if (pFuncOnInit)
-
77  pFuncOnInit(); // Call the user function
-
78  else
-
79  setLed(Blue);
-
80  };
-
81 
-
83  virtual void ResetBTHID() {
-
84  PS4Parser::Reset();
-
85  };
-
89  virtual void sendOutputReport(PS4Output *output) { // Source: https://github.com/chrippa/ds4drv
-
90  uint8_t buf[79];
-
91  memset(buf, 0, sizeof(buf));
+
49 protected:
+
56  virtual void ParseBTHIDData(uint8_t len, uint8_t *buf) {
+
57  PS4Parser::Parse(len, buf);
+
58  };
+
59 
+
65  virtual void OnInitBTHID() {
+
66  PS4Parser::Reset();
+
67  enable_sixaxis(); // Make the controller send out the entire output report
+
68  if (pFuncOnInit)
+
69  pFuncOnInit(); // Call the user function
+
70  else
+
71  setLed(Blue);
+
72  };
+
73 
+
75  virtual void ResetBTHID() {
+
76  PS4Parser::Reset();
+
77  };
+
81  virtual void sendOutputReport(PS4Output *output) { // Source: https://github.com/chrippa/ds4drv
+
82  uint8_t buf[79];
+
83  memset(buf, 0, sizeof(buf));
+
84 
+
85  buf[0] = 0x52; // HID BT Set_report (0x50) | Report Type (Output 0x02)
+
86  buf[1] = 0x11; // Report ID
+
87  buf[2] = 0x80;
+
88  buf[4]= 0xFF;
+
89 
+
90  buf[7] = output->smallRumble; // Small Rumble
+
91  buf[8] = output->bigRumble; // Big rumble
92 
-
93  buf[0] = 0x52; // HID BT Set_report (0x50) | Report Type (Output 0x02)
-
94  buf[1] = 0x11; // Report ID
-
95  buf[2] = 0x80;
-
96  buf[4]= 0xFF;
-
97 
-
98  buf[7] = output->smallRumble; // Small Rumble
-
99  buf[8] = output->bigRumble; // Big rumble
-
100 
-
101  buf[9] = output->r; // Red
-
102  buf[10] = output->g; // Green
-
103  buf[11] = output->b; // Blue
-
104 
-
105  buf[12] = output->flashOn; // Time to flash bright (255 = 2.5 seconds)
-
106  buf[13] = output->flashOff; // Time to flash dark (255 = 2.5 seconds)
-
107 
-
108  output->reportChanged = false;
-
109 
-
110  // The PS4 console actually set the four last bytes to a CRC32 checksum, but it seems like it is actually not needed
-
111 
-
112  HID_Command(buf, sizeof(buf));
-
113  };
-
116 private:
-
117  void enable_sixaxis() { // Command used to make the PS4 controller send out the entire output report
-
118  uint8_t buf[2];
-
119  buf[0] = 0x43; // HID BT Get_report (0x40) | Report Type (Feature 0x03)
-
120  buf[1] = 0x02; // Report ID
-
121 
-
122  HID_Command(buf, 2);
-
123  };
-
124 
-
125  void HID_Command(uint8_t *data, uint8_t nbytes) {
-
126  pBtd->L2CAP_Command(hci_handle, data, nbytes, control_scid[0], control_scid[1]);
-
127  };
-
128 
-
129  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
-
130 };
-
131 #endif
+
93  buf[9] = output->r; // Red
+
94  buf[10] = output->g; // Green
+
95  buf[11] = output->b; // Blue
+
96 
+
97  buf[12] = output->flashOn; // Time to flash bright (255 = 2.5 seconds)
+
98  buf[13] = output->flashOff; // Time to flash dark (255 = 2.5 seconds)
+
99 
+
100  output->reportChanged = false;
+
101 
+
102  // The PS4 console actually set the four last bytes to a CRC32 checksum, but it seems like it is actually not needed
+
103 
+
104  HID_Command(buf, sizeof(buf));
+
105  };
+
108 private:
+
109  void enable_sixaxis() { // Command used to make the PS4 controller send out the entire output report
+
110  uint8_t buf[2];
+
111  buf[0] = 0x43; // HID BT Get_report (0x40) | Report Type (Feature 0x03)
+
112  buf[1] = 0x02; // Report ID
+
113 
+
114  HID_Command(buf, 2);
+
115  };
+
116 
+
117  void HID_Command(uint8_t *data, uint8_t nbytes) {
+
118  pBtd->L2CAP_Command(hci_handle, data, nbytes, control_scid[0], control_scid[1]);
+
119  };
+
120 };
+
121 #endif
void Reset()
Definition: PS4Parser.h:369
-
Definition: BTD.h:230
+
Definition: BTD.h:198
uint8_t b
Definition: PS4Parser.h:118
void setLed(uint8_t r, uint8_t g, uint8_t b)
Definition: PS4Parser.h:333
bool connected()
Definition: PS4BT.h:45
-
bool connected
Definition: BTHID.h:92
+
bool connected
Definition: BTHID.h:83
uint8_t flashOn
Definition: PS4Parser.h:119
Definition: PS4Parser.h:116
-
void attachOnInit(void(*funcOnInit)(void))
Definition: PS4BT.h:53
-
uint8_t control_scid[2]
Definition: BTHID.h:136
+
uint8_t control_scid[2]
Definition: BTHID.h:134
uint8_t g
Definition: PS4Parser.h:118
bool reportChanged
Definition: PS4Parser.h:120
void Parse(uint8_t len, uint8_t *buf)
Definition: PS4Parser.cpp:64
uint8_t r
Definition: PS4Parser.h:118
-
virtual void ParseBTHIDData(uint8_t len, uint8_t *buf)
Definition: PS4BT.h:64
+
virtual void ParseBTHIDData(uint8_t len, uint8_t *buf)
Definition: PS4BT.h:56
uint8_t bigRumble
Definition: PS4Parser.h:117
uint8_t flashOff
Definition: PS4Parser.h:119
-
BTD * pBtd
Definition: BTHID.h:129
+
void(* pFuncOnInit)(void)
Definition: BTD.h:603
uint8_t smallRumble
Definition: PS4Parser.h:117
Definition: PS4Parser.h:136
-
uint16_t hci_handle
Definition: BTHID.h:132
-
virtual void sendOutputReport(PS4Output *output)
Definition: PS4BT.h:89
-
virtual void ResetBTHID()
Definition: PS4BT.h:83
+
virtual void sendOutputReport(PS4Output *output)
Definition: PS4BT.h:81
+
BTD * pBtd
Definition: BTD.h:606
+
virtual void ResetBTHID()
Definition: PS4BT.h:75
PS4BT(BTD *p, bool pair=false, const char *pin="0000")
Definition: PS4BT.h:36
-
virtual void OnInitBTHID()
Definition: PS4BT.h:73
-
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1190
+
uint16_t hci_handle
Definition: BTD.h:609
+
virtual void OnInitBTHID()
Definition: PS4BT.h:65
+
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1198
Definition: BTHID.h:29
-
void pair(void)
Definition: BTHID.h:95
+
void pair(void)
Definition: BTHID.h:86
Definition: PS4BT.h:28
diff --git a/_p_s4_parser_8cpp.html b/_p_s4_parser_8cpp.html index cd76ff3c..09fca10a 100644 --- a/_p_s4_parser_8cpp.html +++ b/_p_s4_parser_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS4Parser.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -104,7 +105,7 @@ Include dependency graph for PS4Parser.cpp:
diff --git a/_p_s4_parser_8cpp__incl.md5 b/_p_s4_parser_8cpp__incl.md5 index b54e7156..1f9ffe4e 100644 --- a/_p_s4_parser_8cpp__incl.md5 +++ b/_p_s4_parser_8cpp__incl.md5 @@ -1 +1 @@ -7b7a6c8921078ff071fc05959848bb21 \ No newline at end of file +03082f2d3fd4c67e7d5789f05b2dd70a \ No newline at end of file diff --git a/_p_s4_parser_8cpp_source.html b/_p_s4_parser_8cpp_source.html index 8bf83b8d..d7e9493c 100644 --- a/_p_s4_parser_8cpp_source.html +++ b/_p_s4_parser_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS4Parser.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -130,11 +131,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
39  if (b <= LEFT) // Dpad
40  return checkDpad(b);
41  else
-
42  return ps4Data.btn.val & (1UL << pgm_read_byte(&PS4_BUTTONS[(uint8_t)b]));
+
42  return ps4Data.btn.val & (1UL << pgm_read_byte(&PS4_BUTTONS[(uint8_t)b]));
43 }
44 
45 bool PS4Parser::getButtonClick(ButtonEnum b) {
-
46  uint32_t mask = 1UL << pgm_read_byte(&PS4_BUTTONS[(uint8_t)b]);
+
46  uint32_t mask = 1UL << pgm_read_byte(&PS4_BUTTONS[(uint8_t)b]);
47  bool click = buttonClickState.val & mask;
48  buttonClickState.val &= ~mask; // Clear "click" event
49  return click;
@@ -155,10 +156,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
64 void PS4Parser::Parse(uint8_t len, uint8_t *buf) {
65  if (len > 0 && buf) {
66 #ifdef PRINTREPORT
-
67  Notify(PSTR("\r\n"), 0x80);
+
67  Notify(PSTR("\r\n"), 0x80);
68  for (uint8_t i = 0; i < len; i++) {
69  D_PrintHex<uint8_t > (buf[i], 0x80);
-
70  Notify(PSTR(" "), 0x80);
+
70  Notify(PSTR(" "), 0x80);
71  }
72 #endif
73 
@@ -168,7 +169,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
77  memcpy(&ps4Data, buf + 3, min(len - 3, sizeof(ps4Data)));
78  else {
79 #ifdef DEBUG_USB_HOST
-
80  Notify(PSTR("\r\nUnknown report id: "), 0x80);
+
80  Notify(PSTR("\r\nUnknown report id: "), 0x80);
81  D_PrintHex<uint8_t > (buf[0], 0x80);
82 #endif
83  return;
@@ -205,6 +206,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
bool getButtonPress(ButtonEnum b)
Definition: PS4Parser.cpp:38
AnalogHatEnum
Definition: PS4Parser.h:128
+
#define pgm_read_byte(addr)
Definition: PS4Parser.h:125
@@ -219,6 +221,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
virtual void sendOutputReport(PS4Output *output)=0
+
#define PSTR(str)
uint8_t dpad
Definition: PS4Parser.h:52
Definition: PS4Parser.h:124
Definition: PS4Parser.h:131
@@ -234,7 +237,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/_p_s4_parser_8h.html b/_p_s4_parser_8h.html index 2d989f52..4bdba7d9 100644 --- a/_p_s4_parser_8h.html +++ b/_p_s4_parser_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS4Parser.h File Reference + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -234,7 +235,7 @@ Variables diff --git a/_p_s4_parser_8h__dep__incl.md5 b/_p_s4_parser_8h__dep__incl.md5 index 8fd62cc2..2dc29627 100644 --- a/_p_s4_parser_8h__dep__incl.md5 +++ b/_p_s4_parser_8h__dep__incl.md5 @@ -1 +1 @@ -5e56bd64aa04badca5d0648201af05fb \ No newline at end of file +4d5a405a295dec480becbdb408726c5e \ No newline at end of file diff --git a/_p_s4_parser_8h__incl.md5 b/_p_s4_parser_8h__incl.md5 index 493b39f0..a7437e13 100644 --- a/_p_s4_parser_8h__incl.md5 +++ b/_p_s4_parser_8h__incl.md5 @@ -1 +1 @@ -559da26f56bdca12a84aceb0d7a5a74b \ No newline at end of file +29a4989044a63001a938d41ea83d3491 \ No newline at end of file diff --git a/_p_s4_parser_8h_source.html b/_p_s4_parser_8h_source.html index 2c44298a..1ede2be6 100644 --- a/_p_s4_parser_8h_source.html +++ b/_p_s4_parser_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS4Parser.h Source File + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -168,7 +169,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
78  uint8_t touching : 1; // The top bit is cleared if the finger is touching the touchpad
79  uint16_t x : 12;
80  uint16_t y : 12;
-
81  } __attribute__((packed)) finger[2]; // 0 = first finger, 1 = second finger
+
81  } __attribute__((packed)) finger[2]; // 0 = first finger, 1 = second finger
82 } __attribute__((packed));
83 
84 struct PS4Status {
@@ -186,7 +187,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
96  uint8_t trigger[2];
97 
98  /* Gyro and accelerometer values */
-
99  uint8_t dummy[3]; // First two looks random, while the third one might be some kind of status - it increments once in a while
+
99  uint8_t dummy[3]; // First two looks random, while the third one might be some kind of status - it increments once in a while
100  int16_t gyroY, gyroZ, gyroX;
101  int16_t accX, accZ, accY;
102 
@@ -234,20 +235,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
167 
173  uint8_t getAnalogHat(AnalogHatEnum a);
174 
-
183  uint16_t getX(uint8_t finger = 0, uint8_t xyId = 0) {
-
184  return ps4Data.xy[xyId].finger[finger].x;
+
183  uint16_t getX(uint8_t finger = 0, uint8_t xyId = 0) {
+
184  return ps4Data.xy[xyId].finger[finger].x;
185  };
186 
-
195  uint16_t getY(uint8_t finger = 0, uint8_t xyId = 0) {
-
196  return ps4Data.xy[xyId].finger[finger].y;
+
195  uint16_t getY(uint8_t finger = 0, uint8_t xyId = 0) {
+
196  return ps4Data.xy[xyId].finger[finger].y;
197  };
198 
-
207  bool isTouching(uint8_t finger = 0, uint8_t xyId = 0) {
-
208  return !(ps4Data.xy[xyId].finger[finger].touching); // The bit is cleared when a finger is touching the touchpad
+
207  bool isTouching(uint8_t finger = 0, uint8_t xyId = 0) {
+
208  return !(ps4Data.xy[xyId].finger[finger].touching); // The bit is cleared when a finger is touching the touchpad
209  };
210 
-
219  uint8_t getTouchCounter(uint8_t finger = 0, uint8_t xyId = 0) {
-
220  return ps4Data.xy[xyId].finger[finger].counter;
+
219  uint8_t getTouchCounter(uint8_t finger = 0, uint8_t xyId = 0) {
+
220  return ps4Data.xy[xyId].finger[finger].counter;
221  };
222 
228  double getAngle(AngleEnum a) {
@@ -397,6 +398,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
int16_t getSensor(SensorEnum s)
Definition: PS4Parser.h:240
uint8_t flashOn
Definition: PS4Parser.h:119
Definition: PS4Parser.h:116
+
struct touchpadXY::@28 finger[2]
Definition: PS4Parser.h:125
uint8_t share
Definition: PS4Parser.h:62
@@ -416,9 +418,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
uint8_t counter
Definition: PS4Parser.h:77
uint16_t y
Definition: PS4Parser.h:80
-
struct touchpadXY::@24 finger[2]
Definition: PS4Parser.h:129
-
Definition: cdcprolific.h:108
+
Definition: cdcprolific.h:111
const uint8_t PS4_BUTTONS[]
Definition: PS4Parser.h:25
ButtonEnum
@@ -466,7 +467,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/_p_s4_u_s_b_8h.html b/_p_s4_u_s_b_8h.html index 210d3b47..c9eaff41 100644 --- a/_p_s4_u_s_b_8h.html +++ b/_p_s4_u_s_b_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS4USB.h File Reference + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -150,7 +151,7 @@ Macros diff --git a/_p_s4_u_s_b_8h__incl.md5 b/_p_s4_u_s_b_8h__incl.md5 index d7a615bc..d7aff3fd 100644 --- a/_p_s4_u_s_b_8h__incl.md5 +++ b/_p_s4_u_s_b_8h__incl.md5 @@ -1 +1 @@ -c126bc79f3d87f6f416ad192609a96de \ No newline at end of file +6f7decca24cb5b3cb9ff8a80c692ad10 \ No newline at end of file diff --git a/_p_s4_u_s_b_8h_source.html b/_p_s4_u_s_b_8h_source.html index b13f740e..82fbec07 100644 --- a/_p_s4_u_s_b_8h_source.html +++ b/_p_s4_u_s_b_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS4USB.h Source File + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -169,11 +170,15 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
110 
111  pUsb->outTransfer(bAddress, epInfo[ hidInterfaces[0].epIndex[epInterruptOutIndex] ].epAddr, sizeof(buf), buf);
112  };
-
115 private:
-
116  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
-
117 };
-
118 #endif
+
122  virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
+
123  return (vid == PS4_VID && pid == PS4_PID);
+
124  };
+
127 private:
+
128  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
+
129 };
+
130 #endif
uint16_t PID
Definition: hiduniversal.h:69
+
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: PS4USB.h:122
void Reset()
Definition: PS4Parser.h:369
void attachOnInit(void(*funcOnInit)(void))
Definition: PS4USB.h:54
virtual bool isReady()
Definition: hiduniversal.h:97
@@ -207,7 +212,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
USB * pUsb
Definition: hid.h:145
virtual void sendOutputReport(PS4Output *output)
Definition: PS4USB.h:90
PS4USB(USB *p)
Definition: PS4USB.h:37
-
Definition: UsbCore.h:190
+
Definition: UsbCore.h:197
EpInfo epInfo[totalEndpoints]
Definition: hiduniversal.h:64
Definition: hiduniversal.h:24
@@ -215,7 +220,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/_p_s_buzz_8cpp.html b/_p_s_buzz_8cpp.html index 06b27a88..72e319fb 100644 --- a/_p_s_buzz_8cpp.html +++ b/_p_s_buzz_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PSBuzz.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -104,7 +105,7 @@ Include dependency graph for PSBuzz.cpp:
diff --git a/_p_s_buzz_8cpp__incl.md5 b/_p_s_buzz_8cpp__incl.md5 index 3e3ab755..b621778d 100644 --- a/_p_s_buzz_8cpp__incl.md5 +++ b/_p_s_buzz_8cpp__incl.md5 @@ -1 +1 @@ -548c6cb3bb73f0de55b17214908e97c2 \ No newline at end of file +ccb27c87a7828cc31b6f06794277dee5 \ No newline at end of file diff --git a/_p_s_buzz_8cpp_source.html b/_p_s_buzz_8cpp_source.html index b737f5a3..0eed6634 100644 --- a/_p_s_buzz_8cpp_source.html +++ b/_p_s_buzz_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PSBuzz.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -114,10 +115,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
23 void PSBuzz::ParseHIDData(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) {
24  if (HIDUniversal::VID == PSBUZZ_VID && HIDUniversal::PID == PSBUZZ_PID && len > 0 && buf) {
25 #ifdef PRINTREPORT
-
26  Notify(PSTR("\r\n"), 0x80);
+
26  Notify(PSTR("\r\n"), 0x80);
27  for (uint8_t i = 0; i < len; i++) {
28  D_PrintHex<uint8_t > (buf[i], 0x80);
-
29  Notify(PSTR(" "), 0x80);
+
29  Notify(PSTR(" "), 0x80);
30  }
31 #endif
32  memcpy(&psbuzzButtons, buf + 2, min(len - 2, sizeof(psbuzzButtons)));
@@ -169,27 +170,28 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
78 
79 void PSBuzz::PSBuzz_Command(uint8_t *data, uint16_t nbytes) {
80  // bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x00), Report Type (Output 0x02), interface (0x00), datalength, datalength, data)
-
81  pUsb->ctrlReq(bAddress, epInfo[0].epAddr, bmREQ_HIDOUT, HID_REQUEST_SET_REPORT, 0x00, 0x02, 0x00, nbytes, nbytes, data, NULL);
+
81  pUsb->ctrlReq(bAddress, epInfo[0].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x00, 0x02, 0x00, nbytes, nbytes, data, NULL);
82 };
uint16_t PID
Definition: hiduniversal.h:69
void Reset()
Definition: PSBuzz.h:157
-
#define bmREQ_HIDOUT
Definition: hid.h:63
+
#define HID_REQUEST_SET_REPORT
Definition: hid.h:72
bool getButtonClick(ButtonEnum b, uint8_t controller=0)
Definition: PSBuzz.cpp:56
+
#define bmREQ_HID_OUT
Definition: hid.h:63
uint8_t bAddress
Definition: hid.h:146
uint16_t VID
Definition: hiduniversal.h:69
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
Definition: Usb.cpp:126
#define Notify(...)
Definition: message.h:44
bool getButtonPress(ButtonEnum b, uint8_t controller=0)
Definition: PSBuzz.cpp:52
-
virtual void ParseHIDData(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
Definition: PSBuzz.cpp:23
+
void ParseHIDData(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
Definition: PSBuzz.cpp:23
#define PSBUZZ_VID
Definition: PSBuzz.h:24
ButtonEnum
#define PSBUZZ_PID
Definition: PSBuzz.h:25
Definition: hid.h:143
-
#define HID_REQUEST_SET_REPORT
Definition: BTD.h:39
void setLedRaw(bool value, uint8_t controller=0)
Definition: PSBuzz.cpp:64
+
#define PSTR(str)
USB * pUsb
Definition: hid.h:145
-
virtual uint8_t OnInitSuccessful()
Definition: PSBuzz.cpp:41
+
uint8_t OnInitSuccessful()
Definition: PSBuzz.cpp:41
void setLedOnAll()
Definition: PSBuzz.h:114
uint32_t val
Definition: PSBuzz.h:36
EpInfo epInfo[totalEndpoints]
Definition: hiduniversal.h:64
@@ -198,7 +200,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/_p_s_buzz_8h.html b/_p_s_buzz_8h.html index 228cd2a4..07ba6a88 100644 --- a/_p_s_buzz_8h.html +++ b/_p_s_buzz_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PSBuzz.h File Reference + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -159,7 +160,7 @@ Macros diff --git a/_p_s_buzz_8h__dep__incl.md5 b/_p_s_buzz_8h__dep__incl.md5 index c02fe703..5caa0d46 100644 --- a/_p_s_buzz_8h__dep__incl.md5 +++ b/_p_s_buzz_8h__dep__incl.md5 @@ -1 +1 @@ -b1edc92eb077ae74eaa6c13520327464 \ No newline at end of file +88928a152c2f379aa7b4a52bc6f3da10 \ No newline at end of file diff --git a/_p_s_buzz_8h__incl.md5 b/_p_s_buzz_8h__incl.md5 index fe1524ac..0cb4c14d 100644 --- a/_p_s_buzz_8h__incl.md5 +++ b/_p_s_buzz_8h__incl.md5 @@ -1 +1 @@ -1a6703ad2b9e33f56caa9fc30e3e4491 \ No newline at end of file +63019066017967cce826893baf0f58e6 \ No newline at end of file diff --git a/_p_s_buzz_8h_source.html b/_p_s_buzz_8h_source.html index fc4f3da8..7cd051e1 100644 --- a/_p_s_buzz_8h_source.html +++ b/_p_s_buzz_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PSBuzz.h Source File + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -122,7 +123,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
32  uint8_t green : 1;
33  uint8_t orange : 1;
34  uint8_t blue : 1;
-
35  } __attribute__((packed)) btn[4];
+
35  } __attribute__((packed)) btn[4];
36  uint32_t val : 20;
37 } __attribute__((packed));
38 
@@ -170,9 +171,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
133  setLedRaw(!ledState[controller], controller);
134  };
137 protected:
-
146  virtual void ParseHIDData(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf);
+
146  void ParseHIDData(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf);
147 
-
153  virtual uint8_t OnInitSuccessful();
+
153  uint8_t OnInitSuccessful();
157  void Reset() {
158  psbuzzButtons.val = 0;
159  oldButtonState.val = 0;
@@ -181,7 +182,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
162  ledState[i] = 0;
163  };
164 
-
172  virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
+
172  virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
173  return (vid == PSBUZZ_VID && pid == PSBUZZ_PID);
174  };
177 private:
@@ -195,6 +196,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
185 #endif
uint16_t PID
Definition: hiduniversal.h:69
uint8_t red
Definition: PSBuzz.h:30
+
struct PSBUZZButtons::@29 btn[4]
void setLedToggle(uint8_t controller=0)
Definition: PSBuzz.h:132
void attachOnInit(void(*funcOnInit)(void))
Definition: PSBuzz.h:66
virtual bool isReady()
Definition: hiduniversal.h:97
@@ -211,15 +213,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
#define PSBUZZ_PID
Definition: PSBuzz.h:25
uint8_t yellow
Definition: PSBuzz.h:31
Definition: hid.h:143
+
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: PSBuzz.h:172
void setLedOff(uint8_t controller=0)
Definition: PSBuzz.h:108
PSBuzz(USB *p)
Definition: PSBuzz.h:49
void setLedOnAll()
Definition: PSBuzz.h:114
-
Definition: UsbCore.h:190
+
Definition: UsbCore.h:197
void setLedOn(uint8_t controller=0)
Definition: PSBuzz.h:124
uint32_t val
Definition: PSBuzz.h:36
-
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: PSBuzz.h:172
-
struct PSBUZZButtons::@25 btn[4]
uint8_t orange
Definition: PSBuzz.h:33
void setLedOffAll()
Definition: PSBuzz.h:98
Definition: hiduniversal.h:24
@@ -228,7 +229,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/_r_e_a_d_m_e_8md.html b/_r_e_a_d_m_e_8md.html index 2d26d51c..065ae20d 100644 --- a/_r_e_a_d_m_e_8md.html +++ b/_r_e_a_d_m_e_8md.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: README.md File Reference + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -92,7 +93,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/_r_e_a_d_m_e_8md_source.html b/_r_e_a_d_m_e_8md_source.html index cd5261a5..2b9f1f3e 100644 --- a/_r_e_a_d_m_e_8md_source.html +++ b/_r_e_a_d_m_e_8md_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: README.md Source File + @@ -31,7 +32,7 @@
- + @@ -71,7 +72,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -85,275 +86,351 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
README.md
-Go to the documentation of this file.
1 # USB Host Library Rev.2.0
+Go to the documentation of this file.
1 # USB Host Library Rev.2.0
2 
3 The code is released under the GNU General Public License.
4 __________
5 
-
6 # Summary
-
7 This is Revision 2.0 of MAX3421E-based USB Host Shield Library for AVR's.
-
8 
-
9 Project main web site is: <http://www.circuitsathome.com>.
-
10 
-
11 Some information can also be found at: <http://blog.tkjelectronics.dk/>.
-
12 
-
13 The shield can be purchased at the main site: <http://www.circuitsathome.com/products-page/arduino-shields> or from [TKJ Electronics](http://tkjelectronics.com/): <http://shop.tkjelectronics.dk/product_info.php?products_id=43>.
-
14 
-
15 ![USB Host Shield](http://www.circuitsathome.com/wp/wp-content/uploads/2012/02/UHS_20_main-288x216.jpg)
-
16 
-
17 For more information about the hardware see the [Hardware Manual](http://www.circuitsathome.com/usb-host-shield-hardware-manual).
-
18 
-
19 # Developed By
-
20 
-
21 * __Oleg Mazurov, Circuits\@Home__ - <mazurov@circuitsathome.com>
-
22 * __Alexei Glushchenko, Circuits\@Home__ - <alex-gl@mail.ru>
-
23  * Developers of the USB Core, HID, FTDI, ADK, ACM, and PL2303 libraries
-
24 * __Kristian Lauszus, TKJ Electronics__ - <kristianl@tkjelectronics.com>
-
25  * Developer of the [BTD](#bluetooth-libraries), [BTHID](#bthid-library), [SPP](#spp-library), [PS4](#ps4-library), [PS3](#ps3-library), [Wii](#wii-library), [Xbox](#xbox-library), and [PSBuzz](#ps-buzz-library) libraries
-
26 * __Andrew Kroll__ - <xxxajk@gmail.com>
-
27  * Major contributor to mass storage code
-
28 
-
29 # How to include the library
-
30 
-
31 First download the library by clicking on the following link: <https://github.com/felis/USB_Host_Shield_2.0/archive/master.zip>.
-
32 
-
33 Then uncompress the zip folder and rename the directory to "USB\_Host\_Shield\_20", as any special characters are not supported by the Arduino IDE.
-
34 
-
35 Now open up the Arduino IDE and open "File>Preferences". There you will see the location of your sketchbook. Open that directory and create a directory called "libraries" inside that directory.
-
36 Now move the "USB\_Host\_Shield\_20" directory to the "libraries" directory.
-
37 
-
38 The final structure should look like this:
-
39 
-
40 * Arduino/
-
41  * libraries/
-
42  * USB\_Host\_Shield\_20/
-
43 
-
44 Now quit the Arduino IDE and reopen it.
-
45 
-
46 Now you should be able to go open all the examples codes by navigating to "File>Examples>USB\_Host\_Shield\_20" and then select the example you will like to open.
-
47 
-
48 For more information visit the following site: <http://arduino.cc/en/Guide/Libraries>.
-
49 
-
50 # How to use the library
-
51 
-
52 ### Documentation
-
53 
-
54 Documentation for the library can be found at the following link: <http://felis.github.com/USB_Host_Shield_2.0/>.
-
55 
-
56 ### Enable debugging
-
57 
-
58 By default serial debugging is disabled. To turn it on simply change ```ENABLE_UHS_DEBUGGING``` to 1 in [settings.h](settings.h) like so:
-
59 
-
60 ```C++
-
61 #define ENABLE_UHS_DEBUGGING 1
-
62 ```
-
63 
-
64 ### Boards
-
65 
-
66 Currently the following boards are supported by the library:
-
67 
-
68 * All official Arduino AVR boards (Uno, Duemilanove, Mega, Mega 2560, Mega ADK, Leonardo etc.)
-
69 * Arduino Due
-
70  * If you are using the Arduino Due, then you must include the Arduino SPI library like so: ```#include <SPI.h>``` in your .ino file.
-
71 * Teensy (Teensy++ 1.0, Teensy 2.0, Teensy++ 2.0, and Teensy 3.x)
-
72  * Note if you are using the Teensy 3.x you should download this SPI library as well: <https://github.com/xxxajk/spi4teensy3>. You should then add ```#include <spi4teensy3.h>``` to your .ino file.
-
73 * Balanduino
-
74 * Sanguino
-
75 * Black Widdow
-
76 
-
77 The following boards need to be activated manually in [settings.h](settings.h):
-
78 
-
79 * Arduino Mega ADK
-
80  * If you are using Arduino 1.5.5 or newer there is no need to activate the Arduino Mega ADK manually
-
81 * Black Widdow
-
82 
-
83 Simply set the corresponding value to 1 instead of 0.
-
84 
-
85 ### [Bluetooth libraries](BTD.cpp)
-
86 
-
87 The [BTD library](BTD.cpp) is a general purpose library for an ordinary Bluetooth dongle.
-
88 This library make it easy to add support for different Bluetooth services like a PS3 or a Wii controller or SPP which is a virtual serial port via Bluetooth.
-
89 Some different examples can be found in the [example directory](examples/Bluetooth).
-
90 
-
91 The BTD library also makes it possible to use multiple services at once, the following example sketch is an example of this:
-
92 [PS3SPP.ino](examples/Bluetooth/PS3SPP/PS3SPP.ino).
-
93 
-
94 ### [BTHID library](BTHID.cpp)
-
95 
-
96 The [Bluetooth HID library](BTHID.cpp) allows you to connect HID devices via Bluetooth to the USB Host Shield.
-
97 
-
98 Currently HID mice and keyboards are supported.
-
99 
-
100 It uses the standard Boot protocol by default, but it is also able to use the Report protocol as well. You would simply have to call ```setProtocolMode()``` and then parse ```HID_RPT_PROTOCOL``` as an argument. You will then have to modify the parser for your device. See the example: [BTHID.ino](examples/Bluetooth/BTHID/BTHID.ino) for more information.
-
101 
-
102 The [PS4 library](#ps4-library) also uses this class to handle all Bluetooth communication.
-
103 
-
104 For information see the following blog post: <http://blog.tkjelectronics.dk/2013/12/bluetooth-hid-devices-now-supported-by-the-usb-host-library/>.
-
105 
-
106 ### [SPP library](SPP.cpp)
-
107 
-
108 SPP stands for "Serial Port Profile" and is a Bluetooth protocol that implements a virtual comport which allows you to send data back and forth from your computer/phone to your Arduino via Bluetooth.
-
109 It has been tested successfully on Windows, Mac OS X, Linux, and Android.
-
110 
-
111 Take a look at the [SPP.ino](examples/Bluetooth/SPP/SPP.ino) example for more information.
-
112 
-
113 More information can be found at these blog posts:
-
114 
-
115 * <http://www.circuitsathome.com/mcu/bluetooth-rfcommspp-service-support-for-usb-host-2-0-library-released>
-
116 * <http://blog.tkjelectronics.dk/2012/07/rfcommspp-library-for-arduino/>
-
117 
-
118 To implement the SPP protocol I used a Bluetooth sniffing tool called [PacketLogger](http://www.tkjelectronics.com/uploads/PacketLogger.zip) developed by Apple.
-
119 It enables me to see the Bluetooth communication between my Mac and any device.
-
120 
-
121 ### PS4 Library
-
122 
-
123 The PS4BT library is split up into the [PS4BT](PS4BT.h) and the [PS4USB](PS4USB.h) library. These allow you to use the Sony PS4 controller via Bluetooth and USB.
-
124 
-
125 The [PS4BT.ino](examples/Bluetooth/PS4BT/PS4BT.ino) and [PS4USB.ino](examples/PS4USB/PS4USB.ino) examples shows how to easily read the buttons, joysticks, touchpad and IMU on the controller via Bluetooth and USB respectively. It is also possible to control the rumble and light on the controller and get the battery level.
-
126 
-
127 Before you can use the PS4 controller via Bluetooth you will need to pair with it.
-
128 
-
129 Simply create the PS4BT instance like so: ```PS4BT PS4(&Btd, PAIR);``` and then hold down the Share button and then hold down the PS without releasing the Share button. The PS4 controller will then start to blink rapidly indicating that it is in paring mode.
-
130 
-
131 It should then automatically pair the dongle with your controller. This only have to be done once.
-
132 
-
133 For information see the following blog post: <http://blog.tkjelectronics.dk/2014/01/ps4-controller-now-supported-by-the-usb-host-library/>.
-
134 
-
135 Also check out this excellent Wiki by Frank Zhao about the PS4 controller: <http://eleccelerator.com/wiki/index.php?title=DualShock_4> and this Linux driver: <https://github.com/chrippa/ds4drv>.
-
136 
-
137 ### PS3 Library
-
138 
-
139 These libraries consist of the [PS3BT](PS3BT.cpp) and [PS3USB](PS3USB.cpp). These libraries allows you to use a Dualshock 3, Navigation or a Motion controller with the USB Host Shield both via Bluetooth and USB.
-
140 
-
141 In order to use your Playstation controller via Bluetooth you have to set the Bluetooth address of the dongle internally to your PS3 Controller. This can be achieved by first plugging in the Bluetooth dongle and wait a few seconds. Now plug in the controller via USB and wait until the LEDs start to flash. The library has now written the Bluetooth address of the dongle to the PS3 controller.
-
142 
-
143 Finally simply plug in the Bluetooth dongle again and press PS on the PS3 controller. After a few seconds it should be connected to the dongle and ready to use.
-
144 
-
145 __Note:__ You will have to plug in the Bluetooth dongle before connecting the controller, as the library needs to read the address of the dongle. Alternatively you could set it in code like so: [PS3BT.ino#L20](examples/Bluetooth/PS3BT/PS3BT.ino#L20).
-
146 
-
147 For more information about the PS3 protocol see the official wiki: <https://github.com/felis/USB_Host_Shield_2.0/wiki/PS3-Information>.
-
148 
-
149 Also take a look at the blog posts:
-
150 
-
151 * <http://blog.tkjelectronics.dk/2012/01/ps3-controller-bt-library-for-arduino/>
-
152 * <http://www.circuitsathome.com/mcu/sony-ps3-controller-support-added-to-usb-host-library>
-
153 * <http://www.circuitsathome.com/mcu/arduino/interfacing-ps3-controllers-via-usb>
-
154 
-
155 A special thanks go to the following people:
-
156 
-
157 1. _Richard Ibbotson_ who made this excellent guide: <http://www.circuitsathome.com/mcu/ps3-and-wiimote-game-controllers-on-the-arduino-host-shield-part>
-
158 2. _Tomoyuki Tanaka_ for releasing his code for the Arduino USB Host shield connected to the wiimote: <http://www.circuitsathome.com/mcu/rc-car-controlled-by-wii-remote-on-arduino>
-
159 
-
160 Also a big thanks all the people behind these sites about the Motion controller:
-
161 
-
162 * <http://thp.io/2010/psmove/>
-
163 * <http://www.copenhagengamecollective.org/unimove/>
-
164 * <https://github.com/thp/psmoveapi>
-
165 * <http://code.google.com/p/moveonpc/>
-
166 
-
167 ### Xbox Libraries
-
168 
-
169 The library supports both the original Xbox controller via USB and the Xbox 360 controller both via USB and wirelessly.
-
170 
-
171 #### Xbox library
-
172 
-
173 The [XBOXOLD](XBOXOLD.cpp) class implements support for the original Xbox controller via USB.
-
174 
-
175 All the information are from the following sites:
-
176 
-
177 * <https://github.com/torvalds/linux/blob/master/Documentation/input/xpad.txt>
-
178 * <https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c>
-
179 * <http://euc.jp/periphs/xbox-controller.ja.html>
-
180 * <https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL#L15>
-
181 
-
182 #### Xbox 360 Library
-
183 
-
184 The library support one Xbox 360 via USB or up to four Xbox 360 controllers wirelessly by using a [Xbox 360 wireless receiver](http://blog.tkjelectronics.dk/wp-content/uploads/xbox360-wireless-receiver.jpg).
-
185 
-
186 To use it via USB use the [XBOXUSB](XBOXUSB.cpp) library or to use it wirelessly use the [XBOXRECV](XBOXRECV.cpp) library.
-
187 
-
188 __Note that a Wireless controller can NOT be used via USB!__
-
189 
-
190 Examples code can be found in the [examples directory](examples/Xbox).
-
191 
-
192 Also see the following blog posts:
-
193 
-
194 * <http://www.circuitsathome.com/mcu/xbox360-controller-support-added-to-usb-host-shield-2-0-library>
-
195 * <http://blog.tkjelectronics.dk/2012/07/xbox-360-controller-support-added-to-the-usb-host-library/>
-
196 * <http://blog.tkjelectronics.dk/2012/12/xbox-360-receiver-added-to-the-usb-host-library/>
-
197 
-
198 All the information regarding the Xbox 360 controller protocol are form these sites:
-
199 
-
200 * <http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/UsbInfo>
-
201 * <http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/WirelessUsbInfo>
-
202 * <https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL>
-
203 
-
204 ### [Wii library](Wii.cpp)
-
205 
-
206 The [Wii](Wii.cpp) library support the Wiimote, but also the Nunchuch and Motion Plus extensions via Bluetooth. The Wii U Pro Controller is also supported via Bluetooth.
-
207 
-
208 First you have to pair with the controller, this is done automatically by the library if you create the instance like so:
-
209 
-
210 ```C++
-
211 WII Wii(&Btd, PAIR);
-
212 ```
-
213 
-
214 And then press 1 & 2 at once on the Wiimote or press sync if you are using a Wii U Pro Controller.
-
215 
-
216 After that you can simply create the instance like so:
-
217 
-
218 ```C++
-
219 WII Wii(&Btd);
-
220 ```
-
221 
-
222 Then just press any button on the Wiimote and it will then connect to the dongle.
-
223 
-
224 Take a look at the example for more information: [Wii.ino](examples/Bluetooth/Wii/Wii.ino).
-
225 
-
226 Also take a look at the blog post:
-
227 
-
228 * <http://blog.tkjelectronics.dk/2012/08/wiimote-added-to-usb-host-library/>
-
229 
-
230 The Wii IR camera can also be used, but you will have to activate the code for it manually as it is quite large. Simply set ```ENABLE_WII_IR_CAMERA``` to 1 in [settings.h](settings.h).
-
231 
-
232 The [WiiIRCamera.ino](examples/Bluetooth/WiiIRCamera/WiiIRCamera.ino) example shows how it can be used.
-
233 
-
234 
-
235 All the information about the Wii controllers are from these sites:
-
236 
-
237 * <http://wiibrew.org/wiki/Wiimote>
-
238 * <http://wiibrew.org/wiki/Wiimote/Extension_Controllers>
-
239 * <http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck>
-
240 * <http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Wii_Motion_Plus>
-
241 * The old library created by _Tomoyuki Tanaka_: <https://github.com/moyuchin/WiiRemote_on_Arduino> also helped a lot.
-
242 
-
243 ### [PS Buzz Library](PSBuzz.cpp)
-
244 
-
245 This library implements support for the Playstation Buzz controllers via USB.
-
246 
-
247 It is essentially just a wrapper around the [HIDUniversal](hiduniversal.cpp) which takes care of the initializing and reading of the controllers. The [PSBuzz](PSBuzz.cpp) class simply inherits this and parses the data, so it is easy for users to read the buttons and turn the big red button on the controllers on and off.
-
248 
-
249 The example [PSBuzz.ino](examples/PSBuzz/PSBuzz.ino) shows how one can do this with just a few lines of code.
-
250 
-
251 More information about the controller can be found at the following sites:
-
252 
-
253 * http://www.developerfusion.com/article/84338/making-usb-c-friendly/
-
254 * https://github.com/torvalds/linux/blob/master/drivers/hid/hid-sony.c
-
255 
-
256 # FAQ
-
257 
-
258 > When I plug my device into the USB connector nothing happens?
-
259 
-
260 * Try to connect a external power supply to the Arduino - this solves the problem in most cases.
-
261 * You can also use a powered hub between the device and the USB Host Shield. You should then include the USB hub library: ```#include <usbhub.h>``` and create the instance like so: ```USBHub Hub1(&Usb);```.
- -
Definition: UsbCore.h:190
+
6 # Summary
+
7 This is Revision 2.0 of MAX3421E-based USB Host Shield Library for AVR's.
+
8 
+
9 Project main web site is: <http://www.circuitsathome.com>.
+
10 
+
11 Some information can also be found at: <http://blog.tkjelectronics.dk/>.
+
12 
+
13 The shield can be purchased at the main site: <http://www.circuitsathome.com/products-page/arduino-shields> or from [TKJ Electronics](http://tkjelectronics.com/): <http://shop.tkjelectronics.dk/product_info.php?products_id=43>.
+
14 
+
15 ![USB Host Shield](http://shop.tkjelectronics.dk/images/USB_Host_Shield1.jpg)
+
16 
+
17 For more information about the hardware see the [Hardware Manual](http://www.circuitsathome.com/usb-host-shield-hardware-manual).
+
18 
+
19 # Developed By
+
20 
+
21 * __Oleg Mazurov, Circuits\@Home__ - <mazurov@circuitsathome.com>
+
22 * __Alexei Glushchenko, Circuits\@Home__ - <alex-gl@mail.ru>
+
23  * Developers of the USB Core, HID, FTDI, ADK, ACM, and PL2303 libraries
+
24 * __Kristian Lauszus, TKJ Electronics__ - <kristianl@tkjelectronics.com>
+
25  * Developer of the [BTD](#bluetooth-libraries), [BTHID](#bthid-library), [SPP](#spp-library), [PS4](#ps4-library), [PS3](#ps3-library), [Wii](#wii-library), [Xbox](#xbox-library), and [PSBuzz](#ps-buzz-library) libraries
+
26 * __Andrew Kroll__ - <xxxajk@gmail.com>
+
27  * Major contributor to mass storage code
+
28 * __guruthree__
+
29  * [Xbox ONE](#xbox-one-library) controller support
+
30 
+
31 # Donate
+
32 
+
33 Help yourself by helping us support you! Many thousands of hours have been spent developing the USB Host Shield library. Since you find it useful, please consider donating via the button below. Donations will allow us to support you by ensuring hardware that you have can be acquired in order to add support for your microcontroller board.
+
34 
+
35 <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=donate@circuitsathome.com&amp;lc=US&amp;item_name=Donate%20to%20the%20USB%20Host%20Library%20project&amp;no_note=0&amp;currency_code=USD&amp;bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHostedGuest"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" alt="PayPal - The safer, easier way to pay online!" /></a>
+
36 
+
37 # Table of Contents
+
38 
+
39 * [How to include the library](#how-to-include-the-library)
+
40 * [How to use the library](#how-to-use-the-library)
+
41  * [Documentation](#documentation)
+
42  * [Enable debugging](#enable-debugging)
+
43  * [Boards](#boards)
+
44  * [Bluetooth libraries](#bluetooth-libraries)
+
45  * [BTHID library](#bthid-library)
+
46  * [SPP library](#spp-library)
+
47  * [PS4 Library](#ps4-library)
+
48  * [PS3 Library](#ps3-library)
+
49  * [Xbox Libraries](#xbox-libraries)
+
50  * [Xbox library](#xbox-library)
+
51  * [Xbox 360 Library](#xbox-360-library)
+
52  * [Xbox ONE Library](#xbox-one-library)
+
53  * [Wii library](#wii-library)
+
54  * [PS Buzz Library](#ps-buzz-library)
+
55 * [Interface modifications](#interface-modifications)
+
56 * [FAQ](#faq)
+
57 
+
58 # How to include the library
+
59 
+
60 First download the library by clicking on the following link: <https://github.com/felis/USB_Host_Shield_2.0/archive/master.zip>.
+
61 
+
62 Then uncompress the zip folder and rename the directory to "USB\_Host\_Shield\_20", as any special characters are not supported by the Arduino IDE.
+
63 
+
64 Now open up the Arduino IDE and open "File>Preferences". There you will see the location of your sketchbook. Open that directory and create a directory called "libraries" inside that directory.
+
65 Now move the "USB\_Host\_Shield\_20" directory to the "libraries" directory.
+
66 
+
67 The final structure should look like this:
+
68 
+
69 * Arduino/
+
70  * libraries/
+
71  * USB\_Host\_Shield\_20/
+
72 
+
73 Now quit the Arduino IDE and reopen it.
+
74 
+
75 Now you should be able to go open all the examples codes by navigating to "File>Examples>USB\_Host\_Shield\_20" and then select the example you will like to open.
+
76 
+
77 For more information visit the following sites: <http://arduino.cc/en/Guide/Libraries> and <https://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use>.
+
78 
+
79 # How to use the library
+
80 
+
81 ### Documentation
+
82 
+
83 Documentation for the library can be found at the following link: <http://felis.github.com/USB_Host_Shield_2.0/>.
+
84 
+
85 ### Enable debugging
+
86 
+
87 By default serial debugging is disabled. To turn it on simply change ```ENABLE_UHS_DEBUGGING``` to 1 in [settings.h](settings.h) like so:
+
88 
+
89 ```C++
+
90 #define ENABLE_UHS_DEBUGGING 1
+
91 ```
+
92 
+
93 ### Boards
+
94 
+
95 Currently the following boards are supported by the library:
+
96 
+
97 * All official Arduino AVR boards (Uno, Duemilanove, Mega, Mega 2560, Mega ADK, Leonardo etc.)
+
98 * Arduino Due, Intel Galileo, Intel Galileo 2, and Intel Edison
+
99  * If you are using the Arduino Due, Intel Galileo or Intel Galileo 2, then you must include the Arduino SPI library like so: ```#include <SPI.h>``` in your .ino file.
+
100  * Note that the Intel Galileo uses pin 2 and 3 as INT and SS pin respectively by default, so some modifications to the shield are needed. See the "Interface modifications" section in the [hardware manual](https://www.circuitsathome.com/usb-host-shield-hardware-manual) for more information.
+
101 * Teensy (Teensy++ 1.0, Teensy 2.0, Teensy++ 2.0, and Teensy 3.x)
+
102  * Note if you are using the Teensy 3.x you should download this SPI library as well: <https://github.com/xxxajk/spi4teensy3>. You should then add ```#include <spi4teensy3.h>``` to your .ino file.
+
103 * Balanduino
+
104 * Sanguino
+
105 * Black Widdow
+
106 * RedBearLab nRF51822
+
107  * If you are using the RedBearLab nRF51822, then you must include the RedBearLab SPI library like so: ```#include <SPI.h>``` in your .ino file.
+
108 * Digilent chipKIT
+
109  * Please see: <http://www.circuitsathome.com/mcu/usb/running-usb-host-code-on-digilent-chipkit-board>.
+
110 
+
111 The following boards need to be activated manually in [settings.h](settings.h):
+
112 
+
113 * Arduino Mega ADK
+
114  * If you are using Arduino 1.5.5 or newer there is no need to activate the Arduino Mega ADK manually
+
115 * Black Widdow
+
116 
+
117 Simply set the corresponding value to 1 instead of 0.
+
118 
+
119 ### [Bluetooth libraries](BTD.cpp)
+
120 
+
121 The [BTD library](BTD.cpp) is a general purpose library for an ordinary Bluetooth dongle.
+
122 This library make it easy to add support for different Bluetooth services like a PS3 or a Wii controller or SPP which is a virtual serial port via Bluetooth.
+
123 Some different examples can be found in the [example directory](examples/Bluetooth).
+
124 
+
125 The BTD library also makes it possible to use multiple services at once, the following example sketch is an example of this:
+
126 [PS3SPP.ino](examples/Bluetooth/PS3SPP/PS3SPP.ino).
+
127 
+
128 ### [BTHID library](BTHID.cpp)
+
129 
+
130 The [Bluetooth HID library](BTHID.cpp) allows you to connect HID devices via Bluetooth to the USB Host Shield.
+
131 
+
132 Currently HID mice and keyboards are supported.
+
133 
+
134 It uses the standard Boot protocol by default, but it is also able to use the Report protocol as well. You would simply have to call ```setProtocolMode()``` and then parse ```HID_RPT_PROTOCOL``` as an argument. You will then have to modify the parser for your device. See the example: [BTHID.ino](examples/Bluetooth/BTHID/BTHID.ino) for more information.
+
135 
+
136 The [PS4 library](#ps4-library) also uses this class to handle all Bluetooth communication.
+
137 
+
138 For information see the following blog post: <http://blog.tkjelectronics.dk/2013/12/bluetooth-hid-devices-now-supported-by-the-usb-host-library/>.
+
139 
+
140 ### [SPP library](SPP.cpp)
+
141 
+
142 SPP stands for "Serial Port Profile" and is a Bluetooth protocol that implements a virtual comport which allows you to send data back and forth from your computer/phone to your Arduino via Bluetooth.
+
143 It has been tested successfully on Windows, Mac OS X, Linux, and Android.
+
144 
+
145 Take a look at the [SPP.ino](examples/Bluetooth/SPP/SPP.ino) example for more information.
+
146 
+
147 More information can be found at these blog posts:
+
148 
+
149 * <http://www.circuitsathome.com/mcu/bluetooth-rfcommspp-service-support-for-usb-host-2-0-library-released>
+
150 * <http://blog.tkjelectronics.dk/2012/07/rfcommspp-library-for-arduino/>
+
151 
+
152 To implement the SPP protocol I used a Bluetooth sniffing tool called [PacketLogger](http://www.tkjelectronics.com/uploads/PacketLogger.zip) developed by Apple.
+
153 It enables me to see the Bluetooth communication between my Mac and any device.
+
154 
+
155 ### PS4 Library
+
156 
+
157 The PS4BT library is split up into the [PS4BT](PS4BT.h) and the [PS4USB](PS4USB.h) library. These allow you to use the Sony PS4 controller via Bluetooth and USB.
+
158 
+
159 The [PS4BT.ino](examples/Bluetooth/PS4BT/PS4BT.ino) and [PS4USB.ino](examples/PS4USB/PS4USB.ino) examples shows how to easily read the buttons, joysticks, touchpad and IMU on the controller via Bluetooth and USB respectively. It is also possible to control the rumble and light on the controller and get the battery level.
+
160 
+
161 Before you can use the PS4 controller via Bluetooth you will need to pair with it.
+
162 
+
163 Simply create the PS4BT instance like so: ```PS4BT PS4(&Btd, PAIR);``` and then hold down the Share button and then hold down the PS without releasing the Share button. The PS4 controller will then start to blink rapidly indicating that it is in paring mode.
+
164 
+
165 It should then automatically pair the dongle with your controller. This only have to be done once.
+
166 
+
167 For information see the following blog post: <http://blog.tkjelectronics.dk/2014/01/ps4-controller-now-supported-by-the-usb-host-library/>.
+
168 
+
169 Also check out this excellent Wiki by Frank Zhao about the PS4 controller: <http://eleccelerator.com/wiki/index.php?title=DualShock_4> and this Linux driver: <https://github.com/chrippa/ds4drv>.
+
170 
+
171 ### PS3 Library
+
172 
+
173 These libraries consist of the [PS3BT](PS3BT.cpp) and [PS3USB](PS3USB.cpp). These libraries allows you to use a Dualshock 3, Navigation or a Motion controller with the USB Host Shield both via Bluetooth and USB.
+
174 
+
175 In order to use your Playstation controller via Bluetooth you have to set the Bluetooth address of the dongle internally to your PS3 Controller. This can be achieved by first plugging in the Bluetooth dongle and wait a few seconds. Now plug in the controller via USB and wait until the LEDs start to flash. The library has now written the Bluetooth address of the dongle to the PS3 controller.
+
176 
+
177 Finally simply plug in the Bluetooth dongle again and press PS on the PS3 controller. After a few seconds it should be connected to the dongle and ready to use.
+
178 
+
179 __Note:__ You will have to plug in the Bluetooth dongle before connecting the controller, as the library needs to read the address of the dongle. Alternatively you could set it in code like so: [PS3BT.ino#L20](examples/Bluetooth/PS3BT/PS3BT.ino#L20).
+
180 
+
181 For more information about the PS3 protocol see the official wiki: <https://github.com/felis/USB_Host_Shield_2.0/wiki/PS3-Information>.
+
182 
+
183 Also take a look at the blog posts:
+
184 
+
185 * <http://blog.tkjelectronics.dk/2012/01/ps3-controller-bt-library-for-arduino/>
+
186 * <http://www.circuitsathome.com/mcu/sony-ps3-controller-support-added-to-usb-host-library>
+
187 * <http://www.circuitsathome.com/mcu/arduino/interfacing-ps3-controllers-via-usb>
+
188 
+
189 A special thanks go to the following people:
+
190 
+
191 1. _Richard Ibbotson_ who made this excellent guide: <http://www.circuitsathome.com/mcu/ps3-and-wiimote-game-controllers-on-the-arduino-host-shield-part>
+
192 2. _Tomoyuki Tanaka_ for releasing his code for the Arduino USB Host shield connected to the wiimote: <http://www.circuitsathome.com/mcu/rc-car-controlled-by-wii-remote-on-arduino>
+
193 
+
194 Also a big thanks all the people behind these sites about the Motion controller:
+
195 
+
196 * <http://thp.io/2010/psmove/>
+
197 * <http://www.copenhagengamecollective.org/unimove/>
+
198 * <https://github.com/thp/psmoveapi>
+
199 * <http://code.google.com/p/moveonpc/>
+
200 
+
201 ### Xbox Libraries
+
202 
+
203 The library supports both the original Xbox controller via USB and the Xbox 360 controller both via USB and wirelessly.
+
204 
+
205 #### Xbox library
+
206 
+
207 The [XBOXOLD](XBOXOLD.cpp) class implements support for the original Xbox controller via USB.
+
208 
+
209 All the information are from the following sites:
+
210 
+
211 * <https://github.com/torvalds/linux/blob/master/Documentation/input/xpad.txt>
+
212 * <https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c>
+
213 * <http://euc.jp/periphs/xbox-controller.ja.html>
+
214 * <https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL#L15>
+
215 
+
216 #### Xbox 360 Library
+
217 
+
218 The library support one Xbox 360 via USB or up to four Xbox 360 controllers wirelessly by using a [Xbox 360 wireless receiver](http://blog.tkjelectronics.dk/wp-content/uploads/xbox360-wireless-receiver.jpg).
+
219 
+
220 To use it via USB use the [XBOXUSB](XBOXUSB.cpp) library or to use it wirelessly use the [XBOXRECV](XBOXRECV.cpp) library.
+
221 
+
222 __Note that a Wireless controller can NOT be used via USB!__
+
223 
+
224 Examples code can be found in the [examples directory](examples/Xbox).
+
225 
+
226 Also see the following blog posts:
+
227 
+
228 * <http://www.circuitsathome.com/mcu/xbox360-controller-support-added-to-usb-host-shield-2-0-library>
+
229 * <http://blog.tkjelectronics.dk/2012/07/xbox-360-controller-support-added-to-the-usb-host-library/>
+
230 * <http://blog.tkjelectronics.dk/2012/12/xbox-360-receiver-added-to-the-usb-host-library/>
+
231 
+
232 All the information regarding the Xbox 360 controller protocol are form these sites:
+
233 
+
234 * <http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/UsbInfo>
+
235 * <http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/WirelessUsbInfo>
+
236 * <https://github.com/Grumbel/xboxdrv/blob/master/PROTOCOL>
+
237 
+
238 #### Xbox ONE Library
+
239 
+
240 An Xbox ONE controller is supported via USB in the [XBOXONE](XBOXONE.cpp) class. It is heavily based on the 360 library above. In addition to cross referencing the above, information on the protocol was found at:
+
241 
+
242 * <https://github.com/quantus/xbox-one-controller-protocol>
+
243 * <https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c>
+
244 * <https://github.com/kylelemons/xbox/blob/master/xbox.go>
+
245 
+
246 ### [Wii library](Wii.cpp)
+
247 
+
248 The [Wii](Wii.cpp) library support the Wiimote, but also the Nunchuch and Motion Plus extensions via Bluetooth. The Wii U Pro Controller is also supported via Bluetooth.
+
249 
+
250 First you have to pair with the controller, this is done automatically by the library if you create the instance like so:
+
251 
+
252 ```C++
+
253 WII Wii(&Btd, PAIR);
+
254 ```
+
255 
+
256 And then press 1 & 2 at once on the Wiimote or press sync if you are using a Wii U Pro Controller.
+
257 
+
258 After that you can simply create the instance like so:
+
259 
+
260 ```C++
+
261 WII Wii(&Btd);
+
262 ```
+
263 
+
264 Then just press any button on the Wiimote and it will then connect to the dongle.
+
265 
+
266 Take a look at the example for more information: [Wii.ino](examples/Bluetooth/Wii/Wii.ino).
+
267 
+
268 Also take a look at the blog post:
+
269 
+
270 * <http://blog.tkjelectronics.dk/2012/08/wiimote-added-to-usb-host-library/>
+
271 
+
272 The Wii IR camera can also be used, but you will have to activate the code for it manually as it is quite large. Simply set ```ENABLE_WII_IR_CAMERA``` to 1 in [settings.h](settings.h).
+
273 
+
274 The [WiiIRCamera.ino](examples/Bluetooth/WiiIRCamera/WiiIRCamera.ino) example shows how it can be used.
+
275 
+
276 
+
277 All the information about the Wii controllers are from these sites:
+
278 
+
279 * <http://wiibrew.org/wiki/Wiimote>
+
280 * <http://wiibrew.org/wiki/Wiimote/Extension_Controllers>
+
281 * <http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck>
+
282 * <http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Wii_Motion_Plus>
+
283 * The old library created by _Tomoyuki Tanaka_: <https://github.com/moyuchin/WiiRemote_on_Arduino> also helped a lot.
+
284 
+
285 ### [PS Buzz Library](PSBuzz.cpp)
+
286 
+
287 This library implements support for the Playstation Buzz controllers via USB.
+
288 
+
289 It is essentially just a wrapper around the [HIDUniversal](hiduniversal.cpp) which takes care of the initializing and reading of the controllers. The [PSBuzz](PSBuzz.cpp) class simply inherits this and parses the data, so it is easy for users to read the buttons and turn the big red button on the controllers on and off.
+
290 
+
291 The example [PSBuzz.ino](examples/PSBuzz/PSBuzz.ino) shows how one can do this with just a few lines of code.
+
292 
+
293 More information about the controller can be found at the following sites:
+
294 
+
295 * http://www.developerfusion.com/article/84338/making-usb-c-friendly/
+
296 * https://github.com/torvalds/linux/blob/master/drivers/hid/hid-sony.c
+
297 
+
298 # Interface modifications
+
299 
+
300 The shield is using SPI for communicating with the MAX3421E USB host controller. It uses the SCK, MISO and MOSI pins via the ICSP on your board.
+
301 
+
302 Note this means that it uses pin 13, 12, 11 on an Arduino Uno, so these pins can not be used for anything else than SPI communication!
+
303 
+
304 Furthermore it uses one pin as SS and one INT pin. These are by default located on pin 10 and 9 respectively. They can easily be reconfigured in case you need to use them for something else by cutting the jumper on the shield and then solder a wire from the pad to the new pin.
+
305 
+
306 After that you need modify the following entry in [UsbCore.h](UsbCore.h):
+
307 
+
308 ```C++
+
309 typedef MAX3421e<P10, P9> MAX3421E;
+
310 ```
+
311 
+
312 For instance if you have rerouted SS to pin 7 it should read:
+
313 
+
314 ```C++
+
315 typedef MAX3421e<P7, P9> MAX3421E;
+
316 ```
+
317 
+
318 See the "Interface modifications" section in the [hardware manual](https://www.circuitsathome.com/usb-host-shield-hardware-manual) for more information.
+
319 
+
320 # FAQ
+
321 
+
322 > When I plug my device into the USB connector nothing happens?
+
323 
+
324 * Try to connect a external power supply to the Arduino - this solves the problem in most cases.
+
325 * You can also use a powered hub between the device and the USB Host Shield. You should then include the USB hub library: ```#include <usbhub.h>``` and create the instance like so: ```USBHub Hub1(&Usb);```.
+
326 
+
327 > When I connecting my PS3 controller I get a output like this:
+
328 
+
329 ```
+
330 Dualshock 3 Controller Enabled
+
331 
+
332 LeftHatX: 0 LeftHatY: 0 RightHatX: 0 RightHatY: 0
+
333 LeftHatX: 0 LeftHatY: 0 RightHatX: 0 RightHatY: 0
+
334 LeftHatX: 0 LeftHatY: 0 RightHatX: 0 RightHatY: 0
+
335 LeftHatX: 0 LeftHatY: 0 RightHatX: 0 RightHatY: 0
+
336 LeftHatX: 0 LeftHatY: 0 RightHatX: 0 RightHatY: 0
+
337 ```
+
338 
+
339 * This means that your dongle does not support 2.0+EDR, so you will need another dongle. Please see the following [list](https://github.com/felis/USB_Host_Shield_2.0/wiki/Bluetooth-dongles) for tested working dongles.
diff --git a/_s_p_p_8cpp.html b/_s_p_p_8cpp.html index 37da3a01..2b2e7d72 100644 --- a/_s_p_p_8cpp.html +++ b/_s_p_p_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: SPP.cpp File Reference + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -97,7 +98,7 @@ Include dependency graph for SPP.cpp:
- +

Go to the source code of this file.

@@ -145,7 +146,7 @@ Variables diff --git a/_s_p_p_8cpp__incl.map b/_s_p_p_8cpp__incl.map index f9cf35d2..76e3d532 100644 --- a/_s_p_p_8cpp__incl.map +++ b/_s_p_p_8cpp__incl.map @@ -1,5 +1,7 @@ - + + + diff --git a/_s_p_p_8cpp__incl.md5 b/_s_p_p_8cpp__incl.md5 index a9f94c2d..3b42f619 100644 --- a/_s_p_p_8cpp__incl.md5 +++ b/_s_p_p_8cpp__incl.md5 @@ -1 +1 @@ -7fcbcf3b461f8f3c5d0972f005f8a4e5 \ No newline at end of file +449619037175ca779e6e0127bdc68f55 \ No newline at end of file diff --git a/_s_p_p_8cpp__incl.png b/_s_p_p_8cpp__incl.png index f5233607..f678f443 100644 Binary files a/_s_p_p_8cpp__incl.png and b/_s_p_p_8cpp__incl.png differ diff --git a/_s_p_p_8cpp_source.html b/_s_p_p_8cpp_source.html index a2fd7a85..a8550554 100644 --- a/_s_p_p_8cpp_source.html +++ b/_s_p_p_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: SPP.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -134,856 +135,878 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
43 };
44 
45 SPP::SPP(BTD *p, const char* name, const char* pin) :
-
46 pBtd(p) // Pointer to BTD class instance - mandatory
+
46 BluetoothService(p) // Pointer to BTD class instance - mandatory
47 {
-
48  if(pBtd)
-
49  pBtd->registerServiceClass(this); // Register it as a Bluetooth service
+
48  pBtd->btdName = name;
+
49  pBtd->btdPin = pin;
50 
-
51  pBtd->btdName = name;
-
52  pBtd->btdPin = pin;
-
53 
-
54  /* Set device cid for the SDP and RFCOMM channelse */
-
55  sdp_dcid[0] = 0x50; // 0x0050
-
56  sdp_dcid[1] = 0x00;
-
57  rfcomm_dcid[0] = 0x51; // 0x0051
-
58  rfcomm_dcid[1] = 0x00;
+
51  /* Set device cid for the SDP and RFCOMM channelse */
+
52  sdp_dcid[0] = 0x50; // 0x0050
+
53  sdp_dcid[1] = 0x00;
+
54  rfcomm_dcid[0] = 0x51; // 0x0051
+
55  rfcomm_dcid[1] = 0x00;
+
56 
+
57  Reset();
+
58 }
59 
-
60  Reset();
-
61 }
-
62 
-
63 void SPP::Reset() {
-
64  connected = false;
-
65  RFCOMMConnected = false;
-
66  SDPConnected = false;
-
67  waitForLastCommand = false;
-
68  l2cap_sdp_state = L2CAP_SDP_WAIT;
-
69  l2cap_rfcomm_state = L2CAP_RFCOMM_WAIT;
-
70  l2cap_event_flag = 0;
-
71  sppIndex = 0;
-
72 }
-
73 
-
74 void SPP::disconnect() {
-
75  connected = false;
-
76  // First the two L2CAP channels has to be disconnected and then the HCI connection
-
77  if(RFCOMMConnected)
-
78  pBtd->l2cap_disconnection_request(hci_handle, ++identifier, rfcomm_scid, rfcomm_dcid);
-
79  if(RFCOMMConnected && SDPConnected)
-
80  delay(1); // Add delay between commands
-
81  if(SDPConnected)
-
82  pBtd->l2cap_disconnection_request(hci_handle, ++identifier, sdp_scid, sdp_dcid);
-
83  l2cap_sdp_state = L2CAP_DISCONNECT_RESPONSE;
-
84 }
-
85 
-
86 void SPP::ACLData(uint8_t* l2capinbuf) {
-
87  if(!connected) {
-
88  if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
-
89  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == SDP_PSM && !pBtd->sdpConnectionClaimed) {
-
90  pBtd->sdpConnectionClaimed = true;
-
91  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
-
92  l2cap_sdp_state = L2CAP_SDP_WAIT; // Reset state
-
93  } else if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == RFCOMM_PSM && !pBtd->rfcommConnectionClaimed) {
-
94  pBtd->rfcommConnectionClaimed = true;
-
95  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
-
96  l2cap_rfcomm_state = L2CAP_RFCOMM_WAIT; // Reset state
-
97  }
-
98  }
-
99  }
-
100  //if((l2capinbuf[0] | (uint16_t)l2capinbuf[1] << 8) == (hci_handle | 0x2000U)) { // acl_handle_ok
-
101  if(UHS_ACL_HANDLE_OK(l2capinbuf, hci_handle)) { // acl_handle_ok
-
102  if((l2capinbuf[6] | (l2capinbuf[7] << 8)) == 0x0001U) { //l2cap_control - Channel ID for ACL-U
-
103  if(l2capinbuf[8] == L2CAP_CMD_COMMAND_REJECT) {
-
104 #ifdef DEBUG_USB_HOST
-
105  Notify(PSTR("\r\nL2CAP Command Rejected - Reason: "), 0x80);
-
106  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
-
107  Notify(PSTR(" "), 0x80);
-
108  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
-
109  Notify(PSTR(" Data: "), 0x80);
-
110  D_PrintHex<uint8_t > (l2capinbuf[17], 0x80);
-
111  Notify(PSTR(" "), 0x80);
-
112  D_PrintHex<uint8_t > (l2capinbuf[16], 0x80);
-
113  Notify(PSTR(" "), 0x80);
-
114  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
-
115  Notify(PSTR(" "), 0x80);
-
116  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
-
117 #endif
-
118  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
-
119 #ifdef EXTRADEBUG
-
120  Notify(PSTR("\r\nL2CAP Connection Request - PSM: "), 0x80);
-
121  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
-
122  Notify(PSTR(" "), 0x80);
-
123  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
-
124  Notify(PSTR(" SCID: "), 0x80);
-
125  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
-
126  Notify(PSTR(" "), 0x80);
-
127  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
-
128  Notify(PSTR(" Identifier: "), 0x80);
-
129  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
-
130 #endif
-
131  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == SDP_PSM) { // It doesn't matter if it receives another reqeust, since it waits for the channel to disconnect in the L2CAP_SDP_DONE state, and the l2cap_event_flag will be cleared if so
-
132  identifier = l2capinbuf[9];
-
133  sdp_scid[0] = l2capinbuf[14];
-
134  sdp_scid[1] = l2capinbuf[15];
-
135  l2cap_set_flag(L2CAP_FLAG_CONNECTION_SDP_REQUEST);
-
136  } else if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == RFCOMM_PSM) { // ----- || -----
-
137  identifier = l2capinbuf[9];
-
138  rfcomm_scid[0] = l2capinbuf[14];
-
139  rfcomm_scid[1] = l2capinbuf[15];
-
140  l2cap_set_flag(L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST);
-
141  }
-
142  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_RESPONSE) {
-
143  if((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) { // Success
-
144  if(l2capinbuf[12] == sdp_dcid[0] && l2capinbuf[13] == sdp_dcid[1]) {
-
145  //Notify(PSTR("\r\nSDP Configuration Complete"), 0x80);
-
146  l2cap_set_flag(L2CAP_FLAG_CONFIG_SDP_SUCCESS);
-
147  } else if(l2capinbuf[12] == rfcomm_dcid[0] && l2capinbuf[13] == rfcomm_dcid[1]) {
-
148  //Notify(PSTR("\r\nRFCOMM Configuration Complete"), 0x80);
-
149  l2cap_set_flag(L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS);
-
150  }
-
151  }
-
152  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_REQUEST) {
-
153  if(l2capinbuf[12] == sdp_dcid[0] && l2capinbuf[13] == sdp_dcid[1]) {
-
154  //Notify(PSTR("\r\nSDP Configuration Request"), 0x80);
-
155  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], sdp_scid);
-
156  } else if(l2capinbuf[12] == rfcomm_dcid[0] && l2capinbuf[13] == rfcomm_dcid[1]) {
-
157  //Notify(PSTR("\r\nRFCOMM Configuration Request"), 0x80);
-
158  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], rfcomm_scid);
-
159  }
-
160  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_REQUEST) {
-
161  if(l2capinbuf[12] == sdp_dcid[0] && l2capinbuf[13] == sdp_dcid[1]) {
-
162  //Notify(PSTR("\r\nDisconnect Request: SDP Channel"), 0x80);
-
163  identifier = l2capinbuf[9];
-
164  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_SDP_REQUEST);
-
165  } else if(l2capinbuf[12] == rfcomm_dcid[0] && l2capinbuf[13] == rfcomm_dcid[1]) {
-
166  //Notify(PSTR("\r\nDisconnect Request: RFCOMM Channel"), 0x80);
-
167  identifier = l2capinbuf[9];
-
168  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST);
-
169  }
-
170  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_RESPONSE) {
-
171  if(l2capinbuf[12] == sdp_scid[0] && l2capinbuf[13] == sdp_scid[1]) {
-
172  //Notify(PSTR("\r\nDisconnect Response: SDP Channel"), 0x80);
-
173  identifier = l2capinbuf[9];
-
174  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_RESPONSE);
-
175  } else if(l2capinbuf[12] == rfcomm_scid[0] && l2capinbuf[13] == rfcomm_scid[1]) {
-
176  //Notify(PSTR("\r\nDisconnect Response: RFCOMM Channel"), 0x80);
-
177  identifier = l2capinbuf[9];
-
178  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_RESPONSE);
-
179  }
-
180  } else if(l2capinbuf[8] == L2CAP_CMD_INFORMATION_REQUEST) {
-
181 #ifdef DEBUG_USB_HOST
-
182  Notify(PSTR("\r\nInformation request"), 0x80);
-
183 #endif
-
184  identifier = l2capinbuf[9];
-
185  pBtd->l2cap_information_response(hci_handle, identifier, l2capinbuf[12], l2capinbuf[13]);
-
186  }
-
187 #ifdef EXTRADEBUG
-
188  else {
-
189  Notify(PSTR("\r\nL2CAP Unknown Signaling Command: "), 0x80);
-
190  D_PrintHex<uint8_t > (l2capinbuf[8], 0x80);
-
191  }
-
192 #endif
-
193  } else if(l2capinbuf[6] == sdp_dcid[0] && l2capinbuf[7] == sdp_dcid[1]) { // SDP
-
194  if(l2capinbuf[8] == SDP_SERVICE_SEARCH_ATTRIBUTE_REQUEST_PDU) {
-
195  if(((l2capinbuf[16] << 8 | l2capinbuf[17]) == SERIALPORT_UUID) || ((l2capinbuf[16] << 8 | l2capinbuf[17]) == 0x0000 && (l2capinbuf[18] << 8 | l2capinbuf[19]) == SERIALPORT_UUID)) { // Check if it's sending the full UUID, see: https://www.bluetooth.org/Technical/AssignedNumbers/service_discovery.htm, we will just check the first four bytes
-
196  if(firstMessage) {
-
197  serialPortResponse1(l2capinbuf[9], l2capinbuf[10]);
-
198  firstMessage = false;
-
199  } else {
-
200  serialPortResponse2(l2capinbuf[9], l2capinbuf[10]); // Serialport continuation state
-
201  firstMessage = true;
-
202  }
-
203  } else if(((l2capinbuf[16] << 8 | l2capinbuf[17]) == L2CAP_UUID) || ((l2capinbuf[16] << 8 | l2capinbuf[17]) == 0x0000 && (l2capinbuf[18] << 8 | l2capinbuf[19]) == L2CAP_UUID)) {
-
204  if(firstMessage) {
-
205  l2capResponse1(l2capinbuf[9], l2capinbuf[10]);
-
206  firstMessage = false;
-
207  } else {
-
208  l2capResponse2(l2capinbuf[9], l2capinbuf[10]); // L2CAP continuation state
-
209  firstMessage = true;
-
210  }
-
211  } else
-
212  serviceNotSupported(l2capinbuf[9], l2capinbuf[10]); // The service is not supported
-
213 #ifdef EXTRADEBUG
-
214  Notify(PSTR("\r\nUUID: "), 0x80);
-
215  uint16_t uuid;
-
216  if((l2capinbuf[16] << 8 | l2capinbuf[17]) == 0x0000) // Check if it's sending the UUID as a 128-bit UUID
-
217  uuid = (l2capinbuf[18] << 8 | l2capinbuf[19]);
-
218  else // Short UUID
-
219  uuid = (l2capinbuf[16] << 8 | l2capinbuf[17]);
-
220  D_PrintHex<uint16_t > (uuid, 0x80);
-
221 
-
222  Notify(PSTR("\r\nLength: "), 0x80);
-
223  uint16_t length = l2capinbuf[11] << 8 | l2capinbuf[12];
-
224  D_PrintHex<uint16_t > (length, 0x80);
-
225  Notify(PSTR("\r\nData: "), 0x80);
-
226  for(uint8_t i = 0; i < length; i++) {
-
227  D_PrintHex<uint8_t > (l2capinbuf[13 + i], 0x80);
-
228  Notify(PSTR(" "), 0x80);
-
229  }
-
230 #endif
-
231  }
-
232 #ifdef EXTRADEBUG
-
233  else {
-
234  Notify(PSTR("\r\nUnknown PDU: "), 0x80);
-
235  D_PrintHex<uint8_t > (l2capinbuf[8], 0x80);
-
236  }
-
237 #endif
-
238  } else if(l2capinbuf[6] == rfcomm_dcid[0] && l2capinbuf[7] == rfcomm_dcid[1]) { // RFCOMM
-
239  rfcommChannel = l2capinbuf[8] & 0xF8;
-
240  rfcommDirection = l2capinbuf[8] & 0x04;
-
241  rfcommCommandResponse = l2capinbuf[8] & 0x02;
-
242  rfcommChannelType = l2capinbuf[9] & 0xEF;
-
243  rfcommPfBit = l2capinbuf[9] & 0x10;
-
244 
-
245  if(rfcommChannel >> 3 != 0x00)
-
246  rfcommChannelConnection = rfcommChannel;
-
247 
-
248 #ifdef EXTRADEBUG
-
249  Notify(PSTR("\r\nRFCOMM Channel: "), 0x80);
-
250  D_PrintHex<uint8_t > (rfcommChannel >> 3, 0x80);
-
251  Notify(PSTR(" Direction: "), 0x80);
-
252  D_PrintHex<uint8_t > (rfcommDirection >> 2, 0x80);
-
253  Notify(PSTR(" CommandResponse: "), 0x80);
-
254  D_PrintHex<uint8_t > (rfcommCommandResponse >> 1, 0x80);
-
255  Notify(PSTR(" ChannelType: "), 0x80);
-
256  D_PrintHex<uint8_t > (rfcommChannelType, 0x80);
-
257  Notify(PSTR(" PF_BIT: "), 0x80);
-
258  D_PrintHex<uint8_t > (rfcommPfBit, 0x80);
-
259 #endif
-
260  if(rfcommChannelType == RFCOMM_DISC) {
-
261 #ifdef DEBUG_USB_HOST
-
262  Notify(PSTR("\r\nReceived Disconnect RFCOMM Command on channel: "), 0x80);
-
263  D_PrintHex<uint8_t > (rfcommChannel >> 3, 0x80);
-
264 #endif
-
265  connected = false;
-
266  sendRfcomm(rfcommChannel, rfcommDirection, rfcommCommandResponse, RFCOMM_UA, rfcommPfBit, rfcommbuf, 0x00); // UA Command
-
267  }
-
268  if(connected) {
-
269  /* Read the incoming message */
-
270  if(rfcommChannelType == RFCOMM_UIH && rfcommChannel == rfcommChannelConnection) {
-
271  uint8_t length = l2capinbuf[10] >> 1; // Get length
-
272  uint8_t offset = l2capinbuf[4] - length - 4; // Check if there is credit
-
273  if(checkFcs(&l2capinbuf[8], l2capinbuf[11 + length + offset])) {
-
274  uint8_t i = 0;
-
275  for(; i < length; i++) {
-
276  if(rfcommAvailable + i >= sizeof (rfcommDataBuffer)) {
-
277 #ifdef DEBUG_USB_HOST
-
278  Notify(PSTR("\r\nWarning: Buffer is full!"), 0x80);
-
279 #endif
-
280  break;
-
281  }
-
282  rfcommDataBuffer[rfcommAvailable + i] = l2capinbuf[11 + i + offset];
-
283  }
-
284  rfcommAvailable += i;
-
285 #ifdef EXTRADEBUG
-
286  Notify(PSTR("\r\nRFCOMM Data Available: "), 0x80);
-
287  Notify(rfcommAvailable, 0x80);
-
288  if(offset) {
-
289  Notify(PSTR(" - Credit: 0x"), 0x80);
-
290  D_PrintHex<uint8_t > (l2capinbuf[11], 0x80);
-
291  }
-
292 #endif
-
293  }
-
294 #ifdef DEBUG_USB_HOST
-
295  else
-
296  Notify(PSTR("\r\nError in FCS checksum!"), 0x80);
-
297 #endif
-
298 #ifdef PRINTREPORT // Uncomment "#define PRINTREPORT" to print the report send to the Arduino via Bluetooth
-
299  for(uint8_t i = 0; i < length; i++)
-
300  Notifyc(l2capinbuf[i + 11 + offset], 0x80);
-
301 #endif
-
302  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_RPN_CMD) { // UIH Remote Port Negotiation Command
-
303 #ifdef DEBUG_USB_HOST
-
304  Notify(PSTR("\r\nReceived UIH Remote Port Negotiation Command"), 0x80);
-
305 #endif
-
306  rfcommbuf[0] = BT_RFCOMM_RPN_RSP; // Command
-
307  rfcommbuf[1] = l2capinbuf[12]; // Length and shiftet like so: length << 1 | 1
-
308  rfcommbuf[2] = l2capinbuf[13]; // Channel: channel << 1 | 1
-
309  rfcommbuf[3] = l2capinbuf[14]; // Pre difined for Bluetooth, see 5.5.3 of TS 07.10 Adaption for RFCOMM
-
310  rfcommbuf[4] = l2capinbuf[15]; // Priority
-
311  rfcommbuf[5] = l2capinbuf[16]; // Timer
-
312  rfcommbuf[6] = l2capinbuf[17]; // Max Fram Size LSB
-
313  rfcommbuf[7] = l2capinbuf[18]; // Max Fram Size MSB
-
314  rfcommbuf[8] = l2capinbuf[19]; // MaxRatransm.
-
315  rfcommbuf[9] = l2capinbuf[20]; // Number of Frames
-
316  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x0A); // UIH Remote Port Negotiation Response
-
317  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_MSC_CMD) { // UIH Modem Status Command
-
318 #ifdef DEBUG_USB_HOST
-
319  Notify(PSTR("\r\nSend UIH Modem Status Response"), 0x80);
-
320 #endif
-
321  rfcommbuf[0] = BT_RFCOMM_MSC_RSP; // UIH Modem Status Response
-
322  rfcommbuf[1] = 2 << 1 | 1; // Length and shiftet like so: length << 1 | 1
-
323  rfcommbuf[2] = l2capinbuf[13]; // Channel: (1 << 0) | (1 << 1) | (0 << 2) | (channel << 3)
-
324  rfcommbuf[3] = l2capinbuf[14];
-
325  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x04);
-
326  }
-
327  } else {
-
328  if(rfcommChannelType == RFCOMM_SABM) { // SABM Command - this is sent twice: once for channel 0 and then for the channel to establish
-
329 #ifdef DEBUG_USB_HOST
-
330  Notify(PSTR("\r\nReceived SABM Command"), 0x80);
-
331 #endif
-
332  sendRfcomm(rfcommChannel, rfcommDirection, rfcommCommandResponse, RFCOMM_UA, rfcommPfBit, rfcommbuf, 0x00); // UA Command
-
333  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_PN_CMD) { // UIH Parameter Negotiation Command
-
334 #ifdef DEBUG_USB_HOST
-
335  Notify(PSTR("\r\nReceived UIH Parameter Negotiation Command"), 0x80);
-
336 #endif
-
337  rfcommbuf[0] = BT_RFCOMM_PN_RSP; // UIH Parameter Negotiation Response
-
338  rfcommbuf[1] = l2capinbuf[12]; // Length and shiftet like so: length << 1 | 1
-
339  rfcommbuf[2] = l2capinbuf[13]; // Channel: channel << 1 | 1
-
340  rfcommbuf[3] = 0xE0; // Pre difined for Bluetooth, see 5.5.3 of TS 07.10 Adaption for RFCOMM
-
341  rfcommbuf[4] = 0x00; // Priority
-
342  rfcommbuf[5] = 0x00; // Timer
-
343  rfcommbuf[6] = BULK_MAXPKTSIZE - 14; // Max Fram Size LSB - set to the size of received data (50)
-
344  rfcommbuf[7] = 0x00; // Max Fram Size MSB
-
345  rfcommbuf[8] = 0x00; // MaxRatransm.
-
346  rfcommbuf[9] = 0x00; // Number of Frames
-
347  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x0A);
-
348  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_MSC_CMD) { // UIH Modem Status Command
-
349 #ifdef DEBUG_USB_HOST
-
350  Notify(PSTR("\r\nSend UIH Modem Status Response"), 0x80);
-
351 #endif
-
352  rfcommbuf[0] = BT_RFCOMM_MSC_RSP; // UIH Modem Status Response
-
353  rfcommbuf[1] = 2 << 1 | 1; // Length and shiftet like so: length << 1 | 1
-
354  rfcommbuf[2] = l2capinbuf[13]; // Channel: (1 << 0) | (1 << 1) | (0 << 2) | (channel << 3)
-
355  rfcommbuf[3] = l2capinbuf[14];
-
356  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x04);
-
357 
-
358  delay(1);
-
359 #ifdef DEBUG_USB_HOST
-
360  Notify(PSTR("\r\nSend UIH Modem Status Command"), 0x80);
-
361 #endif
-
362  rfcommbuf[0] = BT_RFCOMM_MSC_CMD; // UIH Modem Status Command
-
363  rfcommbuf[1] = 2 << 1 | 1; // Length and shiftet like so: length << 1 | 1
-
364  rfcommbuf[2] = l2capinbuf[13]; // Channel: (1 << 0) | (1 << 1) | (0 << 2) | (channel << 3)
-
365  rfcommbuf[3] = 0x8D; // Can receive frames (YES), Ready to Communicate (YES), Ready to Receive (YES), Incomig Call (NO), Data is Value (YES)
-
366 
-
367  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x04);
-
368  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_MSC_RSP) { // UIH Modem Status Response
-
369  if(!creditSent) {
-
370 #ifdef DEBUG_USB_HOST
-
371  Notify(PSTR("\r\nSend UIH Command with credit"), 0x80);
-
372 #endif
-
373  sendRfcommCredit(rfcommChannelConnection, rfcommDirection, 0, RFCOMM_UIH, 0x10, sizeof (rfcommDataBuffer)); // Send credit
-
374  creditSent = true;
-
375  timer = millis();
-
376  waitForLastCommand = true;
-
377  }
-
378  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[10] == 0x01) { // UIH Command with credit
-
379 #ifdef DEBUG_USB_HOST
-
380  Notify(PSTR("\r\nReceived UIH Command with credit"), 0x80);
-
381 #endif
-
382  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_RPN_CMD) { // UIH Remote Port Negotiation Command
-
383 #ifdef DEBUG_USB_HOST
-
384  Notify(PSTR("\r\nReceived UIH Remote Port Negotiation Command"), 0x80);
-
385 #endif
-
386  rfcommbuf[0] = BT_RFCOMM_RPN_RSP; // Command
-
387  rfcommbuf[1] = l2capinbuf[12]; // Length and shiftet like so: length << 1 | 1
-
388  rfcommbuf[2] = l2capinbuf[13]; // Channel: channel << 1 | 1
-
389  rfcommbuf[3] = l2capinbuf[14]; // Pre difined for Bluetooth, see 5.5.3 of TS 07.10 Adaption for RFCOMM
-
390  rfcommbuf[4] = l2capinbuf[15]; // Priority
-
391  rfcommbuf[5] = l2capinbuf[16]; // Timer
-
392  rfcommbuf[6] = l2capinbuf[17]; // Max Fram Size LSB
-
393  rfcommbuf[7] = l2capinbuf[18]; // Max Fram Size MSB
-
394  rfcommbuf[8] = l2capinbuf[19]; // MaxRatransm.
-
395  rfcommbuf[9] = l2capinbuf[20]; // Number of Frames
-
396  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x0A); // UIH Remote Port Negotiation Response
-
397 #ifdef DEBUG_USB_HOST
-
398  Notify(PSTR("\r\nRFCOMM Connection is now established\r\n"), 0x80);
-
399 #endif
-
400  waitForLastCommand = false;
-
401  creditSent = false;
-
402  connected = true; // The RFCOMM channel is now established
-
403  sppIndex = 0;
-
404  }
-
405 #ifdef EXTRADEBUG
-
406  else if(rfcommChannelType != RFCOMM_DISC) {
-
407  Notify(PSTR("\r\nUnsupported RFCOMM Data - ChannelType: "), 0x80);
-
408  D_PrintHex<uint8_t > (rfcommChannelType, 0x80);
-
409  Notify(PSTR(" Command: "), 0x80);
-
410  D_PrintHex<uint8_t > (l2capinbuf[11], 0x80);
-
411  }
-
412 #endif
-
413  }
-
414  }
-
415 #ifdef EXTRADEBUG
-
416  else {
-
417  Notify(PSTR("\r\nUnsupported L2CAP Data - Channel ID: "), 0x80);
-
418  D_PrintHex<uint8_t > (l2capinbuf[7], 0x80);
-
419  Notify(PSTR(" "), 0x80);
-
420  D_PrintHex<uint8_t > (l2capinbuf[6], 0x80);
-
421  }
-
422 #endif
-
423  SDP_task();
-
424  RFCOMM_task();
-
425  }
-
426 }
-
427 
-
428 void SPP::Run() {
-
429  if(waitForLastCommand && (millis() - timer) > 100) { // We will only wait 100ms and see if the UIH Remote Port Negotiation Command is send, as some deviced don't send it
-
430 #ifdef DEBUG_USB_HOST
-
431  Notify(PSTR("\r\nRFCOMM Connection is now established - Automatic\r\n"), 0x80);
-
432 #endif
-
433  creditSent = false;
-
434  waitForLastCommand = false;
-
435  connected = true; // The RFCOMM channel is now established
-
436  sppIndex = 0;
-
437  }
-
438  send(); // Send all bytes currently in the buffer
-
439 }
-
440 
-
441 void SPP::SDP_task() {
-
442  switch(l2cap_sdp_state) {
-
443  case L2CAP_SDP_WAIT:
-
444  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_SDP_REQUEST)) {
-
445  l2cap_clear_flag(L2CAP_FLAG_CONNECTION_SDP_REQUEST); // Clear flag
-
446 #ifdef DEBUG_USB_HOST
-
447  Notify(PSTR("\r\nSDP Incoming Connection Request"), 0x80);
-
448 #endif
-
449  pBtd->l2cap_connection_response(hci_handle, identifier, sdp_dcid, sdp_scid, PENDING);
-
450  delay(1);
-
451  pBtd->l2cap_connection_response(hci_handle, identifier, sdp_dcid, sdp_scid, SUCCESSFUL);
-
452  identifier++;
-
453  delay(1);
-
454  pBtd->l2cap_config_request(hci_handle, identifier, sdp_scid);
-
455  l2cap_sdp_state = L2CAP_SDP_SUCCESS;
-
456  } else if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_SDP_REQUEST)) {
-
457  l2cap_clear_flag(L2CAP_FLAG_DISCONNECT_SDP_REQUEST); // Clear flag
-
458  SDPConnected = false;
-
459 #ifdef DEBUG_USB_HOST
-
460  Notify(PSTR("\r\nDisconnected SDP Channel"), 0x80);
-
461 #endif
-
462  pBtd->l2cap_disconnection_response(hci_handle, identifier, sdp_dcid, sdp_scid);
-
463  }
-
464  break;
-
465  case L2CAP_SDP_SUCCESS:
-
466  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_SDP_SUCCESS)) {
-
467  l2cap_clear_flag(L2CAP_FLAG_CONFIG_SDP_SUCCESS); // Clear flag
-
468 #ifdef DEBUG_USB_HOST
-
469  Notify(PSTR("\r\nSDP Successfully Configured"), 0x80);
-
470 #endif
-
471  firstMessage = true; // Reset bool
-
472  SDPConnected = true;
-
473  l2cap_sdp_state = L2CAP_SDP_WAIT;
-
474  }
-
475  break;
-
476 
-
477  case L2CAP_DISCONNECT_RESPONSE: // This is for both disconnection response from the RFCOMM and SDP channel if they were connected
-
478  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_RESPONSE)) {
-
479 #ifdef DEBUG_USB_HOST
-
480  Notify(PSTR("\r\nDisconnected L2CAP Connection"), 0x80);
-
481 #endif
-
482  pBtd->hci_disconnect(hci_handle);
-
483  hci_handle = -1; // Reset handle
-
484  Reset();
-
485  }
-
486  break;
-
487  }
-
488 }
-
489 
-
490 void SPP::RFCOMM_task() {
-
491  switch(l2cap_rfcomm_state) {
-
492  case L2CAP_RFCOMM_WAIT:
-
493  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST)) {
-
494  l2cap_clear_flag(L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST); // Clear flag
-
495 #ifdef DEBUG_USB_HOST
-
496  Notify(PSTR("\r\nRFCOMM Incoming Connection Request"), 0x80);
-
497 #endif
-
498  pBtd->l2cap_connection_response(hci_handle, identifier, rfcomm_dcid, rfcomm_scid, PENDING);
-
499  delay(1);
-
500  pBtd->l2cap_connection_response(hci_handle, identifier, rfcomm_dcid, rfcomm_scid, SUCCESSFUL);
-
501  identifier++;
-
502  delay(1);
-
503  pBtd->l2cap_config_request(hci_handle, identifier, rfcomm_scid);
-
504  l2cap_rfcomm_state = L2CAP_RFCOMM_SUCCESS;
-
505  } else if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST)) {
-
506  l2cap_clear_flag(L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST); // Clear flag
-
507  RFCOMMConnected = false;
-
508  connected = false;
-
509 #ifdef DEBUG_USB_HOST
-
510  Notify(PSTR("\r\nDisconnected RFCOMM Channel"), 0x80);
-
511 #endif
-
512  pBtd->l2cap_disconnection_response(hci_handle, identifier, rfcomm_dcid, rfcomm_scid);
-
513  }
-
514  break;
-
515  case L2CAP_RFCOMM_SUCCESS:
-
516  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS)) {
-
517  l2cap_clear_flag(L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS); // Clear flag
-
518 #ifdef DEBUG_USB_HOST
-
519  Notify(PSTR("\r\nRFCOMM Successfully Configured"), 0x80);
-
520 #endif
-
521  rfcommAvailable = 0; // Reset number of bytes available
-
522  bytesRead = 0; // Reset number of bytes received
-
523  RFCOMMConnected = true;
-
524  l2cap_rfcomm_state = L2CAP_RFCOMM_WAIT;
-
525  }
-
526  break;
-
527  }
-
528 }
-
529 /************************************************************/
-
530 /* SDP Commands */
-
531 
-
532 /************************************************************/
-
533 void SPP::SDP_Command(uint8_t* data, uint8_t nbytes) { // See page 223 in the Bluetooth specs
-
534  pBtd->L2CAP_Command(hci_handle, data, nbytes, sdp_scid[0], sdp_scid[1]);
-
535 }
-
536 
-
537 void SPP::serviceNotSupported(uint8_t transactionIDHigh, uint8_t transactionIDLow) { // See page 235 in the Bluetooth specs
-
538  l2capoutbuf[0] = SDP_SERVICE_SEARCH_ATTRIBUTE_RESPONSE_PDU;
-
539  l2capoutbuf[1] = transactionIDHigh;
-
540  l2capoutbuf[2] = transactionIDLow;
-
541  l2capoutbuf[3] = 0x00; // Parameter Length
-
542  l2capoutbuf[4] = 0x05; // Parameter Length
-
543  l2capoutbuf[5] = 0x00; // AttributeListsByteCount
-
544  l2capoutbuf[6] = 0x02; // AttributeListsByteCount
-
545 
-
546  /* Attribute ID/Value Sequence: */
-
547  l2capoutbuf[7] = 0x35;
-
548  l2capoutbuf[8] = 0x00;
-
549  l2capoutbuf[9] = 0x00;
-
550 
-
551  SDP_Command(l2capoutbuf, 10);
-
552 }
-
553 
-
554 void SPP::serialPortResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow) {
-
555  l2capoutbuf[0] = SDP_SERVICE_SEARCH_ATTRIBUTE_RESPONSE_PDU;
-
556  l2capoutbuf[1] = transactionIDHigh;
-
557  l2capoutbuf[2] = transactionIDLow;
-
558  l2capoutbuf[3] = 0x00; // Parameter Length
-
559  l2capoutbuf[4] = 0x2B; // Parameter Length
-
560  l2capoutbuf[5] = 0x00; // AttributeListsByteCount
-
561  l2capoutbuf[6] = 0x26; // AttributeListsByteCount
-
562 
-
563  /* Attribute ID/Value Sequence: */
-
564  l2capoutbuf[7] = 0x36;
-
565  l2capoutbuf[8] = 0x00;
-
566  l2capoutbuf[9] = 0x3C;
-
567  l2capoutbuf[10] = 0x36;
-
568  l2capoutbuf[11] = 0x00;
-
569 
-
570  l2capoutbuf[12] = 0x39;
-
571  l2capoutbuf[13] = 0x09;
-
572  l2capoutbuf[14] = 0x00;
-
573  l2capoutbuf[15] = 0x00;
-
574  l2capoutbuf[16] = 0x0A;
-
575  l2capoutbuf[17] = 0x00;
-
576  l2capoutbuf[18] = 0x01;
-
577  l2capoutbuf[19] = 0x00;
-
578  l2capoutbuf[20] = 0x06;
-
579  l2capoutbuf[21] = 0x09;
-
580  l2capoutbuf[22] = 0x00;
-
581  l2capoutbuf[23] = 0x01;
-
582  l2capoutbuf[24] = 0x35;
-
583  l2capoutbuf[25] = 0x03;
-
584  l2capoutbuf[26] = 0x19;
-
585  l2capoutbuf[27] = 0x11;
-
586 
-
587  l2capoutbuf[28] = 0x01;
-
588  l2capoutbuf[29] = 0x09;
-
589  l2capoutbuf[30] = 0x00;
-
590  l2capoutbuf[31] = 0x04;
-
591  l2capoutbuf[32] = 0x35;
-
592  l2capoutbuf[33] = 0x0C;
-
593  l2capoutbuf[34] = 0x35;
-
594  l2capoutbuf[35] = 0x03;
-
595  l2capoutbuf[36] = 0x19;
-
596  l2capoutbuf[37] = 0x01;
-
597  l2capoutbuf[38] = 0x00;
-
598  l2capoutbuf[39] = 0x35;
-
599  l2capoutbuf[40] = 0x05;
-
600  l2capoutbuf[41] = 0x19;
-
601  l2capoutbuf[42] = 0x00;
-
602  l2capoutbuf[43] = 0x03;
-
603 
-
604  l2capoutbuf[44] = 0x08;
-
605  l2capoutbuf[45] = 0x02; // Two extra bytes
-
606  l2capoutbuf[46] = 0x00; // 25 (0x19) more bytes to come
-
607  l2capoutbuf[47] = 0x19;
-
608 
-
609  SDP_Command(l2capoutbuf, 48);
-
610 }
-
611 
-
612 void SPP::serialPortResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow) {
-
613  l2capoutbuf[0] = SDP_SERVICE_SEARCH_ATTRIBUTE_RESPONSE_PDU;
-
614  l2capoutbuf[1] = transactionIDHigh;
-
615  l2capoutbuf[2] = transactionIDLow;
-
616  l2capoutbuf[3] = 0x00; // Parameter Length
-
617  l2capoutbuf[4] = 0x1C; // Parameter Length
-
618  l2capoutbuf[5] = 0x00; // AttributeListsByteCount
-
619  l2capoutbuf[6] = 0x19; // AttributeListsByteCount
-
620 
-
621  /* Attribute ID/Value Sequence: */
-
622  l2capoutbuf[7] = 0x01;
-
623  l2capoutbuf[8] = 0x09;
-
624  l2capoutbuf[9] = 0x00;
-
625  l2capoutbuf[10] = 0x06;
-
626  l2capoutbuf[11] = 0x35;
-
627 
-
628  l2capoutbuf[12] = 0x09;
-
629  l2capoutbuf[13] = 0x09;
-
630  l2capoutbuf[14] = 0x65;
-
631  l2capoutbuf[15] = 0x6E;
-
632  l2capoutbuf[16] = 0x09;
-
633  l2capoutbuf[17] = 0x00;
-
634  l2capoutbuf[18] = 0x6A;
-
635  l2capoutbuf[19] = 0x09;
-
636  l2capoutbuf[20] = 0x01;
-
637  l2capoutbuf[21] = 0x00;
-
638  l2capoutbuf[22] = 0x09;
-
639  l2capoutbuf[23] = 0x01;
-
640  l2capoutbuf[24] = 0x00;
-
641  l2capoutbuf[25] = 0x25;
-
642 
-
643  l2capoutbuf[26] = 0x05; // Name length
-
644  l2capoutbuf[27] = 'T';
-
645  l2capoutbuf[28] = 'K';
-
646  l2capoutbuf[29] = 'J';
-
647  l2capoutbuf[30] = 'S';
-
648  l2capoutbuf[31] = 'P';
-
649  l2capoutbuf[32] = 0x00; // No more data
-
650 
-
651  SDP_Command(l2capoutbuf, 33);
-
652 }
-
653 
-
654 void SPP::l2capResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow) {
-
655  serialPortResponse1(transactionIDHigh, transactionIDLow); // These has to send all the supported functions, since it only supports virtual serialport it just sends the message again
-
656 }
-
657 
-
658 void SPP::l2capResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow) {
-
659  serialPortResponse2(transactionIDHigh, transactionIDLow); // Same data as serialPortResponse2
-
660 }
-
661 /************************************************************/
-
662 /* RFCOMM Commands */
-
663 
-
664 /************************************************************/
-
665 void SPP::RFCOMM_Command(uint8_t* data, uint8_t nbytes) {
-
666  pBtd->L2CAP_Command(hci_handle, data, nbytes, rfcomm_scid[0], rfcomm_scid[1]);
-
667 }
-
668 
-
669 void SPP::sendRfcomm(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t* data, uint8_t length) {
-
670  l2capoutbuf[0] = channel | direction | CR | extendAddress; // RFCOMM Address
-
671  l2capoutbuf[1] = channelType | pfBit; // RFCOMM Control
-
672  l2capoutbuf[2] = length << 1 | 0x01; // Length and format (always 0x01 bytes format)
-
673  uint8_t i = 0;
-
674  for(; i < length; i++)
-
675  l2capoutbuf[i + 3] = data[i];
-
676  l2capoutbuf[i + 3] = calcFcs(l2capoutbuf);
-
677 #ifdef EXTRADEBUG
-
678  Notify(PSTR(" - RFCOMM Data: "), 0x80);
-
679  for(i = 0; i < length + 4; i++) {
-
680  D_PrintHex<uint8_t > (l2capoutbuf[i], 0x80);
-
681  Notify(PSTR(" "), 0x80);
-
682  }
-
683 #endif
-
684  RFCOMM_Command(l2capoutbuf, length + 4);
-
685 }
-
686 
-
687 void SPP::sendRfcommCredit(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t credit) {
-
688  l2capoutbuf[0] = channel | direction | CR | extendAddress; // RFCOMM Address
-
689  l2capoutbuf[1] = channelType | pfBit; // RFCOMM Control
-
690  l2capoutbuf[2] = 0x01; // Length = 0
-
691  l2capoutbuf[3] = credit; // Credit
-
692  l2capoutbuf[4] = calcFcs(l2capoutbuf);
-
693 #ifdef EXTRADEBUG
-
694  Notify(PSTR(" - RFCOMM Credit Data: "), 0x80);
-
695  for(uint8_t i = 0; i < 5; i++) {
-
696  D_PrintHex<uint8_t > (l2capoutbuf[i], 0x80);
-
697  Notify(PSTR(" "), 0x80);
-
698  }
-
699 #endif
-
700  RFCOMM_Command(l2capoutbuf, 5);
-
701 }
-
702 
-
703 /* CRC on 2 bytes */
-
704 uint8_t SPP::crc(uint8_t *data) {
-
705  return (pgm_read_byte(&rfcomm_crc_table[pgm_read_byte(&rfcomm_crc_table[0xFF ^ data[0]]) ^ data[1]]));
-
706 }
-
707 
-
708 /* Calculate FCS */
-
709 uint8_t SPP::calcFcs(uint8_t *data) {
-
710  uint8_t temp = crc(data);
-
711  if((data[1] & 0xEF) == RFCOMM_UIH)
-
712  return (0xFF - temp); // FCS on 2 bytes
-
713  else
-
714  return (0xFF - pgm_read_byte(&rfcomm_crc_table[temp ^ data[2]])); // FCS on 3 bytes
+
60 void SPP::Reset() {
+
61  connected = false;
+
62  RFCOMMConnected = false;
+
63  SDPConnected = false;
+
64  waitForLastCommand = false;
+
65  l2cap_sdp_state = L2CAP_SDP_WAIT;
+
66  l2cap_rfcomm_state = L2CAP_RFCOMM_WAIT;
+
67  l2cap_event_flag = 0;
+
68  sppIndex = 0;
+
69  creditSent = false;
+
70 }
+
71 
+
72 void SPP::disconnect() {
+
73  connected = false;
+
74  // First the two L2CAP channels has to be disconnected and then the HCI connection
+
75  if(RFCOMMConnected)
+
76  pBtd->l2cap_disconnection_request(hci_handle, ++identifier, rfcomm_scid, rfcomm_dcid);
+
77  if(RFCOMMConnected && SDPConnected)
+
78  delay(1); // Add delay between commands
+
79  if(SDPConnected)
+
80  pBtd->l2cap_disconnection_request(hci_handle, ++identifier, sdp_scid, sdp_dcid);
+
81  l2cap_sdp_state = L2CAP_DISCONNECT_RESPONSE;
+
82 }
+
83 
+
84 void SPP::ACLData(uint8_t* l2capinbuf) {
+
85  if(!connected) {
+
86  if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
+
87  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == SDP_PSM && !pBtd->sdpConnectionClaimed) {
+
88  pBtd->sdpConnectionClaimed = true;
+
89  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
+
90  l2cap_sdp_state = L2CAP_SDP_WAIT; // Reset state
+
91  } else if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == RFCOMM_PSM && !pBtd->rfcommConnectionClaimed) {
+
92  pBtd->rfcommConnectionClaimed = true;
+
93  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
+
94  l2cap_rfcomm_state = L2CAP_RFCOMM_WAIT; // Reset state
+
95  }
+
96  }
+
97  }
+
98 
+
99  if(checkHciHandle(l2capinbuf, hci_handle)) { // acl_handle_ok
+
100  if((l2capinbuf[6] | (l2capinbuf[7] << 8)) == 0x0001U) { // l2cap_control - Channel ID for ACL-U
+
101  if(l2capinbuf[8] == L2CAP_CMD_COMMAND_REJECT) {
+
102 #ifdef DEBUG_USB_HOST
+
103  Notify(PSTR("\r\nL2CAP Command Rejected - Reason: "), 0x80);
+
104  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
+
105  Notify(PSTR(" "), 0x80);
+
106  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
+
107  Notify(PSTR(" Data: "), 0x80);
+
108  D_PrintHex<uint8_t > (l2capinbuf[17], 0x80);
+
109  Notify(PSTR(" "), 0x80);
+
110  D_PrintHex<uint8_t > (l2capinbuf[16], 0x80);
+
111  Notify(PSTR(" "), 0x80);
+
112  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
+
113  Notify(PSTR(" "), 0x80);
+
114  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
+
115 #endif
+
116  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
+
117 #ifdef EXTRADEBUG
+
118  Notify(PSTR("\r\nL2CAP Connection Request - PSM: "), 0x80);
+
119  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
+
120  Notify(PSTR(" "), 0x80);
+
121  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
+
122  Notify(PSTR(" SCID: "), 0x80);
+
123  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
+
124  Notify(PSTR(" "), 0x80);
+
125  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
+
126  Notify(PSTR(" Identifier: "), 0x80);
+
127  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
+
128 #endif
+
129  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == SDP_PSM) { // It doesn't matter if it receives another reqeust, since it waits for the channel to disconnect in the L2CAP_SDP_DONE state, and the l2cap_event_flag will be cleared if so
+
130  identifier = l2capinbuf[9];
+
131  sdp_scid[0] = l2capinbuf[14];
+
132  sdp_scid[1] = l2capinbuf[15];
+
133  l2cap_set_flag(L2CAP_FLAG_CONNECTION_SDP_REQUEST);
+
134  } else if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == RFCOMM_PSM) { // ----- || -----
+
135  identifier = l2capinbuf[9];
+
136  rfcomm_scid[0] = l2capinbuf[14];
+
137  rfcomm_scid[1] = l2capinbuf[15];
+
138  l2cap_set_flag(L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST);
+
139  }
+
140  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_RESPONSE) {
+
141  if((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) { // Success
+
142  if(l2capinbuf[12] == sdp_dcid[0] && l2capinbuf[13] == sdp_dcid[1]) {
+
143  //Notify(PSTR("\r\nSDP Configuration Complete"), 0x80);
+
144  l2cap_set_flag(L2CAP_FLAG_CONFIG_SDP_SUCCESS);
+
145  } else if(l2capinbuf[12] == rfcomm_dcid[0] && l2capinbuf[13] == rfcomm_dcid[1]) {
+
146  //Notify(PSTR("\r\nRFCOMM Configuration Complete"), 0x80);
+
147  l2cap_set_flag(L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS);
+
148  }
+
149  }
+
150  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_REQUEST) {
+
151  if(l2capinbuf[12] == sdp_dcid[0] && l2capinbuf[13] == sdp_dcid[1]) {
+
152  //Notify(PSTR("\r\nSDP Configuration Request"), 0x80);
+
153  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], sdp_scid);
+
154  } else if(l2capinbuf[12] == rfcomm_dcid[0] && l2capinbuf[13] == rfcomm_dcid[1]) {
+
155  //Notify(PSTR("\r\nRFCOMM Configuration Request"), 0x80);
+
156  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], rfcomm_scid);
+
157  }
+
158  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_REQUEST) {
+
159  if(l2capinbuf[12] == sdp_dcid[0] && l2capinbuf[13] == sdp_dcid[1]) {
+
160  //Notify(PSTR("\r\nDisconnect Request: SDP Channel"), 0x80);
+
161  identifier = l2capinbuf[9];
+
162  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_SDP_REQUEST);
+
163  } else if(l2capinbuf[12] == rfcomm_dcid[0] && l2capinbuf[13] == rfcomm_dcid[1]) {
+
164  //Notify(PSTR("\r\nDisconnect Request: RFCOMM Channel"), 0x80);
+
165  identifier = l2capinbuf[9];
+
166  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST);
+
167  }
+
168  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_RESPONSE) {
+
169  if(l2capinbuf[12] == sdp_scid[0] && l2capinbuf[13] == sdp_scid[1]) {
+
170  //Notify(PSTR("\r\nDisconnect Response: SDP Channel"), 0x80);
+
171  identifier = l2capinbuf[9];
+
172  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_RESPONSE);
+
173  } else if(l2capinbuf[12] == rfcomm_scid[0] && l2capinbuf[13] == rfcomm_scid[1]) {
+
174  //Notify(PSTR("\r\nDisconnect Response: RFCOMM Channel"), 0x80);
+
175  identifier = l2capinbuf[9];
+
176  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_RESPONSE);
+
177  }
+
178  } else if(l2capinbuf[8] == L2CAP_CMD_INFORMATION_REQUEST) {
+
179 #ifdef DEBUG_USB_HOST
+
180  Notify(PSTR("\r\nInformation request"), 0x80);
+
181 #endif
+
182  identifier = l2capinbuf[9];
+
183  pBtd->l2cap_information_response(hci_handle, identifier, l2capinbuf[12], l2capinbuf[13]);
+
184  }
+
185 #ifdef EXTRADEBUG
+
186  else {
+
187  Notify(PSTR("\r\nL2CAP Unknown Signaling Command: "), 0x80);
+
188  D_PrintHex<uint8_t > (l2capinbuf[8], 0x80);
+
189  }
+
190 #endif
+
191  } else if(l2capinbuf[6] == sdp_dcid[0] && l2capinbuf[7] == sdp_dcid[1]) { // SDP
+
192  if(l2capinbuf[8] == SDP_SERVICE_SEARCH_ATTRIBUTE_REQUEST_PDU) {
+
193  if(((l2capinbuf[16] << 8 | l2capinbuf[17]) == SERIALPORT_UUID) || ((l2capinbuf[16] << 8 | l2capinbuf[17]) == 0x0000 && (l2capinbuf[18] << 8 | l2capinbuf[19]) == SERIALPORT_UUID)) { // Check if it's sending the full UUID, see: https://www.bluetooth.org/Technical/AssignedNumbers/service_discovery.htm, we will just check the first four bytes
+
194  if(firstMessage) {
+
195  serialPortResponse1(l2capinbuf[9], l2capinbuf[10]);
+
196  firstMessage = false;
+
197  } else {
+
198  serialPortResponse2(l2capinbuf[9], l2capinbuf[10]); // Serialport continuation state
+
199  firstMessage = true;
+
200  }
+
201  } else if(((l2capinbuf[16] << 8 | l2capinbuf[17]) == L2CAP_UUID) || ((l2capinbuf[16] << 8 | l2capinbuf[17]) == 0x0000 && (l2capinbuf[18] << 8 | l2capinbuf[19]) == L2CAP_UUID)) {
+
202  if(firstMessage) {
+
203  l2capResponse1(l2capinbuf[9], l2capinbuf[10]);
+
204  firstMessage = false;
+
205  } else {
+
206  l2capResponse2(l2capinbuf[9], l2capinbuf[10]); // L2CAP continuation state
+
207  firstMessage = true;
+
208  }
+
209  } else
+
210  serviceNotSupported(l2capinbuf[9], l2capinbuf[10]); // The service is not supported
+
211 #ifdef EXTRADEBUG
+
212  Notify(PSTR("\r\nUUID: "), 0x80);
+
213  uint16_t uuid;
+
214  if((l2capinbuf[16] << 8 | l2capinbuf[17]) == 0x0000) // Check if it's sending the UUID as a 128-bit UUID
+
215  uuid = (l2capinbuf[18] << 8 | l2capinbuf[19]);
+
216  else // Short UUID
+
217  uuid = (l2capinbuf[16] << 8 | l2capinbuf[17]);
+
218  D_PrintHex<uint16_t > (uuid, 0x80);
+
219 
+
220  Notify(PSTR("\r\nLength: "), 0x80);
+
221  uint16_t length = l2capinbuf[11] << 8 | l2capinbuf[12];
+
222  D_PrintHex<uint16_t > (length, 0x80);
+
223  Notify(PSTR("\r\nData: "), 0x80);
+
224  for(uint8_t i = 0; i < length; i++) {
+
225  D_PrintHex<uint8_t > (l2capinbuf[13 + i], 0x80);
+
226  Notify(PSTR(" "), 0x80);
+
227  }
+
228 #endif
+
229  }
+
230 #ifdef EXTRADEBUG
+
231  else {
+
232  Notify(PSTR("\r\nUnknown PDU: "), 0x80);
+
233  D_PrintHex<uint8_t > (l2capinbuf[8], 0x80);
+
234  }
+
235 #endif
+
236  } else if(l2capinbuf[6] == rfcomm_dcid[0] && l2capinbuf[7] == rfcomm_dcid[1]) { // RFCOMM
+
237  rfcommChannel = l2capinbuf[8] & 0xF8;
+
238  rfcommDirection = l2capinbuf[8] & 0x04;
+
239  rfcommCommandResponse = l2capinbuf[8] & 0x02;
+
240  rfcommChannelType = l2capinbuf[9] & 0xEF;
+
241  rfcommPfBit = l2capinbuf[9] & 0x10;
+
242 
+
243  if(rfcommChannel >> 3 != 0x00)
+
244  rfcommChannelConnection = rfcommChannel;
+
245 
+
246 #ifdef EXTRADEBUG
+
247  Notify(PSTR("\r\nRFCOMM Channel: "), 0x80);
+
248  D_PrintHex<uint8_t > (rfcommChannel >> 3, 0x80);
+
249  Notify(PSTR(" Direction: "), 0x80);
+
250  D_PrintHex<uint8_t > (rfcommDirection >> 2, 0x80);
+
251  Notify(PSTR(" CommandResponse: "), 0x80);
+
252  D_PrintHex<uint8_t > (rfcommCommandResponse >> 1, 0x80);
+
253  Notify(PSTR(" ChannelType: "), 0x80);
+
254  D_PrintHex<uint8_t > (rfcommChannelType, 0x80);
+
255  Notify(PSTR(" PF_BIT: "), 0x80);
+
256  D_PrintHex<uint8_t > (rfcommPfBit, 0x80);
+
257 #endif
+
258  if(rfcommChannelType == RFCOMM_DISC) {
+
259 #ifdef DEBUG_USB_HOST
+
260  Notify(PSTR("\r\nReceived Disconnect RFCOMM Command on channel: "), 0x80);
+
261  D_PrintHex<uint8_t > (rfcommChannel >> 3, 0x80);
+
262 #endif
+
263  connected = false;
+
264  sendRfcomm(rfcommChannel, rfcommDirection, rfcommCommandResponse, RFCOMM_UA, rfcommPfBit, rfcommbuf, 0x00); // UA Command
+
265  }
+
266  if(connected) {
+
267  /* Read the incoming message */
+
268  if(rfcommChannelType == RFCOMM_UIH && rfcommChannel == rfcommChannelConnection) {
+
269  uint8_t length = l2capinbuf[10] >> 1; // Get length
+
270  uint8_t offset = l2capinbuf[4] - length - 4; // Check if there is credit
+
271  if(checkFcs(&l2capinbuf[8], l2capinbuf[11 + length + offset])) {
+
272  uint8_t i = 0;
+
273  for(; i < length; i++) {
+
274  if(rfcommAvailable + i >= sizeof (rfcommDataBuffer)) {
+
275 #ifdef DEBUG_USB_HOST
+
276  Notify(PSTR("\r\nWarning: Buffer is full!"), 0x80);
+
277 #endif
+
278  break;
+
279  }
+
280  rfcommDataBuffer[rfcommAvailable + i] = l2capinbuf[11 + i + offset];
+
281  }
+
282  rfcommAvailable += i;
+
283 #ifdef EXTRADEBUG
+
284  Notify(PSTR("\r\nRFCOMM Data Available: "), 0x80);
+
285  Notify(rfcommAvailable, 0x80);
+
286  if(offset) {
+
287  Notify(PSTR(" - Credit: 0x"), 0x80);
+
288  D_PrintHex<uint8_t > (l2capinbuf[11], 0x80);
+
289  }
+
290 #endif
+
291  }
+
292 #ifdef DEBUG_USB_HOST
+
293  else
+
294  Notify(PSTR("\r\nError in FCS checksum!"), 0x80);
+
295 #endif
+
296 #ifdef PRINTREPORT // Uncomment "#define PRINTREPORT" to print the report send to the Arduino via Bluetooth
+
297  for(uint8_t i = 0; i < length; i++)
+
298  Notifyc(l2capinbuf[i + 11 + offset], 0x80);
+
299 #endif
+
300  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_RPN_CMD) { // UIH Remote Port Negotiation Command
+
301 #ifdef DEBUG_USB_HOST
+
302  Notify(PSTR("\r\nReceived UIH Remote Port Negotiation Command"), 0x80);
+
303 #endif
+
304  rfcommbuf[0] = BT_RFCOMM_RPN_RSP; // Command
+
305  rfcommbuf[1] = l2capinbuf[12]; // Length and shiftet like so: length << 1 | 1
+
306  rfcommbuf[2] = l2capinbuf[13]; // Channel: channel << 1 | 1
+
307  rfcommbuf[3] = l2capinbuf[14]; // Pre difined for Bluetooth, see 5.5.3 of TS 07.10 Adaption for RFCOMM
+
308  rfcommbuf[4] = l2capinbuf[15]; // Priority
+
309  rfcommbuf[5] = l2capinbuf[16]; // Timer
+
310  rfcommbuf[6] = l2capinbuf[17]; // Max Fram Size LSB
+
311  rfcommbuf[7] = l2capinbuf[18]; // Max Fram Size MSB
+
312  rfcommbuf[8] = l2capinbuf[19]; // MaxRatransm.
+
313  rfcommbuf[9] = l2capinbuf[20]; // Number of Frames
+
314  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x0A); // UIH Remote Port Negotiation Response
+
315  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_MSC_CMD) { // UIH Modem Status Command
+
316 #ifdef DEBUG_USB_HOST
+
317  Notify(PSTR("\r\nSend UIH Modem Status Response"), 0x80);
+
318 #endif
+
319  rfcommbuf[0] = BT_RFCOMM_MSC_RSP; // UIH Modem Status Response
+
320  rfcommbuf[1] = 2 << 1 | 1; // Length and shiftet like so: length << 1 | 1
+
321  rfcommbuf[2] = l2capinbuf[13]; // Channel: (1 << 0) | (1 << 1) | (0 << 2) | (channel << 3)
+
322  rfcommbuf[3] = l2capinbuf[14];
+
323  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x04);
+
324  }
+
325  } else {
+
326  if(rfcommChannelType == RFCOMM_SABM) { // SABM Command - this is sent twice: once for channel 0 and then for the channel to establish
+
327 #ifdef DEBUG_USB_HOST
+
328  Notify(PSTR("\r\nReceived SABM Command"), 0x80);
+
329 #endif
+
330  sendRfcomm(rfcommChannel, rfcommDirection, rfcommCommandResponse, RFCOMM_UA, rfcommPfBit, rfcommbuf, 0x00); // UA Command
+
331  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_PN_CMD) { // UIH Parameter Negotiation Command
+
332 #ifdef DEBUG_USB_HOST
+
333  Notify(PSTR("\r\nReceived UIH Parameter Negotiation Command"), 0x80);
+
334 #endif
+
335  rfcommbuf[0] = BT_RFCOMM_PN_RSP; // UIH Parameter Negotiation Response
+
336  rfcommbuf[1] = l2capinbuf[12]; // Length and shiftet like so: length << 1 | 1
+
337  rfcommbuf[2] = l2capinbuf[13]; // Channel: channel << 1 | 1
+
338  rfcommbuf[3] = 0xE0; // Pre difined for Bluetooth, see 5.5.3 of TS 07.10 Adaption for RFCOMM
+
339  rfcommbuf[4] = 0x00; // Priority
+
340  rfcommbuf[5] = 0x00; // Timer
+
341  rfcommbuf[6] = BULK_MAXPKTSIZE - 14; // Max Fram Size LSB - set to the size of received data (50)
+
342  rfcommbuf[7] = 0x00; // Max Fram Size MSB
+
343  rfcommbuf[8] = 0x00; // MaxRatransm.
+
344  rfcommbuf[9] = 0x00; // Number of Frames
+
345  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x0A);
+
346  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_MSC_CMD) { // UIH Modem Status Command
+
347 #ifdef DEBUG_USB_HOST
+
348  Notify(PSTR("\r\nSend UIH Modem Status Response"), 0x80);
+
349 #endif
+
350  rfcommbuf[0] = BT_RFCOMM_MSC_RSP; // UIH Modem Status Response
+
351  rfcommbuf[1] = 2 << 1 | 1; // Length and shiftet like so: length << 1 | 1
+
352  rfcommbuf[2] = l2capinbuf[13]; // Channel: (1 << 0) | (1 << 1) | (0 << 2) | (channel << 3)
+
353  rfcommbuf[3] = l2capinbuf[14];
+
354  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x04);
+
355 
+
356  delay(1);
+
357 #ifdef DEBUG_USB_HOST
+
358  Notify(PSTR("\r\nSend UIH Modem Status Command"), 0x80);
+
359 #endif
+
360  rfcommbuf[0] = BT_RFCOMM_MSC_CMD; // UIH Modem Status Command
+
361  rfcommbuf[1] = 2 << 1 | 1; // Length and shiftet like so: length << 1 | 1
+
362  rfcommbuf[2] = l2capinbuf[13]; // Channel: (1 << 0) | (1 << 1) | (0 << 2) | (channel << 3)
+
363  rfcommbuf[3] = 0x8D; // Can receive frames (YES), Ready to Communicate (YES), Ready to Receive (YES), Incomig Call (NO), Data is Value (YES)
+
364 
+
365  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x04);
+
366  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_MSC_RSP) { // UIH Modem Status Response
+
367  if(!creditSent) {
+
368 #ifdef DEBUG_USB_HOST
+
369  Notify(PSTR("\r\nSend UIH Command with credit"), 0x80);
+
370 #endif
+
371  sendRfcommCredit(rfcommChannelConnection, rfcommDirection, 0, RFCOMM_UIH, 0x10, sizeof (rfcommDataBuffer)); // Send credit
+
372  creditSent = true;
+
373  timer = millis();
+
374  waitForLastCommand = true;
+
375  }
+
376  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[10] == 0x01) { // UIH Command with credit
+
377 #ifdef DEBUG_USB_HOST
+
378  Notify(PSTR("\r\nReceived UIH Command with credit"), 0x80);
+
379 #endif
+
380  } else if(rfcommChannelType == RFCOMM_UIH && l2capinbuf[11] == BT_RFCOMM_RPN_CMD) { // UIH Remote Port Negotiation Command
+
381 #ifdef DEBUG_USB_HOST
+
382  Notify(PSTR("\r\nReceived UIH Remote Port Negotiation Command"), 0x80);
+
383 #endif
+
384  rfcommbuf[0] = BT_RFCOMM_RPN_RSP; // Command
+
385  rfcommbuf[1] = l2capinbuf[12]; // Length and shiftet like so: length << 1 | 1
+
386  rfcommbuf[2] = l2capinbuf[13]; // Channel: channel << 1 | 1
+
387  rfcommbuf[3] = l2capinbuf[14]; // Pre difined for Bluetooth, see 5.5.3 of TS 07.10 Adaption for RFCOMM
+
388  rfcommbuf[4] = l2capinbuf[15]; // Priority
+
389  rfcommbuf[5] = l2capinbuf[16]; // Timer
+
390  rfcommbuf[6] = l2capinbuf[17]; // Max Fram Size LSB
+
391  rfcommbuf[7] = l2capinbuf[18]; // Max Fram Size MSB
+
392  rfcommbuf[8] = l2capinbuf[19]; // MaxRatransm.
+
393  rfcommbuf[9] = l2capinbuf[20]; // Number of Frames
+
394  sendRfcomm(rfcommChannel, rfcommDirection, 0, RFCOMM_UIH, rfcommPfBit, rfcommbuf, 0x0A); // UIH Remote Port Negotiation Response
+
395 #ifdef DEBUG_USB_HOST
+
396  Notify(PSTR("\r\nRFCOMM Connection is now established\r\n"), 0x80);
+
397 #endif
+
398  onInit();
+
399  }
+
400 #ifdef EXTRADEBUG
+
401  else if(rfcommChannelType != RFCOMM_DISC) {
+
402  Notify(PSTR("\r\nUnsupported RFCOMM Data - ChannelType: "), 0x80);
+
403  D_PrintHex<uint8_t > (rfcommChannelType, 0x80);
+
404  Notify(PSTR(" Command: "), 0x80);
+
405  D_PrintHex<uint8_t > (l2capinbuf[11], 0x80);
+
406  }
+
407 #endif
+
408  }
+
409  }
+
410 #ifdef EXTRADEBUG
+
411  else {
+
412  Notify(PSTR("\r\nUnsupported L2CAP Data - Channel ID: "), 0x80);
+
413  D_PrintHex<uint8_t > (l2capinbuf[7], 0x80);
+
414  Notify(PSTR(" "), 0x80);
+
415  D_PrintHex<uint8_t > (l2capinbuf[6], 0x80);
+
416  }
+
417 #endif
+
418  SDP_task();
+
419  RFCOMM_task();
+
420  }
+
421 }
+
422 
+
423 void SPP::Run() {
+
424  if(waitForLastCommand && (millis() - timer) > 100) { // We will only wait 100ms and see if the UIH Remote Port Negotiation Command is send, as some deviced don't send it
+
425 #ifdef DEBUG_USB_HOST
+
426  Notify(PSTR("\r\nRFCOMM Connection is now established - Automatic\r\n"), 0x80);
+
427 #endif
+
428  onInit();
+
429  }
+
430  send(); // Send all bytes currently in the buffer
+
431 }
+
432 
+
433 void SPP::onInit() {
+
434  creditSent = false;
+
435  waitForLastCommand = false;
+
436  connected = true; // The RFCOMM channel is now established
+
437  sppIndex = 0;
+
438  if(pFuncOnInit)
+
439  pFuncOnInit(); // Call the user function
+
440 };
+
441 
+
442 void SPP::SDP_task() {
+
443  switch(l2cap_sdp_state) {
+
444  case L2CAP_SDP_WAIT:
+
445  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_SDP_REQUEST)) {
+
446  l2cap_clear_flag(L2CAP_FLAG_CONNECTION_SDP_REQUEST); // Clear flag
+
447 #ifdef DEBUG_USB_HOST
+
448  Notify(PSTR("\r\nSDP Incoming Connection Request"), 0x80);
+
449 #endif
+
450  pBtd->l2cap_connection_response(hci_handle, identifier, sdp_dcid, sdp_scid, PENDING);
+
451  delay(1);
+
452  pBtd->l2cap_connection_response(hci_handle, identifier, sdp_dcid, sdp_scid, SUCCESSFUL);
+
453  identifier++;
+
454  delay(1);
+
455  pBtd->l2cap_config_request(hci_handle, identifier, sdp_scid);
+
456  l2cap_sdp_state = L2CAP_SDP_SUCCESS;
+
457  } else if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_SDP_REQUEST)) {
+
458  l2cap_clear_flag(L2CAP_FLAG_DISCONNECT_SDP_REQUEST); // Clear flag
+
459  SDPConnected = false;
+
460 #ifdef DEBUG_USB_HOST
+
461  Notify(PSTR("\r\nDisconnected SDP Channel"), 0x80);
+
462 #endif
+
463  pBtd->l2cap_disconnection_response(hci_handle, identifier, sdp_dcid, sdp_scid);
+
464  }
+
465  break;
+
466  case L2CAP_SDP_SUCCESS:
+
467  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_SDP_SUCCESS)) {
+
468  l2cap_clear_flag(L2CAP_FLAG_CONFIG_SDP_SUCCESS); // Clear flag
+
469 #ifdef DEBUG_USB_HOST
+
470  Notify(PSTR("\r\nSDP Successfully Configured"), 0x80);
+
471 #endif
+
472  firstMessage = true; // Reset bool
+
473  SDPConnected = true;
+
474  l2cap_sdp_state = L2CAP_SDP_WAIT;
+
475  }
+
476  break;
+
477 
+
478  case L2CAP_DISCONNECT_RESPONSE: // This is for both disconnection response from the RFCOMM and SDP channel if they were connected
+
479  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_RESPONSE)) {
+
480 #ifdef DEBUG_USB_HOST
+
481  Notify(PSTR("\r\nDisconnected L2CAP Connection"), 0x80);
+
482 #endif
+
483  pBtd->hci_disconnect(hci_handle);
+
484  hci_handle = -1; // Reset handle
+
485  Reset();
+
486  }
+
487  break;
+
488  }
+
489 }
+
490 
+
491 void SPP::RFCOMM_task() {
+
492  switch(l2cap_rfcomm_state) {
+
493  case L2CAP_RFCOMM_WAIT:
+
494  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST)) {
+
495  l2cap_clear_flag(L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST); // Clear flag
+
496 #ifdef DEBUG_USB_HOST
+
497  Notify(PSTR("\r\nRFCOMM Incoming Connection Request"), 0x80);
+
498 #endif
+
499  pBtd->l2cap_connection_response(hci_handle, identifier, rfcomm_dcid, rfcomm_scid, PENDING);
+
500  delay(1);
+
501  pBtd->l2cap_connection_response(hci_handle, identifier, rfcomm_dcid, rfcomm_scid, SUCCESSFUL);
+
502  identifier++;
+
503  delay(1);
+
504  pBtd->l2cap_config_request(hci_handle, identifier, rfcomm_scid);
+
505  l2cap_rfcomm_state = L2CAP_RFCOMM_SUCCESS;
+
506  } else if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST)) {
+
507  l2cap_clear_flag(L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST); // Clear flag
+
508  RFCOMMConnected = false;
+
509  connected = false;
+
510 #ifdef DEBUG_USB_HOST
+
511  Notify(PSTR("\r\nDisconnected RFCOMM Channel"), 0x80);
+
512 #endif
+
513  pBtd->l2cap_disconnection_response(hci_handle, identifier, rfcomm_dcid, rfcomm_scid);
+
514  }
+
515  break;
+
516  case L2CAP_RFCOMM_SUCCESS:
+
517  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS)) {
+
518  l2cap_clear_flag(L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS); // Clear flag
+
519 #ifdef DEBUG_USB_HOST
+
520  Notify(PSTR("\r\nRFCOMM Successfully Configured"), 0x80);
+
521 #endif
+
522  rfcommAvailable = 0; // Reset number of bytes available
+
523  bytesRead = 0; // Reset number of bytes received
+
524  RFCOMMConnected = true;
+
525  l2cap_rfcomm_state = L2CAP_RFCOMM_WAIT;
+
526  }
+
527  break;
+
528  }
+
529 }
+
530 /************************************************************/
+
531 /* SDP Commands */
+
532 
+
533 /************************************************************/
+
534 void SPP::SDP_Command(uint8_t* data, uint8_t nbytes) { // See page 223 in the Bluetooth specs
+
535  pBtd->L2CAP_Command(hci_handle, data, nbytes, sdp_scid[0], sdp_scid[1]);
+
536 }
+
537 
+
538 void SPP::serviceNotSupported(uint8_t transactionIDHigh, uint8_t transactionIDLow) { // See page 235 in the Bluetooth specs
+
539  l2capoutbuf[0] = SDP_SERVICE_SEARCH_ATTRIBUTE_RESPONSE_PDU;
+
540  l2capoutbuf[1] = transactionIDHigh;
+
541  l2capoutbuf[2] = transactionIDLow;
+
542  l2capoutbuf[3] = 0x00; // MSB Parameter Length
+
543  l2capoutbuf[4] = 0x05; // LSB Parameter Length = 5
+
544  l2capoutbuf[5] = 0x00; // MSB AttributeListsByteCount
+
545  l2capoutbuf[6] = 0x02; // LSB AttributeListsByteCount = 2
+
546 
+
547  /* Attribute ID/Value Sequence: */
+
548  l2capoutbuf[7] = 0x35; // Data element sequence - length in next byte
+
549  l2capoutbuf[8] = 0x00; // Length = 0
+
550  l2capoutbuf[9] = 0x00; // No continuation state
+
551 
+
552  SDP_Command(l2capoutbuf, 10);
+
553 }
+
554 
+
555 void SPP::serialPortResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow) {
+
556  l2capoutbuf[0] = SDP_SERVICE_SEARCH_ATTRIBUTE_RESPONSE_PDU;
+
557  l2capoutbuf[1] = transactionIDHigh;
+
558  l2capoutbuf[2] = transactionIDLow;
+
559  l2capoutbuf[3] = 0x00; // MSB Parameter Length
+
560  l2capoutbuf[4] = 0x2B; // LSB Parameter Length = 43
+
561  l2capoutbuf[5] = 0x00; // MSB AttributeListsByteCount
+
562  l2capoutbuf[6] = 0x26; // LSB AttributeListsByteCount = 38
+
563 
+
564  /* Attribute ID/Value Sequence: */
+
565  l2capoutbuf[7] = 0x36; // Data element sequence - length in next two bytes
+
566  l2capoutbuf[8] = 0x00; // MSB Length
+
567  l2capoutbuf[9] = 0x3C; // LSB Length = 60
+
568 
+
569  l2capoutbuf[10] = 0x36; // Data element sequence - length in next two bytes
+
570  l2capoutbuf[11] = 0x00; // MSB Length
+
571  l2capoutbuf[12] = 0x39; // LSB Length = 57
+
572 
+
573  l2capoutbuf[13] = 0x09; // Unsigned Integer - length 2 bytes
+
574  l2capoutbuf[14] = 0x00; // MSB ServiceRecordHandle
+
575  l2capoutbuf[15] = 0x00; // LSB ServiceRecordHandle
+
576  l2capoutbuf[16] = 0x0A; // Unsigned int - length 4 bytes
+
577  l2capoutbuf[17] = 0x00; // ServiceRecordHandle value - TODO: Is this related to HCI_Handle?
+
578  l2capoutbuf[18] = 0x01;
+
579  l2capoutbuf[19] = 0x00;
+
580  l2capoutbuf[20] = 0x06;
+
581 
+
582  l2capoutbuf[21] = 0x09; // Unsigned Integer - length 2 bytes
+
583  l2capoutbuf[22] = 0x00; // MSB ServiceClassIDList
+
584  l2capoutbuf[23] = 0x01; // LSB ServiceClassIDList
+
585  l2capoutbuf[24] = 0x35; // Data element sequence - length in next byte
+
586  l2capoutbuf[25] = 0x03; // Length = 3
+
587  l2capoutbuf[26] = 0x19; // UUID (universally unique identifier) - length = 2 bytes
+
588  l2capoutbuf[27] = 0x11; // MSB SerialPort
+
589  l2capoutbuf[28] = 0x01; // LSB SerialPort
+
590 
+
591  l2capoutbuf[29] = 0x09; // Unsigned Integer - length 2 bytes
+
592  l2capoutbuf[30] = 0x00; // MSB ProtocolDescriptorList
+
593  l2capoutbuf[31] = 0x04; // LSB ProtocolDescriptorList
+
594  l2capoutbuf[32] = 0x35; // Data element sequence - length in next byte
+
595  l2capoutbuf[33] = 0x0C; // Length = 12
+
596 
+
597  l2capoutbuf[34] = 0x35; // Data element sequence - length in next byte
+
598  l2capoutbuf[35] = 0x03; // Length = 3
+
599  l2capoutbuf[36] = 0x19; // UUID (universally unique identifier) - length = 2 bytes
+
600  l2capoutbuf[37] = 0x01; // MSB L2CAP
+
601  l2capoutbuf[38] = 0x00; // LSB L2CAP
+
602 
+
603  l2capoutbuf[39] = 0x35; // Data element sequence - length in next byte
+
604  l2capoutbuf[40] = 0x05; // Length = 5
+
605  l2capoutbuf[41] = 0x19; // UUID (universally unique identifier) - length = 2 bytes
+
606  l2capoutbuf[42] = 0x00; // MSB RFCOMM
+
607  l2capoutbuf[43] = 0x03; // LSB RFCOMM
+
608  l2capoutbuf[44] = 0x08; // Unsigned Integer - length 1 byte
+
609 
+
610  l2capoutbuf[45] = 0x02; // ContinuationState - Two more bytes
+
611  l2capoutbuf[46] = 0x00; // MSB length
+
612  l2capoutbuf[47] = 0x19; // LSB length = 25 more bytes to come
+
613 
+
614  SDP_Command(l2capoutbuf, 48);
+
615 }
+
616 
+
617 void SPP::serialPortResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow) {
+
618  l2capoutbuf[0] = SDP_SERVICE_SEARCH_ATTRIBUTE_RESPONSE_PDU;
+
619  l2capoutbuf[1] = transactionIDHigh;
+
620  l2capoutbuf[2] = transactionIDLow;
+
621  l2capoutbuf[3] = 0x00; // MSB Parameter Length
+
622  l2capoutbuf[4] = 0x1C; // LSB Parameter Length = 28
+
623  l2capoutbuf[5] = 0x00; // MSB AttributeListsByteCount
+
624  l2capoutbuf[6] = 0x19; // LSB AttributeListsByteCount = 25
+
625 
+
626  /* Attribute ID/Value Sequence: */
+
627  l2capoutbuf[7] = 0x01; // Channel 1 - TODO: Try different values, so multiple servers can be used at once
+
628 
+
629  l2capoutbuf[8] = 0x09; // Unsigned Integer - length 2 bytes
+
630  l2capoutbuf[9] = 0x00; // MSB LanguageBaseAttributeIDList
+
631  l2capoutbuf[10] = 0x06; // LSB LanguageBaseAttributeIDList
+
632  l2capoutbuf[11] = 0x35; // Data element sequence - length in next byte
+
633  l2capoutbuf[12] = 0x09; // Length = 9
+
634 
+
635  // Identifier representing the natural language = en = English - see: "ISO 639:1988"
+
636  l2capoutbuf[13] = 0x09; // Unsigned Integer - length 2 bytes
+
637  l2capoutbuf[14] = 0x65; // 'e'
+
638  l2capoutbuf[15] = 0x6E; // 'n'
+
639 
+
640  // "The second element of each triplet contains an identifier that specifies a character encoding used for the language"
+
641  // Encoding is set to 106 (UTF-8) - see: http://www.iana.org/assignments/character-sets/character-sets.xhtml
+
642  l2capoutbuf[16] = 0x09; // Unsigned Integer - length 2 bytes
+
643  l2capoutbuf[17] = 0x00; // MSB of character encoding
+
644  l2capoutbuf[18] = 0x6A; // LSB of character encoding (106)
+
645 
+
646  // Attribute ID that serves as the base attribute ID for the natural language in the service record
+
647  // "To facilitate the retrieval of human-readable universal attributes in a principal language, the base attribute ID value for the primary language supported by a service record shall be 0x0100"
+
648  l2capoutbuf[19] = 0x09; // Unsigned Integer - length 2 bytes
+
649  l2capoutbuf[20] = 0x01;
+
650  l2capoutbuf[21] = 0x00;
+
651 
+
652  l2capoutbuf[22] = 0x09; // Unsigned Integer - length 2 bytes
+
653  l2capoutbuf[23] = 0x01; // MSB ServiceDescription
+
654  l2capoutbuf[24] = 0x00; // LSB ServiceDescription
+
655 
+
656  l2capoutbuf[25] = 0x25; // Text string - length in next byte
+
657  l2capoutbuf[26] = 0x05; // Name length
+
658  l2capoutbuf[27] = 'T';
+
659  l2capoutbuf[28] = 'K';
+
660  l2capoutbuf[29] = 'J';
+
661  l2capoutbuf[30] = 'S';
+
662  l2capoutbuf[31] = 'P';
+
663  l2capoutbuf[32] = 0x00; // No continuation state
+
664 
+
665  SDP_Command(l2capoutbuf, 33);
+
666 }
+
667 
+
668 void SPP::l2capResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow) {
+
669  serialPortResponse1(transactionIDHigh, transactionIDLow); // These has to send all the supported functions, since it only supports virtual serialport it just sends the message again
+
670 }
+
671 
+
672 void SPP::l2capResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow) {
+
673  serialPortResponse2(transactionIDHigh, transactionIDLow); // Same data as serialPortResponse2
+
674 }
+
675 /************************************************************/
+
676 /* RFCOMM Commands */
+
677 
+
678 /************************************************************/
+
679 void SPP::RFCOMM_Command(uint8_t* data, uint8_t nbytes) {
+
680  pBtd->L2CAP_Command(hci_handle, data, nbytes, rfcomm_scid[0], rfcomm_scid[1]);
+
681 }
+
682 
+
683 void SPP::sendRfcomm(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t* data, uint8_t length) {
+
684  l2capoutbuf[0] = channel | direction | CR | extendAddress; // RFCOMM Address
+
685  l2capoutbuf[1] = channelType | pfBit; // RFCOMM Control
+
686  l2capoutbuf[2] = length << 1 | 0x01; // Length and format (always 0x01 bytes format)
+
687  uint8_t i = 0;
+
688  for(; i < length; i++)
+
689  l2capoutbuf[i + 3] = data[i];
+
690  l2capoutbuf[i + 3] = calcFcs(l2capoutbuf);
+
691 #ifdef EXTRADEBUG
+
692  Notify(PSTR(" - RFCOMM Data: "), 0x80);
+
693  for(i = 0; i < length + 4; i++) {
+
694  D_PrintHex<uint8_t > (l2capoutbuf[i], 0x80);
+
695  Notify(PSTR(" "), 0x80);
+
696  }
+
697 #endif
+
698  RFCOMM_Command(l2capoutbuf, length + 4);
+
699 }
+
700 
+
701 void SPP::sendRfcommCredit(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t credit) {
+
702  l2capoutbuf[0] = channel | direction | CR | extendAddress; // RFCOMM Address
+
703  l2capoutbuf[1] = channelType | pfBit; // RFCOMM Control
+
704  l2capoutbuf[2] = 0x01; // Length = 0
+
705  l2capoutbuf[3] = credit; // Credit
+
706  l2capoutbuf[4] = calcFcs(l2capoutbuf);
+
707 #ifdef EXTRADEBUG
+
708  Notify(PSTR(" - RFCOMM Credit Data: "), 0x80);
+
709  for(uint8_t i = 0; i < 5; i++) {
+
710  D_PrintHex<uint8_t > (l2capoutbuf[i], 0x80);
+
711  Notify(PSTR(" "), 0x80);
+
712  }
+
713 #endif
+
714  RFCOMM_Command(l2capoutbuf, 5);
715 }
716 
-
717 /* Check FCS */
-
718 bool SPP::checkFcs(uint8_t *data, uint8_t fcs) {
-
719  uint8_t temp = crc(data);
-
720  if((data[1] & 0xEF) != RFCOMM_UIH)
-
721  temp = pgm_read_byte(&rfcomm_crc_table[temp ^ data[2]]); // FCS on 3 bytes
-
722  return (pgm_read_byte(&rfcomm_crc_table[temp ^ fcs]) == 0xCF);
-
723 }
-
724 
-
725 /* Serial commands */
-
726 #if defined(ARDUINO) && ARDUINO >=100
-
727 
-
728 size_t SPP::write(uint8_t data) {
-
729  return write(&data, 1);
-
730 }
-
731 #else
-
732 
-
733 void SPP::write(uint8_t data) {
-
734  write(&data, 1);
-
735 }
-
736 #endif
-
737 
-
738 #if defined(ARDUINO) && ARDUINO >=100
-
739 
-
740 size_t SPP::write(const uint8_t *data, size_t size) {
-
741 #else
-
742 
-
743 void SPP::write(const uint8_t *data, size_t size) {
-
744 #endif
-
745  for(uint8_t i = 0; i < size; i++) {
-
746  if(sppIndex >= sizeof (sppOutputBuffer) / sizeof (sppOutputBuffer[0]))
-
747  send(); // Send the current data in the buffer
-
748  sppOutputBuffer[sppIndex++] = data[i]; // All the bytes are put into a buffer and then send using the send() function
-
749  }
-
750 #if defined(ARDUINO) && ARDUINO >=100
-
751  return size;
-
752 #endif
-
753 }
-
754 
-
755 void SPP::send() {
-
756  if(!connected || !sppIndex)
-
757  return;
-
758  uint8_t length; // This is the length of the string we are sending
-
759  uint8_t offset = 0; // This is used to keep track of where we are in the string
-
760 
-
761  l2capoutbuf[0] = rfcommChannelConnection | 0 | 0 | extendAddress; // RFCOMM Address
-
762  l2capoutbuf[1] = RFCOMM_UIH; // RFCOMM Control
-
763 
-
764  while(sppIndex) { // We will run this while loop until this variable is 0
-
765  if(sppIndex > (sizeof (l2capoutbuf) - 4)) // Check if the string is larger than the outgoing buffer
-
766  length = sizeof (l2capoutbuf) - 4;
-
767  else
-
768  length = sppIndex;
-
769 
-
770  l2capoutbuf[2] = length << 1 | 1; // Length
-
771  uint8_t i = 0;
-
772  for(; i < length; i++)
-
773  l2capoutbuf[i + 3] = sppOutputBuffer[i + offset];
-
774  l2capoutbuf[i + 3] = calcFcs(l2capoutbuf); // Calculate checksum
-
775 
-
776  RFCOMM_Command(l2capoutbuf, length + 4);
+
717 /* CRC on 2 bytes */
+
718 uint8_t SPP::crc(uint8_t *data) {
+
719  return (pgm_read_byte(&rfcomm_crc_table[pgm_read_byte(&rfcomm_crc_table[0xFF ^ data[0]]) ^ data[1]]));
+
720 }
+
721 
+
722 /* Calculate FCS */
+
723 uint8_t SPP::calcFcs(uint8_t *data) {
+
724  uint8_t temp = crc(data);
+
725  if((data[1] & 0xEF) == RFCOMM_UIH)
+
726  return (0xFF - temp); // FCS on 2 bytes
+
727  else
+
728  return (0xFF - pgm_read_byte(&rfcomm_crc_table[temp ^ data[2]])); // FCS on 3 bytes
+
729 }
+
730 
+
731 /* Check FCS */
+
732 bool SPP::checkFcs(uint8_t *data, uint8_t fcs) {
+
733  uint8_t temp = crc(data);
+
734  if((data[1] & 0xEF) != RFCOMM_UIH)
+
735  temp = pgm_read_byte(&rfcomm_crc_table[temp ^ data[2]]); // FCS on 3 bytes
+
736  return (pgm_read_byte(&rfcomm_crc_table[temp ^ fcs]) == 0xCF);
+
737 }
+
738 
+
739 /* Serial commands */
+
740 #if defined(ARDUINO) && ARDUINO >=100
+
741 
+
742 size_t SPP::write(uint8_t data) {
+
743  return write(&data, 1);
+
744 }
+
745 #else
+
746 
+
747 void SPP::write(uint8_t data) {
+
748  write(&data, 1);
+
749 }
+
750 #endif
+
751 
+
752 #if defined(ARDUINO) && ARDUINO >=100
+
753 
+
754 size_t SPP::write(const uint8_t *data, size_t size) {
+
755 #else
+
756 
+
757 void SPP::write(const uint8_t *data, size_t size) {
+
758 #endif
+
759  for(uint8_t i = 0; i < size; i++) {
+
760  if(sppIndex >= sizeof (sppOutputBuffer) / sizeof (sppOutputBuffer[0]))
+
761  send(); // Send the current data in the buffer
+
762  sppOutputBuffer[sppIndex++] = data[i]; // All the bytes are put into a buffer and then send using the send() function
+
763  }
+
764 #if defined(ARDUINO) && ARDUINO >=100
+
765  return size;
+
766 #endif
+
767 }
+
768 
+
769 void SPP::send() {
+
770  if(!connected || !sppIndex)
+
771  return;
+
772  uint8_t length; // This is the length of the string we are sending
+
773  uint8_t offset = 0; // This is used to keep track of where we are in the string
+
774 
+
775  l2capoutbuf[0] = rfcommChannelConnection | 0 | 0 | extendAddress; // RFCOMM Address
+
776  l2capoutbuf[1] = RFCOMM_UIH; // RFCOMM Control
777 
-
778  sppIndex -= length;
-
779  offset += length; // Increment the offset
-
780  }
-
781 }
-
782 
-
783 int SPP::available(void) {
-
784  return rfcommAvailable;
-
785 };
-
786 
-
787 void SPP::discard(void) {
-
788  rfcommAvailable = 0;
-
789 }
-
790 
-
791 int SPP::peek(void) {
-
792  if(rfcommAvailable == 0) // Don't read if there is nothing in the buffer
-
793  return -1;
-
794  return rfcommDataBuffer[0];
+
778  while(sppIndex) { // We will run this while loop until this variable is 0
+
779  if(sppIndex > (sizeof (l2capoutbuf) - 4)) // Check if the string is larger than the outgoing buffer
+
780  length = sizeof (l2capoutbuf) - 4;
+
781  else
+
782  length = sppIndex;
+
783 
+
784  l2capoutbuf[2] = length << 1 | 1; // Length
+
785  uint8_t i = 0;
+
786  for(; i < length; i++)
+
787  l2capoutbuf[i + 3] = sppOutputBuffer[i + offset];
+
788  l2capoutbuf[i + 3] = calcFcs(l2capoutbuf); // Calculate checksum
+
789 
+
790  RFCOMM_Command(l2capoutbuf, length + 4);
+
791 
+
792  sppIndex -= length;
+
793  offset += length; // Increment the offset
+
794  }
795 }
796 
-
797 int SPP::read(void) {
-
798  if(rfcommAvailable == 0) // Don't read if there is nothing in the buffer
-
799  return -1;
-
800  uint8_t output = rfcommDataBuffer[0];
-
801  for(uint8_t i = 1; i < rfcommAvailable; i++)
-
802  rfcommDataBuffer[i - 1] = rfcommDataBuffer[i]; // Shift the buffer one left
-
803  rfcommAvailable--;
-
804  bytesRead++;
-
805  if(bytesRead > (sizeof (rfcommDataBuffer) - 5)) { // We will send the command just before it runs out of credit
-
806  bytesRead = 0;
-
807  sendRfcommCredit(rfcommChannelConnection, rfcommDirection, 0, RFCOMM_UIH, 0x10, sizeof (rfcommDataBuffer)); // Send more credit
-
808 #ifdef EXTRADEBUG
-
809  Notify(PSTR("\r\nSent "), 0x80);
-
810  Notify((uint8_t)sizeof (rfcommDataBuffer), 0x80);
-
811  Notify(PSTR(" more credit"), 0x80);
-
812 #endif
-
813  }
-
814  return output;
-
815 }
-
#define UHS_ACL_HANDLE_OK(x, y)
Definition: BTD.h:207
-
virtual size_t write(uint8_t data)
Definition: SPP.cpp:728
-
const char * btdName
Definition: BTD.h:480
+
797 int SPP::available(void) {
+
798  return rfcommAvailable;
+
799 };
+
800 
+
801 void SPP::discard(void) {
+
802  rfcommAvailable = 0;
+
803 }
+
804 
+
805 int SPP::peek(void) {
+
806  if(rfcommAvailable == 0) // Don't read if there is nothing in the buffer
+
807  return -1;
+
808  return rfcommDataBuffer[0];
+
809 }
+
810 
+
811 int SPP::read(void) {
+
812  if(rfcommAvailable == 0) // Don't read if there is nothing in the buffer
+
813  return -1;
+
814  uint8_t output = rfcommDataBuffer[0];
+
815  for(uint8_t i = 1; i < rfcommAvailable; i++)
+
816  rfcommDataBuffer[i - 1] = rfcommDataBuffer[i]; // Shift the buffer one left
+
817  rfcommAvailable--;
+
818  bytesRead++;
+
819  if(bytesRead > (sizeof (rfcommDataBuffer) - 5)) { // We will send the command just before it runs out of credit
+
820  bytesRead = 0;
+
821  sendRfcommCredit(rfcommChannelConnection, rfcommDirection, 0, RFCOMM_UIH, 0x10, sizeof (rfcommDataBuffer)); // Send more credit
+
822 #ifdef EXTRADEBUG
+
823  Notify(PSTR("\r\nSent "), 0x80);
+
824  Notify((uint8_t)sizeof (rfcommDataBuffer), 0x80);
+
825  Notify(PSTR(" more credit"), 0x80);
+
826 #endif
+
827  }
+
828  return output;
+
829 }
+
size_t write(uint8_t data)
Definition: SPP.cpp:742
+
void onInit()
Definition: SPP.cpp:433
+
const char * btdName
Definition: BTD.h:444
#define BT_RFCOMM_RPN_RSP
Definition: SPP.h:44
-
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1231
-
#define SUCCESSFUL
Definition: BTD.h:177
-
bool sdpConnectionClaimed
Definition: BTD.h:475
-
#define RFCOMM_PSM
Definition: BTD.h:181
+
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1239
+
#define SUCCESSFUL
Definition: BTD.h:175
+
bool sdpConnectionClaimed
Definition: BTD.h:439
+
#define RFCOMM_PSM
Definition: BTD.h:179
SPP(BTD *p, const char *name="Arduino", const char *pin="0000")
Definition: SPP.cpp:45
-
Definition: BTD.h:230
-
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1284
+
Definition: BTD.h:198
+
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1292
#define RFCOMM_SABM
Definition: SPP.h:30
#define L2CAP_UUID
Definition: SPP.h:27
const uint8_t rfcomm_crc_table[256]
Definition: SPP.cpp:26
-
bool rfcommConnectionClaimed
Definition: BTD.h:477
+
bool rfcommConnectionClaimed
Definition: BTD.h:441
#define SDP_SERVICE_SEARCH_ATTRIBUTE_RESPONSE_PDU
Definition: SPP.h:25
-
#define L2CAP_FLAG_CONFIG_SDP_SUCCESS
Definition: BTD.h:149
+
uint8_t identifier
Definition: BTD.h:615
+
#define L2CAP_FLAG_CONFIG_SDP_SUCCESS
Definition: BTD.h:147
#define RFCOMM_DISC
Definition: SPP.h:34
#define SERIALPORT_UUID
Definition: SPP.h:26
-
#define L2CAP_SDP_SUCCESS
Definition: BTD.h:120
-
const char * btdPin
Definition: BTD.h:482
-
bool connected
Definition: SPP.h:79
-
#define L2CAP_CMD_INFORMATION_REQUEST
Definition: BTD.h:172
-
#define SDP_PSM
Definition: BTD.h:180
-
virtual int read(void)
Definition: SPP.cpp:797
-
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1297
+
#define L2CAP_SDP_SUCCESS
Definition: BTD.h:118
+
const char * btdPin
Definition: BTD.h:446
+
bool connected
Definition: SPP.h:84
+
#define pgm_read_byte(addr)
+
#define L2CAP_CMD_INFORMATION_REQUEST
Definition: BTD.h:170
+
#define SDP_PSM
Definition: BTD.h:178
+
int read(void)
Definition: SPP.cpp:811
+
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1305
#define extendAddress
Definition: SPP.h:36
-
#define L2CAP_RFCOMM_WAIT
Definition: BTD.h:123
+
#define L2CAP_RFCOMM_WAIT
Definition: BTD.h:121
#define Notify(...)
Definition: message.h:44
-
virtual void Run()
Definition: SPP.cpp:428
-
#define L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST
Definition: BTD.h:153
-
uint16_t hci_handle
Definition: BTD.h:487
+
void Run()
Definition: SPP.cpp:423
+
#define L2CAP_FLAG_CONNECTION_RFCOMM_REQUEST
Definition: BTD.h:151
+
uint16_t hci_handle
Definition: BTD.h:451
#define Notifyc(...)
Definition: message.h:46
-
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1142
-
virtual void Reset()
Definition: SPP.cpp:63
-
#define L2CAP_FLAG_DISCONNECT_SDP_REQUEST
Definition: BTD.h:150
+
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1150
+
Definition: BTD.h:563
+
void Reset()
Definition: SPP.cpp:60
+
void(* pFuncOnInit)(void)
Definition: BTD.h:603
+
#define L2CAP_FLAG_DISCONNECT_SDP_REQUEST
Definition: BTD.h:148
#define RFCOMM_UIH
Definition: SPP.h:32
-
virtual int available(void)
Definition: SPP.cpp:783
-
#define l2cap_check_flag(flag)
Definition: BTD.h:160
-
#define L2CAP_CMD_CONFIG_REQUEST
Definition: BTD.h:168
-
#define L2CAP_CMD_DISCONNECT_REQUEST
Definition: BTD.h:170
-
void discard(void)
Definition: SPP.cpp:787
-
#define L2CAP_SDP_WAIT
Definition: BTD.h:119
-
#define BULK_MAXPKTSIZE
Definition: BTD.h:33
-
#define L2CAP_RFCOMM_SUCCESS
Definition: BTD.h:124
+
int available(void)
Definition: SPP.cpp:797
+
#define l2cap_check_flag(flag)
Definition: BTD.h:158
+
#define L2CAP_CMD_CONFIG_REQUEST
Definition: BTD.h:166
+
#define PSTR(str)
+
#define L2CAP_CMD_DISCONNECT_REQUEST
Definition: BTD.h:168
+
void discard(void)
Definition: SPP.cpp:801
+
#define L2CAP_SDP_WAIT
Definition: BTD.h:117
+
BTD * pBtd
Definition: BTD.h:606
+
#define BULK_MAXPKTSIZE
Definition: BTD.h:34
+
#define L2CAP_RFCOMM_SUCCESS
Definition: BTD.h:122
#define BT_RFCOMM_RPN_CMD
Definition: SPP.h:43
-
int8_t registerServiceClass(BluetoothService *pService)
Definition: BTD.h:333
-
#define L2CAP_FLAG_DISCONNECT_RESPONSE
Definition: BTD.h:157
-
#define L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS
Definition: BTD.h:154
-
virtual void disconnect()
Definition: SPP.cpp:74
+
#define L2CAP_FLAG_DISCONNECT_RESPONSE
Definition: BTD.h:155
+
#define L2CAP_FLAG_CONFIG_RFCOMM_SUCCESS
Definition: BTD.h:152
+
void disconnect()
Definition: SPP.cpp:72
#define BT_RFCOMM_MSC_CMD
Definition: SPP.h:41
#define SDP_SERVICE_SEARCH_ATTRIBUTE_REQUEST_PDU
Definition: SPP.h:24
-
#define L2CAP_CMD_DISCONNECT_RESPONSE
Definition: BTD.h:171
+
#define L2CAP_CMD_DISCONNECT_RESPONSE
Definition: BTD.h:169
#define RFCOMM_UA
Definition: SPP.h:31
-
void l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh)
Definition: BTD.cpp:1310
-
#define L2CAP_CMD_CONFIG_RESPONSE
Definition: BTD.h:169
+
void l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh)
Definition: BTD.cpp:1318
+
#define L2CAP_CMD_CONFIG_RESPONSE
Definition: BTD.h:167
+
uint16_t hci_handle
Definition: BTD.h:609
#define BT_RFCOMM_PN_CMD
Definition: SPP.h:39
#define BT_RFCOMM_MSC_RSP
Definition: SPP.h:42
-
#define L2CAP_FLAG_CONNECTION_SDP_REQUEST
Definition: BTD.h:148
-
#define l2cap_clear_flag(flag)
Definition: BTD.h:162
-
#define L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST
Definition: BTD.h:155
-
#define L2CAP_DISCONNECT_RESPONSE
Definition: BTD.h:126
-
void send(void)
Definition: SPP.cpp:755
-
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1190
-
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1265
-
#define PENDING
Definition: BTD.h:176
-
#define l2cap_set_flag(flag)
Definition: BTD.h:161
-
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1248
-
#define L2CAP_CMD_CONNECTION_REQUEST
Definition: BTD.h:166
+
#define L2CAP_FLAG_CONNECTION_SDP_REQUEST
Definition: BTD.h:146
+
uint32_t l2cap_event_flag
Definition: BTD.h:612
+
#define l2cap_clear_flag(flag)
Definition: BTD.h:160
+
#define L2CAP_FLAG_DISCONNECT_RFCOMM_REQUEST
Definition: BTD.h:153
+
#define L2CAP_DISCONNECT_RESPONSE
Definition: BTD.h:124
+
void send(void)
Definition: SPP.cpp:769
+
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1198
+
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1273
+
#define PENDING
Definition: BTD.h:174
+
#define l2cap_set_flag(flag)
Definition: BTD.h:159
+
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1256
+
#define L2CAP_CMD_CONNECTION_REQUEST
Definition: BTD.h:164
#define BT_RFCOMM_PN_RSP
Definition: SPP.h:40
-
virtual void ACLData(uint8_t *ACLData)
Definition: SPP.cpp:86
-
virtual int peek(void)
Definition: SPP.cpp:791
+
bool checkHciHandle(uint8_t *buf, uint16_t handle)
Definition: BTD.h:598
+
void ACLData(uint8_t *ACLData)
Definition: SPP.cpp:84
+
int peek(void)
Definition: SPP.cpp:805
-
#define L2CAP_CMD_COMMAND_REJECT
Definition: BTD.h:165
+
#define L2CAP_CMD_COMMAND_REJECT
Definition: BTD.h:163
diff --git a/_s_p_p_8h.html b/_s_p_p_8h.html index 6bfd226c..336cda90 100644 --- a/_s_p_p_8h.html +++ b/_s_p_p_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: SPP.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -98,7 +99,7 @@ Include dependency graph for SPP.h:
- +
This graph shows which files directly or indirectly include this file:
@@ -364,7 +365,7 @@ Macros diff --git a/_s_p_p_8h__dep__incl.md5 b/_s_p_p_8h__dep__incl.md5 index 7717c9a2..c4196b87 100644 --- a/_s_p_p_8h__dep__incl.md5 +++ b/_s_p_p_8h__dep__incl.md5 @@ -1 +1 @@ -1f51bc8d7e57994b0706c73aa078945c \ No newline at end of file +8fa503e9bcede23521cf22418b0e794e \ No newline at end of file diff --git a/_s_p_p_8h__incl.map b/_s_p_p_8h__incl.map index 458dcf36..db82be58 100644 --- a/_s_p_p_8h__incl.map +++ b/_s_p_p_8h__incl.map @@ -1,4 +1,6 @@ - + + + diff --git a/_s_p_p_8h__incl.md5 b/_s_p_p_8h__incl.md5 index 92c4aedb..d72c4b71 100644 --- a/_s_p_p_8h__incl.md5 +++ b/_s_p_p_8h__incl.md5 @@ -1 +1 @@ -7a2283c4aaf9966c1076db5bf1388f90 \ No newline at end of file +8b33a921295a8bf80a577af260fae137 \ No newline at end of file diff --git a/_s_p_p_8h__incl.png b/_s_p_p_8h__incl.png index 6de5ae94..10eba2f1 100644 Binary files a/_s_p_p_8h__incl.png and b/_s_p_p_8h__incl.png differ diff --git a/_s_p_p_8h_source.html b/_s_p_p_8h_source.html index 02d90420..458a7d94 100644 --- a/_s_p_p_8h_source.html +++ b/_s_p_p_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: SPP.h Source File + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -149,126 +150,122 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
62 public:
69  SPP(BTD *p, const char *name = "Arduino", const char *pin = "0000");
70 
-
75  operator bool() {
-
76  return connected;
-
77  }
-
79  bool connected;
-
80 
-
86  virtual void ACLData(uint8_t* ACLData);
-
88  virtual void Run();
-
90  virtual void Reset();
-
92  virtual void disconnect();
-
100  virtual int available(void);
-
101 
-
103  virtual void flush(void) {
-
104  send();
-
105  };
-
110  virtual int peek(void);
-
115  virtual int read(void);
-
116 
-
117 #if defined(ARDUINO) && ARDUINO >=100
-
118 
-
123  virtual size_t write(uint8_t data);
-
130  virtual size_t write(const uint8_t* data, size_t size);
-
132  using Print::write;
-
133 #else
-
134 
-
138  virtual void write(uint8_t data);
-
144  virtual void write(const uint8_t* data, size_t size);
-
145 #endif
-
146 
-
148  void discard(void);
-
154  void send(void);
-
157 private:
-
158  /* Bluetooth dongle library pointer */
-
159  BTD *pBtd;
-
160 
-
161  /* Set true when a channel is created */
-
162  bool SDPConnected;
-
163  bool RFCOMMConnected;
-
164 
-
165  uint16_t hci_handle; // The HCI Handle for the connection
-
166 
-
167  /* Variables used by L2CAP state machines */
-
168  uint8_t l2cap_sdp_state;
-
169  uint8_t l2cap_rfcomm_state;
-
170  uint32_t l2cap_event_flag; // l2cap flags of received Bluetooth events
+
73  void disconnect();
+
80  operator bool() {
+
81  return connected;
+
82  }
+
84  bool connected;
+
85 
+
91  int available(void);
+
92 
+
94  void flush(void) {
+
95  send();
+
96  };
+
101  int peek(void);
+
106  int read(void);
+
107 
+
108 #if defined(ARDUINO) && ARDUINO >=100
+
109 
+
114  size_t write(uint8_t data);
+
121  size_t write(const uint8_t* data, size_t size);
+
123  using Print::write;
+
124 #else
+
125 
+
129  void write(uint8_t data);
+
135  void write(const uint8_t* data, size_t size);
+
136 #endif
+
137 
+
139  void discard(void);
+
145  void send(void);
+
148 protected:
+
154  void ACLData(uint8_t* ACLData);
+
156  void Run();
+
158  void Reset();
+
164  void onInit();
+
167 private:
+
168  /* Set true when a channel is created */
+
169  bool SDPConnected;
+
170  bool RFCOMMConnected;
171 
-
172  uint8_t l2capoutbuf[BULK_MAXPKTSIZE]; // General purpose buffer for l2cap out data
-
173  uint8_t rfcommbuf[10]; // Buffer for RFCOMM Commands
-
174 
-
175  /* L2CAP Channels */
-
176  uint8_t sdp_scid[2]; // L2CAP source CID for SDP
-
177  uint8_t sdp_dcid[2]; // 0x0050
-
178  uint8_t rfcomm_scid[2]; // L2CAP source CID for RFCOMM
-
179  uint8_t rfcomm_dcid[2]; // 0x0051
-
180  uint8_t identifier; // Identifier for command
-
181 
-
182  /* RFCOMM Variables */
-
183  uint8_t rfcommChannel;
-
184  uint8_t rfcommChannelConnection; // This is the channel the SPP channel will be running at
-
185  uint8_t rfcommDirection;
-
186  uint8_t rfcommCommandResponse;
-
187  uint8_t rfcommChannelType;
-
188  uint8_t rfcommPfBit;
-
189 
-
190  unsigned long timer;
-
191  bool waitForLastCommand;
-
192  bool creditSent;
-
193 
-
194  uint8_t rfcommDataBuffer[100]; // Create a 100 sized buffer for incoming data
-
195  uint8_t sppOutputBuffer[100]; // Create a 100 sized buffer for outgoing SPP data
-
196  uint8_t sppIndex;
-
197  uint8_t rfcommAvailable;
-
198 
-
199  bool firstMessage; // Used to see if it's the first SDP request received
-
200  uint8_t bytesRead; // Counter to see when it's time to send more credit
+
172  /* Variables used by L2CAP state machines */
+
173  uint8_t l2cap_sdp_state;
+
174  uint8_t l2cap_rfcomm_state;
+
175 
+
176  uint8_t l2capoutbuf[BULK_MAXPKTSIZE]; // General purpose buffer for l2cap out data
+
177  uint8_t rfcommbuf[10]; // Buffer for RFCOMM Commands
+
178 
+
179  /* L2CAP Channels */
+
180  uint8_t sdp_scid[2]; // L2CAP source CID for SDP
+
181  uint8_t sdp_dcid[2]; // 0x0050
+
182  uint8_t rfcomm_scid[2]; // L2CAP source CID for RFCOMM
+
183  uint8_t rfcomm_dcid[2]; // 0x0051
+
184 
+
185  /* RFCOMM Variables */
+
186  uint8_t rfcommChannel;
+
187  uint8_t rfcommChannelConnection; // This is the channel the SPP channel will be running at
+
188  uint8_t rfcommDirection;
+
189  uint8_t rfcommCommandResponse;
+
190  uint8_t rfcommChannelType;
+
191  uint8_t rfcommPfBit;
+
192 
+
193  uint32_t timer;
+
194  bool waitForLastCommand;
+
195  bool creditSent;
+
196 
+
197  uint8_t rfcommDataBuffer[100]; // Create a 100 sized buffer for incoming data
+
198  uint8_t sppOutputBuffer[100]; // Create a 100 sized buffer for outgoing SPP data
+
199  uint8_t sppIndex;
+
200  uint8_t rfcommAvailable;
201 
-
202  /* State machines */
-
203  void SDP_task(); // SDP state machine
-
204  void RFCOMM_task(); // RFCOMM state machine
-
205 
-
206  /* SDP Commands */
-
207  void SDP_Command(uint8_t *data, uint8_t nbytes);
-
208  void serviceNotSupported(uint8_t transactionIDHigh, uint8_t transactionIDLow);
-
209  void serialPortResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);
-
210  void serialPortResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);
-
211  void l2capResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);
-
212  void l2capResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);
-
213 
-
214  /* RFCOMM Commands */
-
215  void RFCOMM_Command(uint8_t *data, uint8_t nbytes);
-
216  void sendRfcomm(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t *data, uint8_t length);
-
217  void sendRfcommCredit(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t credit);
-
218  uint8_t calcFcs(uint8_t *data);
-
219  bool checkFcs(uint8_t *data, uint8_t fcs);
-
220  uint8_t crc(uint8_t *data);
-
221 };
-
222 #endif
-
virtual size_t write(uint8_t data)
Definition: SPP.cpp:728
+
202  bool firstMessage; // Used to see if it's the first SDP request received
+
203  uint8_t bytesRead; // Counter to see when it's time to send more credit
+
204 
+
205  /* State machines */
+
206  void SDP_task(); // SDP state machine
+
207  void RFCOMM_task(); // RFCOMM state machine
+
208 
+
209  /* SDP Commands */
+
210  void SDP_Command(uint8_t *data, uint8_t nbytes);
+
211  void serviceNotSupported(uint8_t transactionIDHigh, uint8_t transactionIDLow);
+
212  void serialPortResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);
+
213  void serialPortResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);
+
214  void l2capResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);
+
215  void l2capResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);
+
216 
+
217  /* RFCOMM Commands */
+
218  void RFCOMM_Command(uint8_t *data, uint8_t nbytes);
+
219  void sendRfcomm(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t *data, uint8_t length);
+
220  void sendRfcommCredit(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t credit);
+
221  uint8_t calcFcs(uint8_t *data);
+
222  bool checkFcs(uint8_t *data, uint8_t fcs);
+
223  uint8_t crc(uint8_t *data);
+
224 };
+
225 #endif
+
size_t write(uint8_t data)
Definition: SPP.cpp:742
+
void onInit()
Definition: SPP.cpp:433
SPP(BTD *p, const char *name="Arduino", const char *pin="0000")
Definition: SPP.cpp:45
-
Definition: BTD.h:230
-
bool connected
Definition: SPP.h:79
-
virtual int read(void)
Definition: SPP.cpp:797
-
virtual void Run()
Definition: SPP.cpp:428
-
Definition: BTD.h:211
-
virtual void Reset()
Definition: SPP.cpp:63
-
virtual void flush(void)
Definition: SPP.h:103
-
virtual int available(void)
Definition: SPP.cpp:783
-
void discard(void)
Definition: SPP.cpp:787
-
#define BULK_MAXPKTSIZE
Definition: BTD.h:33
-
virtual void disconnect()
Definition: SPP.cpp:74
+
Definition: BTD.h:198
+
void flush(void)
Definition: SPP.h:94
+
bool connected
Definition: SPP.h:84
+
int read(void)
Definition: SPP.cpp:811
+
void Run()
Definition: SPP.cpp:423
+
Definition: BTD.h:563
+
void Reset()
Definition: SPP.cpp:60
+
int available(void)
Definition: SPP.cpp:797
+
void discard(void)
Definition: SPP.cpp:801
+
#define BULK_MAXPKTSIZE
Definition: BTD.h:34
+
void disconnect()
Definition: SPP.cpp:72
Definition: SPP.h:61
-
void send(void)
Definition: SPP.cpp:755
+
void send(void)
Definition: SPP.cpp:769
-
virtual void ACLData(uint8_t *ACLData)
Definition: SPP.cpp:86
-
virtual int peek(void)
Definition: SPP.cpp:791
+
void ACLData(uint8_t *ACLData)
Definition: SPP.cpp:84
+
int peek(void)
Definition: SPP.cpp:805
diff --git a/_usb_8cpp.html b/_usb_8cpp.html index ea25f889..2358dfd1 100644 --- a/_usb_8cpp.html +++ b/_usb_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Usb.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -104,7 +105,7 @@ Include dependency graph for Usb.cpp:
diff --git a/_usb_8cpp__incl.md5 b/_usb_8cpp__incl.md5 index e440b831..f71e6530 100644 --- a/_usb_8cpp__incl.md5 +++ b/_usb_8cpp__incl.md5 @@ -1 +1 @@ -86d6ea84d3f0ddc03b2836246a892476 \ No newline at end of file +983a9d4c5eeb9a3736dcb2d9192937eb \ No newline at end of file diff --git a/_usb_8cpp_source.html b/_usb_8cpp_source.html index d929651e..397c0170 100644 --- a/_usb_8cpp_source.html +++ b/_usb_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Usb.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -168,7 +169,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
77  return 0;
78 }
79 
-
80 uint8_t USB::SetAddress(uint8_t addr, uint8_t ep, EpInfo **ppep, uint16_t &nak_limit) {
+
80 uint8_t USB::SetAddress(uint8_t addr, uint8_t ep, EpInfo **ppep, uint16_t *nak_limit) {
81  UsbDevice *p = addrPool.GetUsbDevicePtr(addr);
82 
83  if(!p)
@@ -182,8 +183,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
91  if(!*ppep)
92  return USB_ERROR_EP_NOT_FOUND_IN_TBL;
93 
-
94  nak_limit = (0x0001UL << (((*ppep)->bmNakPower > USB_NAK_MAX_POWER) ? USB_NAK_MAX_POWER : (*ppep)->bmNakPower));
-
95  nak_limit--;
+
94  *nak_limit = (0x0001UL << (((*ppep)->bmNakPower > USB_NAK_MAX_POWER) ? USB_NAK_MAX_POWER : (*ppep)->bmNakPower));
+
95  *nak_limit--;
96  /*
97  USBTRACE2("\r\nAddress: ", addr);
98  USBTRACE2(" EP: ", ep);
@@ -223,7 +224,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
132  EpInfo *pep = NULL;
133  uint16_t nak_limit = 0;
134 
-
135  rcode = SetAddress(addr, ep, &pep, nak_limit);
+
135  rcode = SetAddress(addr, ep, &pep, &nak_limit);
136 
137  if(rcode)
138  return rcode;
@@ -231,10 +232,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
140  direction = ((bmReqType & 0x80) > 0);
141 
142  /* fill in setup packet */
-
143  setup_pkt.ReqType_u.bmRequestType = bmReqType;
+
143  setup_pkt.ReqType_u.bmRequestType = bmReqType;
144  setup_pkt.bRequest = bRequest;
-
145  setup_pkt.wVal_u.wValueLo = wValLo;
-
146  setup_pkt.wVal_u.wValueHi = wValHi;
+
145  setup_pkt.wVal_u.wValueLo = wValLo;
+
146  setup_pkt.wVal_u.wValueHi = wValHi;
147  setup_pkt.wIndex = wInd;
148  setup_pkt.wLength = total;
149 
@@ -298,7 +299,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
207  EpInfo *pep = NULL;
208  uint16_t nak_limit = 0;
209 
-
210  uint8_t rcode = SetAddress(addr, ep, &pep, nak_limit);
+
210  uint8_t rcode = SetAddress(addr, ep, &pep, &nak_limit);
211 
212  if(rcode) {
213  USBTRACE3("(USB::InTransfer) SetAddress Failed ", rcode, 0x81);
@@ -384,7 +385,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
293  EpInfo *pep = NULL;
294  uint16_t nak_limit = 0;
295 
-
296  uint8_t rcode = SetAddress(addr, ep, &pep, nak_limit);
+
296  uint8_t rcode = SetAddress(addr, ep, &pep, &nak_limit);
297 
298  if(rcode)
299  return rcode;
@@ -619,7 +620,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
528 }
529 
530 uint8_t USB::DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed) {
-
531  //uint8_t buf[12];
+
531  //uint8_t buf[12];
532  uint8_t rcode;
533  UsbDevice *p0 = NULL, *p = NULL;
534 
@@ -789,260 +790,263 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
698  // Allocate new address according to device class
699  //bAddress = addrPool.AllocAddress(parent, false, port);
700 
-
701  //if (!bAddress)
-
702  // return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL;
-
703  uint16_t vid = udd->idVendor;
-
704  uint16_t pid = udd->idProduct;
-
705  uint8_t klass = udd->bDeviceClass;
-
706 
-
707  // Attempt to configure if VID/PID or device class matches with a driver
-
708  for(devConfigIndex = 0; devConfigIndex < USB_NUMDEVICES; devConfigIndex++) {
-
709  if(!devConfig[devConfigIndex]) continue; // no driver
-
710  if(devConfig[devConfigIndex]->GetAddress()) continue; // consumed
-
711  if(devConfig[devConfigIndex]->VIDPIDOK(vid, pid) || devConfig[devConfigIndex]->DEVCLASSOK(klass)) {
-
712  rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);
-
713  if(rcode != USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED)
-
714  break;
-
715  }
-
716  }
-
717 
-
718  if(devConfigIndex < USB_NUMDEVICES) {
-
719  return rcode;
-
720  }
-
721 
-
722 
-
723  // blindly attempt to configure
-
724  for(devConfigIndex = 0; devConfigIndex < USB_NUMDEVICES; devConfigIndex++) {
-
725  if(!devConfig[devConfigIndex]) continue;
-
726  if(devConfig[devConfigIndex]->GetAddress()) continue; // consumed
-
727  if(devConfig[devConfigIndex]->VIDPIDOK(vid, pid) || devConfig[devConfigIndex]->DEVCLASSOK(klass)) continue; // If this is true it means it must have returned USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED above
-
728  rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);
-
729 
-
730  //printf("ERROR ENUMERATING %2.2x\r\n", rcode);
-
731  if(!(rcode == USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED || rcode == USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE)) {
-
732  // in case of an error dev_index should be reset to 0
-
733  // in order to start from the very beginning the
-
734  // next time the program gets here
-
735  //if (rcode != USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE)
-
736  // devConfigIndex = 0;
-
737  return rcode;
-
738  }
-
739  }
-
740  // if we get here that means that the device class is not supported by any of registered classes
-
741  rcode = DefaultAddressing(parent, port, lowspeed);
-
742 
-
743  return rcode;
-
744 }
+
701  uint16_t vid = udd->idVendor;
+
702  uint16_t pid = udd->idProduct;
+
703  uint8_t klass = udd->bDeviceClass;
+
704  uint8_t subklass = udd->bDeviceSubClass;
+
705  // Attempt to configure if VID/PID or device class matches with a driver
+
706  // Qualify with subclass too.
+
707  //
+
708  // VID/PID & class tests default to false for drivers not yet ported
+
709  // subclass defaults to true, so you don't have to define it if you don't have to.
+
710  //
+
711  for(devConfigIndex = 0; devConfigIndex < USB_NUMDEVICES; devConfigIndex++) {
+
712  if(!devConfig[devConfigIndex]) continue; // no driver
+
713  if(devConfig[devConfigIndex]->GetAddress()) continue; // consumed
+
714  if(devConfig[devConfigIndex]->DEVSUBCLASSOK(subklass) && (devConfig[devConfigIndex]->VIDPIDOK(vid, pid) || devConfig[devConfigIndex]->DEVCLASSOK(klass))) {
+
715  rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);
+
716  if(rcode != USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED)
+
717  break;
+
718  }
+
719  }
+
720 
+
721  if(devConfigIndex < USB_NUMDEVICES) {
+
722  return rcode;
+
723  }
+
724 
+
725 
+
726  // blindly attempt to configure
+
727  for(devConfigIndex = 0; devConfigIndex < USB_NUMDEVICES; devConfigIndex++) {
+
728  if(!devConfig[devConfigIndex]) continue;
+
729  if(devConfig[devConfigIndex]->GetAddress()) continue; // consumed
+
730  if(devConfig[devConfigIndex]->DEVSUBCLASSOK(subklass) && (devConfig[devConfigIndex]->VIDPIDOK(vid, pid) || devConfig[devConfigIndex]->DEVCLASSOK(klass))) continue; // If this is true it means it must have returned USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED above
+
731  rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);
+
732 
+
733  //printf("ERROR ENUMERATING %2.2x\r\n", rcode);
+
734  if(!(rcode == USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED || rcode == USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE)) {
+
735  // in case of an error dev_index should be reset to 0
+
736  // in order to start from the very beginning the
+
737  // next time the program gets here
+
738  //if (rcode != USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE)
+
739  // devConfigIndex = 0;
+
740  return rcode;
+
741  }
+
742  }
+
743  // if we get here that means that the device class is not supported by any of registered classes
+
744  rcode = DefaultAddressing(parent, port, lowspeed);
745 
-
746 uint8_t USB::ReleaseDevice(uint8_t addr) {
-
747  if(!addr)
-
748  return 0;
-
749 
-
750  for(uint8_t i = 0; i < USB_NUMDEVICES; i++) {
-
751  if(!devConfig[i]) continue;
-
752  if(devConfig[i]->GetAddress() == addr)
-
753  return devConfig[i]->Release();
-
754  }
-
755  return 0;
-
756 }
-
757 
-
758 #if 1
-
759 //get device descriptor
+
746  return rcode;
+
747 }
+
748 
+
749 uint8_t USB::ReleaseDevice(uint8_t addr) {
+
750  if(!addr)
+
751  return 0;
+
752 
+
753  for(uint8_t i = 0; i < USB_NUMDEVICES; i++) {
+
754  if(!devConfig[i]) continue;
+
755  if(devConfig[i]->GetAddress() == addr)
+
756  return devConfig[i]->Release();
+
757  }
+
758  return 0;
+
759 }
760 
-
761 uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) {
-
762  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, nbytes, dataptr, NULL));
-
763 }
-
764 //get configuration descriptor
-
765 
-
766 uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) {
-
767  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, nbytes, dataptr, NULL));
-
768 }
-
769 
-
770 /* Requests Configuration Descriptor. Sends two Get Conf Descr requests. The first one gets the total length of all descriptors, then the second one requests this
-
771  total length. The length of the first request can be shorter ( 4 bytes ), however, there are devices which won't work unless this length is set to 9 */
-
772 uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser *p) {
-
773  const uint8_t bufSize = 64;
-
774  uint8_t buf[bufSize];
-
775  USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_CONFIGURATION_DESCRIPTOR *>(buf);
-
776 
-
777  uint8_t ret = getConfDescr(addr, ep, 9, conf, buf);
-
778 
-
779  if(ret)
-
780  return ret;
+
761 #if 1
+
762 //get device descriptor
+
763 
+
764 uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) {
+
765  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, nbytes, dataptr, NULL));
+
766 }
+
767 //get configuration descriptor
+
768 
+
769 uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) {
+
770  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, nbytes, dataptr, NULL));
+
771 }
+
772 
+
773 /* Requests Configuration Descriptor. Sends two Get Conf Descr requests. The first one gets the total length of all descriptors, then the second one requests this
+
774  total length. The length of the first request can be shorter ( 4 bytes ), however, there are devices which won't work unless this length is set to 9 */
+
775 uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser *p) {
+
776  const uint8_t bufSize = 64;
+
777  uint8_t buf[bufSize];
+
778  USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_CONFIGURATION_DESCRIPTOR *>(buf);
+
779 
+
780  uint8_t ret = getConfDescr(addr, ep, 9, conf, buf);
781 
-
782  uint16_t total = ucd->wTotalLength;
-
783 
-
784  //USBTRACE2("\r\ntotal conf.size:", total);
-
785 
-
786  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, total, bufSize, buf, p));
-
787 }
+
782  if(ret)
+
783  return ret;
+
784 
+
785  uint16_t total = ucd->wTotalLength;
+
786 
+
787  //USBTRACE2("\r\ntotal conf.size:", total);
788 
-
789 //get string descriptor
-
790 
-
791 uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) {
-
792  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns, ns, dataptr, NULL));
-
793 }
-
794 //set address
-
795 
-
796 uint8_t USB::setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) {
-
797  uint8_t rcode = ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL);
-
798  //delay(2); //per USB 2.0 sect.9.2.6.3
-
799  delay(300); // Older spec says you should wait at least 200ms
-
800  return rcode;
-
801  //return ( ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL));
-
802 }
-
803 //set configuration
-
804 
-
805 uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) {
-
806  return ( ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL));
-
807 }
-
808 
-
809 #endif // defined(USB_METHODS_INLINE)
-
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:766
+
789  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, total, bufSize, buf, p));
+
790 }
+
791 
+
792 //get string descriptor
+
793 
+
794 uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) {
+
795  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns, ns, dataptr, NULL));
+
796 }
+
797 //set address
+
798 
+
799 uint8_t USB::setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) {
+
800  uint8_t rcode = ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL);
+
801  //delay(2); //per USB 2.0 sect.9.2.6.3
+
802  delay(300); // Older spec says you should wait at least 200ms
+
803  return rcode;
+
804  //return ( ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL));
+
805 }
+
806 //set configuration
+
807 
+
808 uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) {
+
809  return ( ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL));
+
810 }
+
811 
+
812 #endif // defined(USB_METHODS_INLINE)
+
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:769
uint8_t bmRcvToggle
Definition: address.h:41
Definition: address.h:83
-
virtual uint8_t Poll()
Definition: UsbCore.h:134
-
#define USB_ERROR_EP_NOT_FOUND_IN_TBL
Definition: UsbCore.h:85
-
#define bmHUBPRE
Definition: max3421e.h:170
-
#define USB_ATTACHED_SUBSTATE_WAIT_RESET
Definition: UsbCore.h:112
-
#define FSHOST
Definition: max3421e.h:35
-
#define rHCTL
Definition: max3421e.h:179
+
virtual uint8_t Poll()
Definition: UsbCore.h:136
+
#define USB_ERROR_EP_NOT_FOUND_IN_TBL
Definition: UsbCore.h:87
+
#define bmHUBPRE
Definition: max3421e.h:165
+
#define USB_ATTACHED_SUBSTATE_WAIT_RESET
Definition: UsbCore.h:114
+
#define FSHOST
Definition: max3421e.h:30
+
#define rHCTL
Definition: max3421e.h:174
+
union SETUP_PKT::@31 wVal_u
EpInfo * epinfo
Definition: address.h:76
bool lowspeed
Definition: address.h:79
-
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:81
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
uint8_t bmNakPower
Definition: address.h:42
-
union SETUP_PKT::@26 ReqType_u
uint16_t wTotalLength
Definition: usb_ch9.h:119
EpInfo * getEpInfoEntry(uint8_t addr, uint8_t ep)
Definition: Usb.cpp:44
Definition: address.h:75
-
#define bmSOFKAENAB
Definition: max3421e.h:171
+
#define bmSOFKAENAB
Definition: max3421e.h:166
#define USB_DESCRIPTOR_STRING
Definition: usb_ch9.h:65
-
uint16_t wLength
Definition: UsbCore.h:178
-
#define USB_SETTLE_DELAY
Definition: UsbCore.h:95
-
#define USB_ATTACHED_SUBSTATE_SETTLE
Definition: UsbCore.h:108
-
uint8_t getVbusState(void)
Definition: usbhost.h:105
-
#define bmRCVTOGRD
Definition: max3421e.h:204
-
#define USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE
Definition: UsbCore.h:76
-
#define USB_RETRY_LIMIT
Definition: UsbCore.h:94
+
uint16_t wLength
Definition: UsbCore.h:185
+
#define USB_SETTLE_DELAY
Definition: UsbCore.h:97
+
#define USB_ATTACHED_SUBSTATE_SETTLE
Definition: UsbCore.h:110
+
uint8_t getVbusState(void)
Definition: usbhost.h:128
+
#define bmRCVTOGRD
Definition: max3421e.h:199
+
#define USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE
Definition: UsbCore.h:78
+
#define USB_RETRY_LIMIT
Definition: UsbCore.h:96
#define USB_REQUEST_GET_DESCRIPTOR
Definition: usb_ch9.h:37
#define USB_DESCRIPTOR_DEVICE
Definition: usb_ch9.h:63
-
#define bmRCVTOG1
Definition: max3421e.h:186
-
#define USB_ERROR_INVALID_MAX_PKT_SIZE
Definition: UsbCore.h:84
-
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:805
-
#define USB_STATE_DETACHED
Definition: UsbCore.h:104
-
#define USB_NUMDEVICES
Definition: UsbCore.h:97
+
#define bmRCVTOG1
Definition: max3421e.h:181
+
#define USB_ERROR_INVALID_MAX_PKT_SIZE
Definition: UsbCore.h:86
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
+
#define USB_STATE_DETACHED
Definition: UsbCore.h:106
+
#define USB_NUMDEVICES
Definition: UsbCore.h:99
-
#define rRCVBC
Definition: max3421e.h:45
-
#define hrJERR
Definition: max3421e.h:225
+
#define rRCVBC
Definition: max3421e.h:40
+
#define hrJERR
Definition: max3421e.h:220
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
-
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: UsbCore.h:126
-
uint8_t Task()
Definition: usbhost.h:405
-
#define hrSUCCESS
Definition: max3421e.h:212
-
#define USB_STATE_ERROR
Definition: UsbCore.h:117
-
uint8_t bmRequestType
Definition: UsbCore.h:159
-
#define bmSNDTOGRD
Definition: max3421e.h:205
+
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: UsbCore.h:128
+
uint8_t Task()
Definition: usbhost.h:482
+
#define hrSUCCESS
Definition: max3421e.h:207
+
#define USB_STATE_ERROR
Definition: UsbCore.h:119
+
uint8_t bmRequestType
Definition: UsbCore.h:166
+
#define bmSNDTOGRD
Definition: max3421e.h:200
uint8_t epAttribs
Definition: address.h:37
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
Definition: Usb.cpp:126
#define USB_DESCRIPTOR_CONFIGURATION
Definition: usb_ch9.h:64
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
-
#define bmHXFRDNIRQ
Definition: max3421e.h:151
-
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:796
+
#define bmHXFRDNIRQ
Definition: max3421e.h:146
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
USB(void)
Definition: Usb.cpp:25
-
#define USB_STATE_RUNNING
Definition: UsbCore.h:116
+
#define USB_STATE_RUNNING
Definition: UsbCore.h:118
Definition: usb_ch9.h:116
uint8_t epAddr
Definition: address.h:33
-
#define rRCVFIFO
Definition: max3421e.h:42
+
#define rRCVFIFO
Definition: max3421e.h:37
#define USB_NAK_MAX_POWER
Definition: address.h:27
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)
Definition: address.h:180
-
uint16_t wIndex
Definition: UsbCore.h:177
-
#define bmBUSRST
Definition: max3421e.h:181
-
#define tokOUT
Definition: max3421e.h:195
-
#define tokIN
Definition: max3421e.h:194
-
#define LSHOST
Definition: max3421e.h:36
-
#define USB_XFER_TIMEOUT
Definition: UsbCore.h:92
+
uint16_t wIndex
Definition: UsbCore.h:184
+
#define bmBUSRST
Definition: max3421e.h:176
+
#define tokOUT
Definition: max3421e.h:190
+
#define tokIN
Definition: max3421e.h:189
+
#define LSHOST
Definition: max3421e.h:31
+
#define USB_XFER_TIMEOUT
Definition: UsbCore.h:94
Definition: address.h:32
-
#define rMODE
Definition: max3421e.h:165
+
#define rMODE
Definition: max3421e.h:160
void setUsbTaskState(uint8_t state)
Definition: Usb.cpp:40
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
Definition: Usb.cpp:292
-
#define hrNAK
Definition: max3421e.h:216
-
#define bmREQ_GET_DESCR
Definition: UsbCore.h:45
-
#define rSNDBC
Definition: max3421e.h:46
-
#define rHRSL
Definition: max3421e.h:201
-
#define USB_ATTACHED_SUBSTATE_RESET_DEVICE
Definition: UsbCore.h:109
-
uint8_t * bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p)
Definition: usbhost.h:223
-
#define tokINHS
Definition: max3421e.h:196
-
#define bmLOWSPEED
Definition: max3421e.h:169
-
virtual void ResetHubPort(uint8_t port)
Definition: UsbCore.h:142
-
uint8_t * bytesWr(uint8_t reg, uint8_t nbytes, uint8_t *data_p)
Definition: usbhost.h:155
-
uint8_t getStrDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t *dataptr)
Definition: Usb.cpp:791
+
#define hrNAK
Definition: max3421e.h:211
+
#define bmREQ_GET_DESCR
Definition: UsbCore.h:47
+
#define rSNDBC
Definition: max3421e.h:41
+
#define rHRSL
Definition: max3421e.h:196
+
#define USB_ATTACHED_SUBSTATE_RESET_DEVICE
Definition: UsbCore.h:111
+
uint8_t * bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p)
Definition: usbhost.h:283
+
#define tokINHS
Definition: max3421e.h:191
+
#define bmLOWSPEED
Definition: max3421e.h:164
+
virtual void ResetHubPort(uint8_t port)
Definition: UsbCore.h:144
+
uint8_t * bytesWr(uint8_t reg, uint8_t nbytes, uint8_t *data_p)
Definition: usbhost.h:191
+
uint8_t getStrDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t *dataptr)
Definition: Usb.cpp:794
#define USB_REQUEST_SET_ADDRESS
Definition: usb_ch9.h:36
-
#define tokSETUP
Definition: max3421e.h:193
-
#define rHXFR
Definition: max3421e.h:190
-
#define rHIRQ
Definition: max3421e.h:142
+
#define tokSETUP
Definition: max3421e.h:188
+
#define rHXFR
Definition: max3421e.h:185
+
#define rHIRQ
Definition: max3421e.h:137
uint8_t bmSndToggle
Definition: address.h:40
-
#define rSNDFIFO
Definition: max3421e.h:43
-
Definition: UsbCore.h:185
-
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:83
+
#define rSNDFIFO
Definition: max3421e.h:38
+
Definition: UsbCore.h:192
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
uint8_t devAddress
Definition: address.h:67
-
Definition: UsbCore.h:156
-
#define tokOUTHS
Definition: max3421e.h:197
+
Definition: UsbCore.h:163
+
#define tokOUTHS
Definition: max3421e.h:192
uint8_t getUsbTaskState(void)
Definition: Usb.cpp:36
-
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:80
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
Definition: Usb.cpp:206
-
#define USB_STATE_MASK
Definition: UsbCore.h:102
-
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:75
+
#define USB_STATE_MASK
Definition: UsbCore.h:104
+
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:77
+
union SETUP_PKT::@30 ReqType_u
void Task(void)
Definition: Usb.cpp:424
-
#define USB_DETACHED_SUBSTATE_ILLEGAL
Definition: UsbCore.h:107
-
#define hrTIMEOUT
Definition: max3421e.h:226
-
#define rPERADDR
Definition: max3421e.h:177
-
#define bmRCVDAVIRQ
Definition: max3421e.h:146
-
#define USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE
Definition: UsbCore.h:110
-
void regWr(uint8_t reg, uint8_t data)
Definition: usbhost.h:130
-
#define bmRCVTOG0
Definition: max3421e.h:185
+
#define USB_DETACHED_SUBSTATE_ILLEGAL
Definition: UsbCore.h:109
+
#define hrTIMEOUT
Definition: max3421e.h:221
+
#define rPERADDR
Definition: max3421e.h:172
+
#define bmRCVDAVIRQ
Definition: max3421e.h:141
+
#define USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE
Definition: UsbCore.h:112
+
void regWr(uint8_t reg, uint8_t data)
Definition: usbhost.h:153
+
#define bmRCVTOG0
Definition: max3421e.h:180
uint8_t epcount
Definition: address.h:78
-
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:78
-
#define USB_STATE_CONFIGURING
Definition: UsbCore.h:115
+
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:80
+
#define USB_STATE_CONFIGURING
Definition: UsbCore.h:117
uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit)
Definition: Usb.cpp:376
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: UsbCore.h:122
-
#define bmSNDTOG0
Definition: max3421e.h:187
-
uint8_t regRd(uint8_t reg)
Definition: usbhost.h:197
+
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: UsbCore.h:124
+
#define bmSNDTOG0
Definition: max3421e.h:182
+
uint8_t regRd(uint8_t reg)
Definition: usbhost.h:249
uint8_t maxPktSize
Definition: address.h:34
-
AddressPool & GetAddressPool()
Definition: UsbCore.h:206
-
#define USB_ERROR_INVALID_ARGUMENT
Definition: UsbCore.h:82
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
#define USB_ERROR_INVALID_ARGUMENT
Definition: UsbCore.h:84
uint8_t Configuring(uint8_t parent, uint8_t port, bool lowspeed)
Definition: Usb.cpp:652
-
union SETUP_PKT::@27 wVal_u
#define USBTRACE3(s, r, l)
Definition: macros.h:78
-
uint8_t bRequest
Definition: UsbCore.h:167
-
#define SE0
Definition: max3421e.h:33
+
uint8_t bRequest
Definition: UsbCore.h:174
+
#define SE0
Definition: max3421e.h:28
virtual void FreeAddress(uint8_t addr)
Definition: address.h:254
-
virtual uint8_t Release()
Definition: UsbCore.h:130
-
#define bmFRAMEIRQ
Definition: max3421e.h:150
-
#define hrTOGERR
Definition: max3421e.h:218
-
#define SE1
Definition: max3421e.h:34
-
#define rSUDFIFO
Definition: max3421e.h:44
+
virtual uint8_t Release()
Definition: UsbCore.h:132
+
#define bmFRAMEIRQ
Definition: max3421e.h:145
+
#define hrTOGERR
Definition: max3421e.h:213
+
#define SE1
Definition: max3421e.h:29
+
#define rSUDFIFO
Definition: max3421e.h:39
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)
Definition: address.h:202
-
#define bmREQ_SET
Definition: UsbCore.h:46
+
#define bmREQ_SET
Definition: UsbCore.h:48
UsbDeviceAddress address
Definition: address.h:77
#define USB_REQUEST_SET_CONFIGURATION
Definition: usb_ch9.h:40
-
#define USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE
Definition: UsbCore.h:106
-
uint8_t wValueHi
Definition: UsbCore.h:174
+
#define USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE
Definition: UsbCore.h:108
+
uint8_t wValueHi
Definition: UsbCore.h:181
uint8_t DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed)
Definition: Usb.cpp:530
-
#define USB_DETACHED_SUBSTATE_INITIALIZE
Definition: UsbCore.h:105
-
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:761
-
#define USB_ATTACHED_SUBSTATE_WAIT_SOF
Definition: UsbCore.h:111
-
uint8_t wValueLo
Definition: UsbCore.h:173
-
#define bmSNDTOG1
Definition: max3421e.h:188
-
uint8_t ReleaseDevice(uint8_t addr)
Definition: Usb.cpp:746
-
#define USB_ERROR_TRANSFER_TIMEOUT
Definition: UsbCore.h:90
-
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
Definition: UsbCore.h:86
+
#define USB_DETACHED_SUBSTATE_INITIALIZE
Definition: UsbCore.h:107
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
+
#define USB_ATTACHED_SUBSTATE_WAIT_SOF
Definition: UsbCore.h:113
+
uint8_t wValueLo
Definition: UsbCore.h:180
+
#define bmSNDTOG1
Definition: max3421e.h:183
+
uint8_t ReleaseDevice(uint8_t addr)
Definition: Usb.cpp:749
+
#define USB_ERROR_TRANSFER_TIMEOUT
Definition: UsbCore.h:92
+
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
Definition: UsbCore.h:88
Definition: usb_ch9.h:98
diff --git a/_usb_8h.html b/_usb_8h.html index e9816278..88df0d8f 100644 --- a/_usb_8h.html +++ b/_usb_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Usb.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -94,7 +95,7 @@ This graph shows which files directly or indirectly include this file:
- +

Go to the source code of this file.

@@ -103,7 +104,7 @@ This graph shows which files directly or indirectly include this file: diff --git a/_usb_8h__dep__incl.map b/_usb_8h__dep__incl.map index 66b0741d..7cc17220 100644 --- a/_usb_8h__dep__incl.map +++ b/_usb_8h__dep__incl.map @@ -1,51 +1,51 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/_usb_8h__dep__incl.md5 b/_usb_8h__dep__incl.md5 index 900bfaa1..55ecb829 100644 --- a/_usb_8h__dep__incl.md5 +++ b/_usb_8h__dep__incl.md5 @@ -1 +1 @@ -2f238cc81ba3ca92eea58f17f8d557d0 \ No newline at end of file +dde4986e96594b8b430995e47f0bfe36 \ No newline at end of file diff --git a/_usb_8h__dep__incl.png b/_usb_8h__dep__incl.png index 445dd76a..fc4a98a8 100644 Binary files a/_usb_8h__dep__incl.png and b/_usb_8h__dep__incl.png differ diff --git a/_usb_8h_source.html b/_usb_8h_source.html index b6712402..40351775 100644 --- a/_usb_8h_source.html +++ b/_usb_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Usb.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -148,7 +149,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/_usb_core_8h.html b/_usb_core_8h.html index 4ac0f93b..0ca209a2 100644 --- a/_usb_core_8h.html +++ b/_usb_core_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: UsbCore.h File Reference + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -185,7 +186,7 @@ Macros   #define USB_ERROR_TRANSFER_TIMEOUT   0xFF   -#define USB_XFER_TIMEOUT   10000 +#define USB_XFER_TIMEOUT   5000   #define USB_RETRY_LIMIT   3   @@ -244,7 +245,7 @@ Typedefs
-

Definition at line 45 of file UsbCore.h.

+

Definition at line 47 of file UsbCore.h.

@@ -258,7 +259,7 @@ Typedefs
-

Definition at line 46 of file UsbCore.h.

+

Definition at line 48 of file UsbCore.h.

@@ -272,7 +273,7 @@ Typedefs
-

Definition at line 47 of file UsbCore.h.

+

Definition at line 49 of file UsbCore.h.

@@ -286,7 +287,7 @@ Typedefs
-

Definition at line 54 of file UsbCore.h.

+

Definition at line 56 of file UsbCore.h.

@@ -300,7 +301,7 @@ Typedefs
-

Definition at line 55 of file UsbCore.h.

+

Definition at line 57 of file UsbCore.h.

@@ -314,7 +315,7 @@ Typedefs
-

Definition at line 56 of file UsbCore.h.

+

Definition at line 58 of file UsbCore.h.

@@ -328,7 +329,7 @@ Typedefs
-

Definition at line 57 of file UsbCore.h.

+

Definition at line 59 of file UsbCore.h.

@@ -342,7 +343,7 @@ Typedefs
-

Definition at line 58 of file UsbCore.h.

+

Definition at line 60 of file UsbCore.h.

@@ -356,7 +357,7 @@ Typedefs
-

Definition at line 59 of file UsbCore.h.

+

Definition at line 61 of file UsbCore.h.

@@ -370,7 +371,7 @@ Typedefs
-

Definition at line 60 of file UsbCore.h.

+

Definition at line 62 of file UsbCore.h.

@@ -384,7 +385,7 @@ Typedefs
-

Definition at line 61 of file UsbCore.h.

+

Definition at line 63 of file UsbCore.h.

@@ -398,7 +399,7 @@ Typedefs
-

Definition at line 62 of file UsbCore.h.

+

Definition at line 64 of file UsbCore.h.

@@ -412,7 +413,7 @@ Typedefs
-

Definition at line 63 of file UsbCore.h.

+

Definition at line 65 of file UsbCore.h.

@@ -426,7 +427,7 @@ Typedefs
-

Definition at line 64 of file UsbCore.h.

+

Definition at line 66 of file UsbCore.h.

@@ -440,7 +441,7 @@ Typedefs
-

Definition at line 65 of file UsbCore.h.

+

Definition at line 67 of file UsbCore.h.

@@ -454,7 +455,7 @@ Typedefs
-

Definition at line 66 of file UsbCore.h.

+

Definition at line 68 of file UsbCore.h.

@@ -468,7 +469,7 @@ Typedefs
-

Definition at line 67 of file UsbCore.h.

+

Definition at line 69 of file UsbCore.h.

@@ -482,7 +483,7 @@ Typedefs
-

Definition at line 68 of file UsbCore.h.

+

Definition at line 70 of file UsbCore.h.

@@ -496,7 +497,7 @@ Typedefs
-

Definition at line 69 of file UsbCore.h.

+

Definition at line 71 of file UsbCore.h.

@@ -510,7 +511,7 @@ Typedefs
-

Definition at line 70 of file UsbCore.h.

+

Definition at line 72 of file UsbCore.h.

@@ -524,7 +525,7 @@ Typedefs
-

Definition at line 71 of file UsbCore.h.

+

Definition at line 73 of file UsbCore.h.

@@ -538,7 +539,7 @@ Typedefs
-

Definition at line 72 of file UsbCore.h.

+

Definition at line 74 of file UsbCore.h.

@@ -552,7 +553,7 @@ Typedefs
-

Definition at line 75 of file UsbCore.h.

+

Definition at line 77 of file UsbCore.h.

@@ -566,7 +567,7 @@ Typedefs
-

Definition at line 76 of file UsbCore.h.

+

Definition at line 78 of file UsbCore.h.

@@ -580,7 +581,7 @@ Typedefs
-

Definition at line 77 of file UsbCore.h.

+

Definition at line 79 of file UsbCore.h.

@@ -594,7 +595,7 @@ Typedefs
-

Definition at line 78 of file UsbCore.h.

+

Definition at line 80 of file UsbCore.h.

@@ -608,7 +609,7 @@ Typedefs
-

Definition at line 79 of file UsbCore.h.

+

Definition at line 81 of file UsbCore.h.

@@ -622,7 +623,7 @@ Typedefs
-

Definition at line 80 of file UsbCore.h.

+

Definition at line 82 of file UsbCore.h.

@@ -636,7 +637,7 @@ Typedefs
-

Definition at line 81 of file UsbCore.h.

+

Definition at line 83 of file UsbCore.h.

@@ -650,7 +651,7 @@ Typedefs
-

Definition at line 82 of file UsbCore.h.

+

Definition at line 84 of file UsbCore.h.

@@ -664,7 +665,7 @@ Typedefs
-

Definition at line 83 of file UsbCore.h.

+

Definition at line 85 of file UsbCore.h.

@@ -678,7 +679,7 @@ Typedefs
-

Definition at line 84 of file UsbCore.h.

+

Definition at line 86 of file UsbCore.h.

@@ -692,7 +693,7 @@ Typedefs
-

Definition at line 85 of file UsbCore.h.

+

Definition at line 87 of file UsbCore.h.

@@ -706,7 +707,7 @@ Typedefs
-

Definition at line 86 of file UsbCore.h.

+

Definition at line 88 of file UsbCore.h.

@@ -720,7 +721,7 @@ Typedefs
-

Definition at line 87 of file UsbCore.h.

+

Definition at line 89 of file UsbCore.h.

@@ -734,7 +735,7 @@ Typedefs
-

Definition at line 88 of file UsbCore.h.

+

Definition at line 90 of file UsbCore.h.

@@ -748,7 +749,7 @@ Typedefs
-

Definition at line 89 of file UsbCore.h.

+

Definition at line 91 of file UsbCore.h.

@@ -762,7 +763,7 @@ Typedefs
-

Definition at line 90 of file UsbCore.h.

+

Definition at line 92 of file UsbCore.h.

@@ -771,12 +772,12 @@ Typedefs
- +
#define USB_XFER_TIMEOUT   10000#define USB_XFER_TIMEOUT   5000
-

Definition at line 92 of file UsbCore.h.

+

Definition at line 94 of file UsbCore.h.

@@ -790,7 +791,7 @@ Typedefs
-

Definition at line 94 of file UsbCore.h.

+

Definition at line 96 of file UsbCore.h.

@@ -804,7 +805,7 @@ Typedefs
-

Definition at line 95 of file UsbCore.h.

+

Definition at line 97 of file UsbCore.h.

@@ -818,7 +819,7 @@ Typedefs
-

Definition at line 97 of file UsbCore.h.

+

Definition at line 99 of file UsbCore.h.

@@ -832,7 +833,7 @@ Typedefs
-

Definition at line 99 of file UsbCore.h.

+

Definition at line 101 of file UsbCore.h.

@@ -846,7 +847,7 @@ Typedefs
-

Definition at line 102 of file UsbCore.h.

+

Definition at line 104 of file UsbCore.h.

@@ -860,7 +861,7 @@ Typedefs
-

Definition at line 104 of file UsbCore.h.

+

Definition at line 106 of file UsbCore.h.

@@ -874,7 +875,7 @@ Typedefs
-

Definition at line 105 of file UsbCore.h.

+

Definition at line 107 of file UsbCore.h.

@@ -888,7 +889,7 @@ Typedefs
-

Definition at line 106 of file UsbCore.h.

+

Definition at line 108 of file UsbCore.h.

@@ -902,7 +903,7 @@ Typedefs
-

Definition at line 107 of file UsbCore.h.

+

Definition at line 109 of file UsbCore.h.

@@ -916,7 +917,7 @@ Typedefs
-

Definition at line 108 of file UsbCore.h.

+

Definition at line 110 of file UsbCore.h.

@@ -930,7 +931,7 @@ Typedefs
-

Definition at line 109 of file UsbCore.h.

+

Definition at line 111 of file UsbCore.h.

@@ -944,7 +945,7 @@ Typedefs
-

Definition at line 110 of file UsbCore.h.

+

Definition at line 112 of file UsbCore.h.

@@ -958,7 +959,7 @@ Typedefs
-

Definition at line 111 of file UsbCore.h.

+

Definition at line 113 of file UsbCore.h.

@@ -972,7 +973,7 @@ Typedefs
-

Definition at line 112 of file UsbCore.h.

+

Definition at line 114 of file UsbCore.h.

@@ -986,7 +987,7 @@ Typedefs
-

Definition at line 113 of file UsbCore.h.

+

Definition at line 115 of file UsbCore.h.

@@ -1000,7 +1001,7 @@ Typedefs
-

Definition at line 114 of file UsbCore.h.

+

Definition at line 116 of file UsbCore.h.

@@ -1014,7 +1015,7 @@ Typedefs
-

Definition at line 115 of file UsbCore.h.

+

Definition at line 117 of file UsbCore.h.

@@ -1028,7 +1029,7 @@ Typedefs
-

Definition at line 116 of file UsbCore.h.

+

Definition at line 118 of file UsbCore.h.

@@ -1042,7 +1043,7 @@ Typedefs
-

Definition at line 117 of file UsbCore.h.

+

Definition at line 119 of file UsbCore.h.

@@ -1057,7 +1058,7 @@ Typedefs
-

Definition at line 41 of file UsbCore.h.

+

Definition at line 43 of file UsbCore.h.

@@ -1078,7 +1079,7 @@ Typedefs diff --git a/_usb_core_8h_source.html b/_usb_core_8h_source.html index 5884a036..b9aed439 100644 --- a/_usb_core_8h_source.html +++ b/_usb_core_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: UsbCore.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -128,326 +129,334 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
37 typedef MAX3421e<P53, P54> MAX3421E; // Arduino Mega ADK
38 #elif defined(ARDUINO_AVR_BALANDUINO)
39 typedef MAX3421e<P20, P19> MAX3421E; // Balanduino
-
40 #else
-
41 typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560, Leonardo, Due etc.) or Teensy 2.0 and 3.0
-
42 #endif
-
43 
-
44 /* Common setup data constant combinations */
-
45 #define bmREQ_GET_DESCR USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE //get descriptor request type
-
46 #define bmREQ_SET USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE //set request type for all but 'set feature' and 'set interface'
-
47 #define bmREQ_CL_GET_INTF USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE //get interface request type
-
48 
-
49 // D7 data transfer direction (0 - host-to-device, 1 - device-to-host)
-
50 // D6-5 Type (0- standard, 1 - class, 2 - vendor, 3 - reserved)
-
51 // D4-0 Recipient (0 - device, 1 - interface, 2 - endpoint, 3 - other, 4..31 - reserved)
-
52 
-
53 // USB Device Classes
-
54 #define USB_CLASS_USE_CLASS_INFO 0x00 // Use Class Info in the Interface Descriptors
-
55 #define USB_CLASS_AUDIO 0x01 // Audio
-
56 #define USB_CLASS_COM_AND_CDC_CTRL 0x02 // Communications and CDC Control
-
57 #define USB_CLASS_HID 0x03 // HID
-
58 #define USB_CLASS_PHYSICAL 0x05 // Physical
-
59 #define USB_CLASS_IMAGE 0x06 // Image
-
60 #define USB_CLASS_PRINTER 0x07 // Printer
-
61 #define USB_CLASS_MASS_STORAGE 0x08 // Mass Storage
-
62 #define USB_CLASS_HUB 0x09 // Hub
-
63 #define USB_CLASS_CDC_DATA 0x0a // CDC-Data
-
64 #define USB_CLASS_SMART_CARD 0x0b // Smart-Card
-
65 #define USB_CLASS_CONTENT_SECURITY 0x0d // Content Security
-
66 #define USB_CLASS_VIDEO 0x0e // Video
-
67 #define USB_CLASS_PERSONAL_HEALTH 0x0f // Personal Healthcare
-
68 #define USB_CLASS_DIAGNOSTIC_DEVICE 0xdc // Diagnostic Device
-
69 #define USB_CLASS_WIRELESS_CTRL 0xe0 // Wireless Controller
-
70 #define USB_CLASS_MISC 0xef // Miscellaneous
-
71 #define USB_CLASS_APP_SPECIFIC 0xfe // Application Specific
-
72 #define USB_CLASS_VENDOR_SPECIFIC 0xff // Vendor Specific
-
73 
-
74 // Additional Error Codes
-
75 #define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED 0xD1
-
76 #define USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE 0xD2
-
77 #define USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS 0xD3
-
78 #define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL 0xD4
-
79 #define USB_ERROR_HUB_ADDRESS_OVERFLOW 0xD5
-
80 #define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL 0xD6
-
81 #define USB_ERROR_EPINFO_IS_NULL 0xD7
-
82 #define USB_ERROR_INVALID_ARGUMENT 0xD8
-
83 #define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE 0xD9
-
84 #define USB_ERROR_INVALID_MAX_PKT_SIZE 0xDA
-
85 #define USB_ERROR_EP_NOT_FOUND_IN_TBL 0xDB
-
86 #define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET 0xE0
-
87 #define USB_ERROR_FailGetDevDescr 0xE1
-
88 #define USB_ERROR_FailSetDevTblEntry 0xE2
-
89 #define USB_ERROR_FailGetConfDescr 0xE3
-
90 #define USB_ERROR_TRANSFER_TIMEOUT 0xFF
-
91 
-
92 #define USB_XFER_TIMEOUT 10000 //30000 // (5000) USB transfer timeout in milliseconds, per section 9.2.6.1 of USB 2.0 spec
-
93 //#define USB_NAK_LIMIT 32000 //NAK limit for a transfer. 0 means NAKs are not counted
-
94 #define USB_RETRY_LIMIT 3 // 3 retry limit for a transfer
-
95 #define USB_SETTLE_DELAY 200 //settle delay in milliseconds
-
96 
-
97 #define USB_NUMDEVICES 16 //number of USB devices
-
98 //#define HUB_MAX_HUBS 7 // maximum number of hubs that can be attached to the host controller
-
99 #define HUB_PORT_RESET_DELAY 20 // hub port reset delay 10 ms recomended, can be up to 20 ms
-
100 
-
101 /* USB state machine states */
-
102 #define USB_STATE_MASK 0xf0
-
103 
-
104 #define USB_STATE_DETACHED 0x10
-
105 #define USB_DETACHED_SUBSTATE_INITIALIZE 0x11
-
106 #define USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE 0x12
-
107 #define USB_DETACHED_SUBSTATE_ILLEGAL 0x13
-
108 #define USB_ATTACHED_SUBSTATE_SETTLE 0x20
-
109 #define USB_ATTACHED_SUBSTATE_RESET_DEVICE 0x30
-
110 #define USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE 0x40
-
111 #define USB_ATTACHED_SUBSTATE_WAIT_SOF 0x50
-
112 #define USB_ATTACHED_SUBSTATE_WAIT_RESET 0x51
-
113 #define USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE 0x60
-
114 #define USB_STATE_ADDRESSING 0x70
-
115 #define USB_STATE_CONFIGURING 0x80
-
116 #define USB_STATE_RUNNING 0x90
-
117 #define USB_STATE_ERROR 0xa0
-
118 
-
119 class USBDeviceConfig {
-
120 public:
-
121 
-
122  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed) {
-
123  return 0;
-
124  }
-
125 
-
126  virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed) {
-
127  return 0;
-
128  }
-
129 
-
130  virtual uint8_t Release() {
-
131  return 0;
-
132  }
-
133 
-
134  virtual uint8_t Poll() {
-
135  return 0;
-
136  }
-
137 
-
138  virtual uint8_t GetAddress() {
-
139  return 0;
-
140  }
-
141 
-
142  virtual void ResetHubPort(uint8_t port) {
-
143  return;
-
144  } // Note used for hubs only!
-
145 
-
146  virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
-
147  return false;
-
148  }
-
149 
-
150  virtual boolean DEVCLASSOK(uint8_t klass) {
-
151  return false;
-
152  }
-
153 };
-
154 
-
155 /* USB Setup Packet Structure */
-
156 typedef struct {
-
157 
-
158  union { // offset description
-
159  uint8_t bmRequestType; // 0 Bit-map of request type
-
160 
-
161  struct {
-
162  uint8_t recipient : 5; // Recipient of the request
-
163  uint8_t type : 2; // Type of request
-
164  uint8_t direction : 1; // Direction of data X-fer
-
165  } __attribute__((packed));
-
166  } ReqType_u;
-
167  uint8_t bRequest; // 1 Request
-
168 
-
169  union {
-
170  uint16_t wValue; // 2 Depends on bRequest
-
171 
-
172  struct {
-
173  uint8_t wValueLo;
-
174  uint8_t wValueHi;
-
175  } __attribute__((packed));
-
176  } wVal_u;
-
177  uint16_t wIndex; // 4 Depends on bRequest
-
178  uint16_t wLength; // 6 Depends on bRequest
-
179 } __attribute__((packed)) SETUP_PKT, *PSETUP_PKT;
-
180 
-
181 
-
182 
-
183 // Base class for incoming data parser
-
184 
-
185 class USBReadParser {
-
186 public:
-
187  virtual void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset) = 0;
-
188 };
+
40 #elif defined(__ARDUINO_X86__) && PLATFORM_ID == 0x06
+
41 typedef MAX3421e<P3, P2> MAX3421E; // The Intel Galileo supports much faster read and write speed at pin 2 and 3
+
42 #else
+
43 typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560, Leonardo, Due etc.), Intel Edison, Intel Galileo 2 or Teensy 2.0 and 3.0
+
44 #endif
+
45 
+
46 /* Common setup data constant combinations */
+
47 #define bmREQ_GET_DESCR USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE //get descriptor request type
+
48 #define bmREQ_SET USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE //set request type for all but 'set feature' and 'set interface'
+
49 #define bmREQ_CL_GET_INTF USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE //get interface request type
+
50 
+
51 // D7 data transfer direction (0 - host-to-device, 1 - device-to-host)
+
52 // D6-5 Type (0- standard, 1 - class, 2 - vendor, 3 - reserved)
+
53 // D4-0 Recipient (0 - device, 1 - interface, 2 - endpoint, 3 - other, 4..31 - reserved)
+
54 
+
55 // USB Device Classes
+
56 #define USB_CLASS_USE_CLASS_INFO 0x00 // Use Class Info in the Interface Descriptors
+
57 #define USB_CLASS_AUDIO 0x01 // Audio
+
58 #define USB_CLASS_COM_AND_CDC_CTRL 0x02 // Communications and CDC Control
+
59 #define USB_CLASS_HID 0x03 // HID
+
60 #define USB_CLASS_PHYSICAL 0x05 // Physical
+
61 #define USB_CLASS_IMAGE 0x06 // Image
+
62 #define USB_CLASS_PRINTER 0x07 // Printer
+
63 #define USB_CLASS_MASS_STORAGE 0x08 // Mass Storage
+
64 #define USB_CLASS_HUB 0x09 // Hub
+
65 #define USB_CLASS_CDC_DATA 0x0a // CDC-Data
+
66 #define USB_CLASS_SMART_CARD 0x0b // Smart-Card
+
67 #define USB_CLASS_CONTENT_SECURITY 0x0d // Content Security
+
68 #define USB_CLASS_VIDEO 0x0e // Video
+
69 #define USB_CLASS_PERSONAL_HEALTH 0x0f // Personal Healthcare
+
70 #define USB_CLASS_DIAGNOSTIC_DEVICE 0xdc // Diagnostic Device
+
71 #define USB_CLASS_WIRELESS_CTRL 0xe0 // Wireless Controller
+
72 #define USB_CLASS_MISC 0xef // Miscellaneous
+
73 #define USB_CLASS_APP_SPECIFIC 0xfe // Application Specific
+
74 #define USB_CLASS_VENDOR_SPECIFIC 0xff // Vendor Specific
+
75 
+
76 // Additional Error Codes
+
77 #define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED 0xD1
+
78 #define USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE 0xD2
+
79 #define USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS 0xD3
+
80 #define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL 0xD4
+
81 #define USB_ERROR_HUB_ADDRESS_OVERFLOW 0xD5
+
82 #define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL 0xD6
+
83 #define USB_ERROR_EPINFO_IS_NULL 0xD7
+
84 #define USB_ERROR_INVALID_ARGUMENT 0xD8
+
85 #define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE 0xD9
+
86 #define USB_ERROR_INVALID_MAX_PKT_SIZE 0xDA
+
87 #define USB_ERROR_EP_NOT_FOUND_IN_TBL 0xDB
+
88 #define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET 0xE0
+
89 #define USB_ERROR_FailGetDevDescr 0xE1
+
90 #define USB_ERROR_FailSetDevTblEntry 0xE2
+
91 #define USB_ERROR_FailGetConfDescr 0xE3
+
92 #define USB_ERROR_TRANSFER_TIMEOUT 0xFF
+
93 
+
94 #define USB_XFER_TIMEOUT 5000 // (5000) USB transfer timeout in milliseconds, per section 9.2.6.1 of USB 2.0 spec
+
95 //#define USB_NAK_LIMIT 32000 // NAK limit for a transfer. 0 means NAKs are not counted
+
96 #define USB_RETRY_LIMIT 3 // 3 retry limit for a transfer
+
97 #define USB_SETTLE_DELAY 200 // settle delay in milliseconds
+
98 
+
99 #define USB_NUMDEVICES 16 //number of USB devices
+
100 //#define HUB_MAX_HUBS 7 // maximum number of hubs that can be attached to the host controller
+
101 #define HUB_PORT_RESET_DELAY 20 // hub port reset delay 10 ms recomended, can be up to 20 ms
+
102 
+
103 /* USB state machine states */
+
104 #define USB_STATE_MASK 0xf0
+
105 
+
106 #define USB_STATE_DETACHED 0x10
+
107 #define USB_DETACHED_SUBSTATE_INITIALIZE 0x11
+
108 #define USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE 0x12
+
109 #define USB_DETACHED_SUBSTATE_ILLEGAL 0x13
+
110 #define USB_ATTACHED_SUBSTATE_SETTLE 0x20
+
111 #define USB_ATTACHED_SUBSTATE_RESET_DEVICE 0x30
+
112 #define USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE 0x40
+
113 #define USB_ATTACHED_SUBSTATE_WAIT_SOF 0x50
+
114 #define USB_ATTACHED_SUBSTATE_WAIT_RESET 0x51
+
115 #define USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE 0x60
+
116 #define USB_STATE_ADDRESSING 0x70
+
117 #define USB_STATE_CONFIGURING 0x80
+
118 #define USB_STATE_RUNNING 0x90
+
119 #define USB_STATE_ERROR 0xa0
+
120 
+
121 class USBDeviceConfig {
+
122 public:
+
123 
+
124  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed) {
+
125  return 0;
+
126  }
+
127 
+
128  virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed) {
+
129  return 0;
+
130  }
+
131 
+
132  virtual uint8_t Release() {
+
133  return 0;
+
134  }
+
135 
+
136  virtual uint8_t Poll() {
+
137  return 0;
+
138  }
+
139 
+
140  virtual uint8_t GetAddress() {
+
141  return 0;
+
142  }
+
143 
+
144  virtual void ResetHubPort(uint8_t port) {
+
145  return;
+
146  } // Note used for hubs only!
+
147 
+
148  virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
+
149  return false;
+
150  }
+
151 
+
152  virtual bool DEVCLASSOK(uint8_t klass) {
+
153  return false;
+
154  }
+
155 
+
156  virtual bool DEVSUBCLASSOK(uint8_t subklass) {
+
157  return true;
+
158  }
+
159 
+
160 };
+
161 
+
162 /* USB Setup Packet Structure */
+
163 typedef struct {
+
164 
+
165  union { // offset description
+
166  uint8_t bmRequestType; // 0 Bit-map of request type
+
167 
+
168  struct {
+
169  uint8_t recipient : 5; // Recipient of the request
+
170  uint8_t type : 2; // Type of request
+
171  uint8_t direction : 1; // Direction of data X-fer
+
172  } __attribute__((packed));
+
173  } ReqType_u;
+
174  uint8_t bRequest; // 1 Request
+
175 
+
176  union {
+
177  uint16_t wValue; // 2 Depends on bRequest
+
178 
+
179  struct {
+
180  uint8_t wValueLo;
+
181  uint8_t wValueHi;
+
182  } __attribute__((packed));
+
183  } wVal_u;
+
184  uint16_t wIndex; // 4 Depends on bRequest
+
185  uint16_t wLength; // 6 Depends on bRequest
+
186 } __attribute__((packed)) SETUP_PKT, *PSETUP_PKT;
+
187 
+
188 
189 
-
190 class USB : public MAX3421E {
-
191  AddressPoolImpl<USB_NUMDEVICES> addrPool;
-
192  USBDeviceConfig* devConfig[USB_NUMDEVICES];
-
193  uint8_t bmHubPre;
-
194 
-
195 public:
-
196  USB(void);
-
197 
-
198  void SetHubPreMask() {
-
199  bmHubPre |= bmHUBPRE;
-
200  };
+
190 // Base class for incoming data parser
+
191 
+
192 class USBReadParser {
+
193 public:
+
194  virtual void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset) = 0;
+
195 };
+
196 
+
197 class USB : public MAX3421E {
+
198  AddressPoolImpl<USB_NUMDEVICES> addrPool;
+
199  USBDeviceConfig* devConfig[USB_NUMDEVICES];
+
200  uint8_t bmHubPre;
201 
-
202  void ResetHubPreMask() {
-
203  bmHubPre &= (~bmHUBPRE);
-
204  };
-
205 
-
206  AddressPool& GetAddressPool() {
-
207  return (AddressPool&)addrPool;
-
208  };
-
209 
-
210  uint8_t RegisterDeviceClass(USBDeviceConfig *pdev) {
-
211  for(uint8_t i = 0; i < USB_NUMDEVICES; i++) {
-
212  if(!devConfig[i]) {
-
213  devConfig[i] = pdev;
-
214  return 0;
-
215  }
-
216  }
-
217  return USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS;
-
218  };
-
219 
-
220  void ForEachUsbDevice(UsbDeviceHandleFunc pfunc) {
-
221  addrPool.ForEachUsbDevice(pfunc);
-
222  };
-
223  uint8_t getUsbTaskState(void);
-
224  void setUsbTaskState(uint8_t state);
-
225 
-
226  EpInfo* getEpInfoEntry(uint8_t addr, uint8_t ep);
-
227  uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo* eprecord_ptr);
-
228 
-
229  /* Control requests */
-
230  uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr);
-
231  uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr);
+
202 public:
+
203  USB(void);
+
204 
+
205  void SetHubPreMask() {
+
206  bmHubPre |= bmHUBPRE;
+
207  };
+
208 
+
209  void ResetHubPreMask() {
+
210  bmHubPre &= (~bmHUBPRE);
+
211  };
+
212 
+
213  AddressPool& GetAddressPool() {
+
214  return (AddressPool&)addrPool;
+
215  };
+
216 
+
217  uint8_t RegisterDeviceClass(USBDeviceConfig *pdev) {
+
218  for(uint8_t i = 0; i < USB_NUMDEVICES; i++) {
+
219  if(!devConfig[i]) {
+
220  devConfig[i] = pdev;
+
221  return 0;
+
222  }
+
223  }
+
224  return USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS;
+
225  };
+
226 
+
227  void ForEachUsbDevice(UsbDeviceHandleFunc pfunc) {
+
228  addrPool.ForEachUsbDevice(pfunc);
+
229  };
+
230  uint8_t getUsbTaskState(void);
+
231  void setUsbTaskState(uint8_t state);
232 
-
233  uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser *p);
-
234 
-
235  uint8_t getStrDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t* dataptr);
-
236  uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr);
-
237  uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value);
-
238 
-
239  uint8_t ctrlData(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr, boolean direction);
-
240  uint8_t ctrlStatus(uint8_t ep, boolean direction, uint16_t nak_limit);
-
241  uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data);
-
242  uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data);
-
243  uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit);
-
244 
-
245  void Task(void);
-
246 
-
247  uint8_t DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed);
-
248  uint8_t Configuring(uint8_t parent, uint8_t port, bool lowspeed);
-
249  uint8_t ReleaseDevice(uint8_t addr);
-
250 
-
251  uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi,
-
252  uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t* dataptr, USBReadParser *p);
+
233  EpInfo* getEpInfoEntry(uint8_t addr, uint8_t ep);
+
234  uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo* eprecord_ptr);
+
235 
+
236  /* Control requests */
+
237  uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr);
+
238  uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr);
+
239 
+
240  uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser *p);
+
241 
+
242  uint8_t getStrDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t* dataptr);
+
243  uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr);
+
244  uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value);
+
245 
+
246  uint8_t ctrlData(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr, bool direction);
+
247  uint8_t ctrlStatus(uint8_t ep, bool direction, uint16_t nak_limit);
+
248  uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data);
+
249  uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data);
+
250  uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit);
+
251 
+
252  void Task(void);
253 
-
254 private:
-
255  void init();
-
256  uint8_t SetAddress(uint8_t addr, uint8_t ep, EpInfo **ppep, uint16_t &nak_limit);
-
257  uint8_t OutTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data);
-
258  uint8_t InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t *data);
-
259  uint8_t AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lowspeed);
-
260 };
-
261 
-
262 #if 0 //defined(USB_METHODS_INLINE)
-
263 //get device descriptor
-
264 
-
265 inline uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) {
-
266  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, dataptr));
-
267 }
-
268 //get configuration descriptor
-
269 
-
270 inline uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) {
-
271  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, dataptr));
-
272 }
-
273 //get string descriptor
-
274 
-
275 inline uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t nuint8_ts, uint8_t index, uint16_t langid, uint8_t* dataptr) {
-
276  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, nuint8_ts, dataptr));
-
277 }
-
278 //set address
-
279 
-
280 inline uint8_t USB::setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) {
-
281  return ( ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, NULL));
-
282 }
-
283 //set configuration
-
284 
-
285 inline uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) {
-
286  return ( ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, NULL));
-
287 }
-
288 
-
289 #endif // defined(USB_METHODS_INLINE)
-
290 
-
291 #endif /* USBCORE_H */
-
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:766
+
254  uint8_t DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed);
+
255  uint8_t Configuring(uint8_t parent, uint8_t port, bool lowspeed);
+
256  uint8_t ReleaseDevice(uint8_t addr);
+
257 
+
258  uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi,
+
259  uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t* dataptr, USBReadParser *p);
+
260 
+
261 private:
+
262  void init();
+
263  uint8_t SetAddress(uint8_t addr, uint8_t ep, EpInfo **ppep, uint16_t *nak_limit);
+
264  uint8_t OutTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data);
+
265  uint8_t InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t *data);
+
266  uint8_t AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lowspeed);
+
267 };
+
268 
+
269 #if 0 //defined(USB_METHODS_INLINE)
+
270 //get device descriptor
+
271 
+
272 inline uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) {
+
273  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, dataptr));
+
274 }
+
275 //get configuration descriptor
+
276 
+
277 inline uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) {
+
278  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, dataptr));
+
279 }
+
280 //get string descriptor
+
281 
+
282 inline uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t nuint8_ts, uint8_t index, uint16_t langid, uint8_t* dataptr) {
+
283  return ( ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, nuint8_ts, dataptr));
+
284 }
+
285 //set address
+
286 
+
287 inline uint8_t USB::setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) {
+
288  return ( ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, NULL));
+
289 }
+
290 //set configuration
+
291 
+
292 inline uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) {
+
293  return ( ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, NULL));
+
294 }
+
295 
+
296 #endif // defined(USB_METHODS_INLINE)
+
297 
+
298 #endif /* USBCORE_H */
+
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:769
Definition: address.h:83
-
uint16_t wValue
Definition: UsbCore.h:170
-
virtual uint8_t Poll()
Definition: UsbCore.h:134
-
#define bmHUBPRE
Definition: max3421e.h:170
-
virtual uint8_t GetAddress()
Definition: UsbCore.h:138
+
uint16_t wValue
Definition: UsbCore.h:177
+
virtual uint8_t Poll()
Definition: UsbCore.h:136
+
#define bmHUBPRE
Definition: max3421e.h:165
+
virtual uint8_t GetAddress()
Definition: UsbCore.h:140
EpInfo * getEpInfoEntry(uint8_t addr, uint8_t ep)
Definition: Usb.cpp:44
#define USB_DESCRIPTOR_STRING
Definition: usb_ch9.h:65
-
uint16_t wLength
Definition: UsbCore.h:178
-
Definition: usbhost.h:86
+
uint16_t wLength
Definition: UsbCore.h:185
+
Definition: usbhost.h:109
#define USB_REQUEST_GET_DESCRIPTOR
Definition: usb_ch9.h:37
#define USB_DESCRIPTOR_DEVICE
Definition: usb_ch9.h:63
-
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:805
-
#define USB_NUMDEVICES
Definition: UsbCore.h:97
-
Definition: UsbCore.h:119
+
uint8_t ctrlData(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr, bool direction)
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
+
#define USB_NUMDEVICES
Definition: UsbCore.h:99
+
Definition: UsbCore.h:121
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
-
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: UsbCore.h:126
-
uint8_t bmRequestType
Definition: UsbCore.h:159
+
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: UsbCore.h:128
+
uint8_t bmRequestType
Definition: UsbCore.h:166
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
Definition: Usb.cpp:126
#define USB_DESCRIPTOR_CONFIGURATION
Definition: usb_ch9.h:64
-
void ResetHubPreMask()
Definition: UsbCore.h:202
-
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:796
-
uint8_t ctrlStatus(uint8_t ep, boolean direction, uint16_t nak_limit)
+
void ResetHubPreMask()
Definition: UsbCore.h:209
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
USB(void)
Definition: Usb.cpp:25
-
void(* UsbDeviceHandleFunc)(UsbDevice *pdev)
Definition: address.h:90
-
uint16_t wIndex
Definition: UsbCore.h:177
-
void SetHubPreMask()
Definition: UsbCore.h:198
+
uint16_t wIndex
Definition: UsbCore.h:184
+
void SetHubPreMask()
Definition: UsbCore.h:205
Definition: address.h:32
void setUsbTaskState(uint8_t state)
Definition: Usb.cpp:40
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
Definition: Usb.cpp:292
-
#define bmREQ_GET_DESCR
Definition: UsbCore.h:45
-
virtual void ResetHubPort(uint8_t port)
Definition: UsbCore.h:142
-
#define USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS
Definition: UsbCore.h:77
-
uint8_t getStrDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t *dataptr)
Definition: Usb.cpp:791
+
#define bmREQ_GET_DESCR
Definition: UsbCore.h:47
+
virtual void ResetHubPort(uint8_t port)
Definition: UsbCore.h:144
+
#define USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS
Definition: UsbCore.h:79
+
uint8_t getStrDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t *dataptr)
Definition: Usb.cpp:794
#define USB_REQUEST_SET_ADDRESS
Definition: usb_ch9.h:36
-
MAX3421e< P10, P9 > MAX3421E
Definition: UsbCore.h:41
-
Definition: UsbCore.h:185
-
Definition: UsbCore.h:156
+
uint8_t ctrlStatus(uint8_t ep, bool direction, uint16_t nak_limit)
+
MAX3421e< P10, P9 > MAX3421E
Definition: UsbCore.h:43
+
Definition: UsbCore.h:192
+
Definition: UsbCore.h:163
uint8_t getUsbTaskState(void)
Definition: Usb.cpp:36
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
Definition: Usb.cpp:206
void Task(void)
Definition: Usb.cpp:424
+
virtual bool DEVSUBCLASSOK(uint8_t subklass)
Definition: UsbCore.h:156
-
virtual boolean DEVCLASSOK(uint8_t klass)
Definition: UsbCore.h:150
void ForEachUsbDevice(UsbDeviceHandleFunc pfunc)
Definition: address.h:191
-
uint8_t ctrlData(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr, boolean direction)
uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit)
Definition: Usb.cpp:376
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: UsbCore.h:122
-
AddressPool & GetAddressPool()
Definition: UsbCore.h:206
+
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: UsbCore.h:124
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: UsbCore.h:148
uint8_t Configuring(uint8_t parent, uint8_t port, bool lowspeed)
Definition: Usb.cpp:652
-
Definition: UsbCore.h:190
-
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: UsbCore.h:146
-
uint8_t bRequest
Definition: UsbCore.h:167
-
virtual uint8_t Release()
Definition: UsbCore.h:130
-
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:210
-
#define bmREQ_SET
Definition: UsbCore.h:46
-
void ForEachUsbDevice(UsbDeviceHandleFunc pfunc)
Definition: UsbCore.h:220
+
Definition: UsbCore.h:197
+
uint8_t bRequest
Definition: UsbCore.h:174
+
virtual uint8_t Release()
Definition: UsbCore.h:132
+
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:217
+
#define bmREQ_SET
Definition: UsbCore.h:48
+
virtual bool DEVCLASSOK(uint8_t klass)
Definition: UsbCore.h:152
+
void ForEachUsbDevice(UsbDeviceHandleFunc pfunc)
Definition: UsbCore.h:227
#define USB_REQUEST_SET_CONFIGURATION
Definition: usb_ch9.h:40
-
uint8_t wValueHi
Definition: UsbCore.h:174
+
uint8_t wValueHi
Definition: UsbCore.h:181
uint8_t DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed)
Definition: Usb.cpp:530
-
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:761
-
uint8_t wValueLo
Definition: UsbCore.h:173
-
uint8_t ReleaseDevice(uint8_t addr)
Definition: Usb.cpp:746
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
+
uint8_t wValueLo
Definition: UsbCore.h:180
+
void(* UsbDeviceHandleFunc)(UsbDevice *pdev)
Definition: address.h:90
+
uint8_t ReleaseDevice(uint8_t addr)
Definition: Usb.cpp:749
diff --git a/_wii_8cpp.html b/_wii_8cpp.html index 87a2d32e..c3291877 100644 --- a/_wii_8cpp.html +++ b/_wii_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Wii.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -97,7 +98,7 @@ Include dependency graph for Wii.cpp:
- +

Go to the source code of this file.

@@ -217,7 +218,7 @@ Variables diff --git a/_wii_8cpp__incl.map b/_wii_8cpp__incl.map index 204251c8..6a229cb9 100644 --- a/_wii_8cpp__incl.map +++ b/_wii_8cpp__incl.map @@ -1,6 +1,8 @@ - - + + + + diff --git a/_wii_8cpp__incl.md5 b/_wii_8cpp__incl.md5 index 7b0c4e29..6f89a0be 100644 --- a/_wii_8cpp__incl.md5 +++ b/_wii_8cpp__incl.md5 @@ -1 +1 @@ -ea76bb891427717ec3bb9ab7b2d76881 \ No newline at end of file +083313d0770479906a6dbdca88768783 \ No newline at end of file diff --git a/_wii_8cpp__incl.png b/_wii_8cpp__incl.png index 96035bdf..ecd96f34 100644 Binary files a/_wii_8cpp__incl.png and b/_wii_8cpp__incl.png differ diff --git a/_wii_8cpp_source.html b/_wii_8cpp_source.html index 1f13ded8..0df4510b 100644 --- a/_wii_8cpp_source.html +++ b/_wii_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Wii.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -174,1252 +175,1258 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
83 };
84 
85 WII::WII(BTD *p, bool pair) :
-
86 pBtd(p) // pointer to USB class instance - mandatory
+
86 BluetoothService(p) // Pointer to USB class instance - mandatory
87 {
-
88  if(pBtd)
-
89  pBtd->registerServiceClass(this); // Register it as a Bluetooth service
-
90 
-
91  pBtd->pairWithWii = pair;
-
92 
-
93  HIDBuffer[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
-
94 
-
95  /* Set device cid for the control and intterrupt channelse - LSB */
-
96  control_dcid[0] = 0x60; //0x0060
-
97  control_dcid[1] = 0x00;
-
98  interrupt_dcid[0] = 0x61; //0x0061
-
99  interrupt_dcid[1] = 0x00;
+
88  pBtd->pairWithWii = pair;
+
89 
+
90  HIDBuffer[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
+
91 
+
92  /* Set device cid for the control and intterrupt channelse - LSB */
+
93  control_dcid[0] = 0x60; // 0x0060
+
94  control_dcid[1] = 0x00;
+
95  interrupt_dcid[0] = 0x61; // 0x0061
+
96  interrupt_dcid[1] = 0x00;
+
97 
+
98  Reset();
+
99 }
100 
-
101  Reset();
-
102 }
-
103 
-
104 void WII::Reset() {
-
105  wiimoteConnected = false;
-
106  nunchuckConnected = false;
-
107  motionPlusConnected = false;
-
108  activateNunchuck = false;
-
109  motionValuesReset = false;
-
110  activeConnection = false;
-
111  motionPlusInside = false;
-
112  pBtd->wiiUProController = false;
-
113  wiiUProControllerConnected = false;
-
114  l2cap_event_flag = 0; // Reset flags
-
115  l2cap_state = L2CAP_WAIT;
-
116 }
-
117 
-
118 void WII::disconnect() { // Use this void to disconnect any of the controllers
-
119  if(!motionPlusInside) { // The old Wiimote needs a delay after the first command or it will automatically reconnect
-
120  if(motionPlusConnected) {
-
121 #ifdef DEBUG_USB_HOST
-
122  Notify(PSTR("\r\nDeactivating Motion Plus"), 0x80);
-
123 #endif
-
124  initExtension1(); // This will disable the Motion Plus extension
-
125  }
-
126  timer = millis() + 1000; // We have to wait for the message before the rest of the channels can be deactivated
-
127  } else
-
128  timer = millis(); // Don't wait
-
129  // First the HID interrupt channel has to be disconnected, then the HID control channel and finally the HCI connection
-
130  pBtd->l2cap_disconnection_request(hci_handle, ++identifier, interrupt_scid, interrupt_dcid);
-
131  Reset();
-
132  l2cap_state = L2CAP_INTERRUPT_DISCONNECT;
-
133 }
-
134 
-
135 void WII::ACLData(uint8_t* l2capinbuf) {
-
136  if(!pBtd->l2capConnectionClaimed && pBtd->incomingWii && !wiimoteConnected && !activeConnection) {
-
137  if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
-
138  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_CTRL_PSM) {
-
139  motionPlusInside = pBtd->motionPlusInside;
-
140  pBtd->incomingWii = false;
-
141  pBtd->l2capConnectionClaimed = true; // Claim that the incoming connection belongs to this service
-
142  activeConnection = true;
-
143  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
-
144  l2cap_state = L2CAP_WAIT;
-
145  }
-
146  }
-
147  }
-
148  //if((l2capinbuf[0] | (uint16_t)l2capinbuf[1] << 8) == (hci_handle | 0x2000U)) { // acl_handle_ok or it's a new connection
-
149  if(UHS_ACL_HANDLE_OK(l2capinbuf, hci_handle)) { // acl_handle_ok or it's a new connection
-
150  if((l2capinbuf[6] | (l2capinbuf[7] << 8)) == 0x0001U) { //l2cap_control - Channel ID for ACL-U
-
151  if(l2capinbuf[8] == L2CAP_CMD_COMMAND_REJECT) {
-
152 #ifdef DEBUG_USB_HOST
-
153  Notify(PSTR("\r\nL2CAP Command Rejected - Reason: "), 0x80);
-
154  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
-
155  Notify(PSTR(" "), 0x80);
-
156  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
-
157  Notify(PSTR(" "), 0x80);
-
158  D_PrintHex<uint8_t > (l2capinbuf[17], 0x80);
-
159  Notify(PSTR(" "), 0x80);
-
160  D_PrintHex<uint8_t > (l2capinbuf[16], 0x80);
-
161  Notify(PSTR(" "), 0x80);
-
162  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
-
163  Notify(PSTR(" "), 0x80);
-
164  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
-
165 #endif
-
166  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_RESPONSE) {
-
167  if(((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) && ((l2capinbuf[18] | (l2capinbuf[19] << 8)) == SUCCESSFUL)) { // Success
-
168  if(l2capinbuf[14] == control_dcid[0] && l2capinbuf[15] == control_dcid[1]) {
-
169  //Notify(PSTR("\r\nHID Control Connection Complete"), 0x80);
-
170  identifier = l2capinbuf[9];
-
171  control_scid[0] = l2capinbuf[12];
-
172  control_scid[1] = l2capinbuf[13];
-
173  l2cap_set_flag(L2CAP_FLAG_CONTROL_CONNECTED);
-
174  } else if(l2capinbuf[14] == interrupt_dcid[0] && l2capinbuf[15] == interrupt_dcid[1]) {
-
175  //Notify(PSTR("\r\nHID Interrupt Connection Complete"), 0x80);
-
176  identifier = l2capinbuf[9];
-
177  interrupt_scid[0] = l2capinbuf[12];
-
178  interrupt_scid[1] = l2capinbuf[13];
-
179  l2cap_set_flag(L2CAP_FLAG_INTERRUPT_CONNECTED);
-
180  }
-
181  }
-
182  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
-
183 #ifdef EXTRADEBUG
-
184  Notify(PSTR("\r\nL2CAP Connection Request - PSM: "), 0x80);
-
185  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
-
186  Notify(PSTR(" "), 0x80);
-
187  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
-
188  Notify(PSTR(" SCID: "), 0x80);
-
189  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
-
190  Notify(PSTR(" "), 0x80);
-
191  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
-
192  Notify(PSTR(" Identifier: "), 0x80);
-
193  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
-
194 #endif
-
195  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_CTRL_PSM) {
-
196  identifier = l2capinbuf[9];
-
197  control_scid[0] = l2capinbuf[14];
-
198  control_scid[1] = l2capinbuf[15];
-
199  l2cap_set_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST);
-
200  } else if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_INTR_PSM) {
-
201  identifier = l2capinbuf[9];
-
202  interrupt_scid[0] = l2capinbuf[14];
-
203  interrupt_scid[1] = l2capinbuf[15];
-
204  l2cap_set_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST);
-
205  }
-
206  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_RESPONSE) {
-
207  if((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) { // Success
-
208  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
-
209  //Notify(PSTR("\r\nHID Control Configuration Complete"), 0x80);
-
210  identifier = l2capinbuf[9];
-
211  l2cap_set_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS);
-
212  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
-
213  //Notify(PSTR("\r\nHID Interrupt Configuration Complete"), 0x80);
-
214  identifier = l2capinbuf[9];
-
215  l2cap_set_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS);
-
216  }
-
217  }
-
218  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_REQUEST) {
-
219  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
-
220  //Notify(PSTR("\r\nHID Control Configuration Request"), 0x80);
-
221  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], control_scid);
-
222  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
-
223  //Notify(PSTR("\r\nHID Interrupt Configuration Request"), 0x80);
-
224  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], interrupt_scid);
-
225  }
-
226  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_REQUEST) {
-
227  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
-
228 #ifdef DEBUG_USB_HOST
-
229  Notify(PSTR("\r\nDisconnect Request: Control Channel"), 0x80);
-
230 #endif
-
231  identifier = l2capinbuf[9];
-
232  pBtd->l2cap_disconnection_response(hci_handle, identifier, control_dcid, control_scid);
-
233  Reset();
-
234  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
-
235 #ifdef DEBUG_USB_HOST
-
236  Notify(PSTR("\r\nDisconnect Request: Interrupt Channel"), 0x80);
-
237 #endif
-
238  identifier = l2capinbuf[9];
-
239  pBtd->l2cap_disconnection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid);
-
240  Reset();
-
241  }
-
242  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_RESPONSE) {
-
243  if(l2capinbuf[12] == control_scid[0] && l2capinbuf[13] == control_scid[1]) {
-
244  //Notify(PSTR("\r\nDisconnect Response: Control Channel"), 0x80);
-
245  identifier = l2capinbuf[9];
-
246  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE);
-
247  } else if(l2capinbuf[12] == interrupt_scid[0] && l2capinbuf[13] == interrupt_scid[1]) {
-
248  //Notify(PSTR("\r\nDisconnect Response: Interrupt Channel"), 0x80);
-
249  identifier = l2capinbuf[9];
-
250  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE);
-
251  }
-
252  }
-
253 #ifdef EXTRADEBUG
-
254  else {
-
255  identifier = l2capinbuf[9];
-
256  Notify(PSTR("\r\nL2CAP Unknown Signaling Command: "), 0x80);
-
257  D_PrintHex<uint8_t > (l2capinbuf[8], 0x80);
-
258  }
-
259 #endif
-
260  } else if(l2capinbuf[6] == interrupt_dcid[0] && l2capinbuf[7] == interrupt_dcid[1]) { // l2cap_interrupt
-
261  //Notify(PSTR("\r\nL2CAP Interrupt"), 0x80);
-
262  if(l2capinbuf[8] == 0xA1) { // HID_THDR_DATA_INPUT
-
263  if((l2capinbuf[9] >= 0x20 && l2capinbuf[9] <= 0x22) || (l2capinbuf[9] >= 0x30 && l2capinbuf[9] <= 0x37) || l2capinbuf[9] == 0x3e || l2capinbuf[9] == 0x3f) { // These reports include the buttons
-
264  if((l2capinbuf[9] >= 0x20 && l2capinbuf[9] <= 0x22) || l2capinbuf[9] == 0x31 || l2capinbuf[9] == 0x33) // These reports have no extensions bytes
-
265  ButtonState = (uint32_t)((l2capinbuf[10] & 0x1F) | ((uint16_t)(l2capinbuf[11] & 0x9F) << 8));
-
266  else if(wiiUProControllerConnected)
-
267  ButtonState = (uint32_t)(((~l2capinbuf[23]) & 0xFE) | ((uint16_t)(~l2capinbuf[24]) << 8) | ((uint32_t)((~l2capinbuf[25]) & 0x03) << 16));
-
268  else if(motionPlusConnected) {
-
269  if(l2capinbuf[20] & 0x02) // Only update the wiimote buttons, since the extension bytes are from the Motion Plus
-
270  ButtonState = (uint32_t)((l2capinbuf[10] & 0x1F) | ((uint16_t)(l2capinbuf[11] & 0x9F) << 8) | ((uint32_t)(ButtonState & 0xFFFF0000)));
-
271  else if(nunchuckConnected) // Update if it's a report from the Nunchuck
-
272  ButtonState = (uint32_t)((l2capinbuf[10] & 0x1F) | ((uint16_t)(l2capinbuf[11] & 0x9F) << 8) | ((uint32_t)((~l2capinbuf[20]) & 0x0C) << 14));
-
273  //else if(classicControllerConnected) // Update if it's a report from the Classic Controller
-
274  } else if(nunchuckConnected) // The Nunchuck is directly connected
-
275  ButtonState = (uint32_t)((l2capinbuf[10] & 0x1F) | ((uint16_t)(l2capinbuf[11] & 0x9F) << 8) | ((uint32_t)((~l2capinbuf[20]) & 0x03) << 16));
-
276  //else if(classicControllerConnected) // The Classic Controller is directly connected
-
277  else if(!unknownExtensionConnected)
-
278  ButtonState = (uint32_t)((l2capinbuf[10] & 0x1F) | ((uint16_t)(l2capinbuf[11] & 0x9F) << 8));
-
279 #ifdef PRINTREPORT
-
280  Notify(PSTR("ButtonState: "), 0x80);
-
281  D_PrintHex<uint32_t > (ButtonState, 0x80);
-
282  Notify(PSTR("\r\n"), 0x80);
-
283 #endif
-
284  if(ButtonState != OldButtonState) {
-
285  ButtonClickState = ButtonState & ~OldButtonState; // Update click state variable
-
286  OldButtonState = ButtonState;
-
287  }
-
288  }
-
289  if(l2capinbuf[9] == 0x31 || l2capinbuf[9] == 0x33 || l2capinbuf[9] == 0x35 || l2capinbuf[9] == 0x37) { // Read the accelerometer
-
290  accXwiimote = ((l2capinbuf[12] << 2) | (l2capinbuf[10] & 0x60 >> 5)) - 500;
-
291  accYwiimote = ((l2capinbuf[13] << 2) | (l2capinbuf[11] & 0x20 >> 4)) - 500;
-
292  accZwiimote = ((l2capinbuf[14] << 2) | (l2capinbuf[11] & 0x40 >> 5)) - 500;
-
293  }
-
294  switch(l2capinbuf[9]) {
-
295  case 0x20: // Status Information - (a1) 20 BB BB LF 00 00 VV
-
296 #ifdef EXTRADEBUG
-
297  Notify(PSTR("\r\nStatus report was received"), 0x80);
-
298 #endif
-
299  wiiState = l2capinbuf[12]; // (0x01: Battery is nearly empty), (0x02: An Extension Controller is connected), (0x04: Speaker enabled), (0x08: IR enabled), (0x10: LED1, 0x20: LED2, 0x40: LED3, 0x80: LED4)
-
300  batteryLevel = l2capinbuf[15]; // Update battery level
-
301 #ifdef DEBUG_USB_HOST
-
302  if(l2capinbuf[12] & 0x01)
-
303  Notify(PSTR("\r\nWARNING: Battery is nearly empty"), 0x80);
-
304 #endif
-
305  if(checkExtension) { // If this is false it means that the user must have called getBatteryLevel()
-
306  if(l2capinbuf[12] & 0x02) { // Check if a extension is connected
-
307 #ifdef DEBUG_USB_HOST
-
308  if(!unknownExtensionConnected)
-
309  Notify(PSTR("\r\nExtension connected"), 0x80);
-
310 #endif
-
311  unknownExtensionConnected = true;
-
312 #ifdef WIICAMERA
-
313  if(!isIRCameraEnabled()) // Don't activate the Motion Plus if we are trying to initialize the IR camera
-
314 #endif
-
315  setReportMode(false, 0x35); // Also read the extension
-
316  } else {
-
317 #ifdef DEBUG_USB_HOST
-
318  Notify(PSTR("\r\nExtension disconnected"), 0x80);
-
319 #endif
-
320  if(motionPlusConnected) {
-
321 #ifdef DEBUG_USB_HOST
-
322  Notify(PSTR(" - from Motion Plus"), 0x80);
-
323 #endif
-
324  wii_clear_flag(WII_FLAG_NUNCHUCK_CONNECTED);
-
325  if(!activateNunchuck) // If it's already trying to initialize the Nunchuck don't set it to false
-
326  nunchuckConnected = false;
-
327  //else if(classicControllerConnected)
-
328  } else if(nunchuckConnected) {
-
329 #ifdef DEBUG_USB_HOST
-
330  Notify(PSTR(" - Nunchuck"), 0x80);
-
331 #endif
-
332  nunchuckConnected = false; // It must be the Nunchuck controller then
-
333  wii_clear_flag(WII_FLAG_NUNCHUCK_CONNECTED);
-
334  onInit();
-
335  setReportMode(false, 0x31); // If there is no extension connected we will read the buttons and accelerometer
-
336  } else
-
337  setReportMode(false, 0x31); // If there is no extension connected we will read the buttons and accelerometer
-
338  }
-
339  } else
-
340  checkExtension = true; // Check for extensions by default
-
341  break;
-
342  case 0x21: // Read Memory Data
-
343  if((l2capinbuf[12] & 0x0F) == 0) { // No error
-
344  // See: http://wiibrew.org/wiki/Wiimote/Extension_Controllers
-
345  if(l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA4 && l2capinbuf[18] == 0x20 && l2capinbuf[19] == 0x00 && l2capinbuf[20] == 0x00) {
-
346 #ifdef DEBUG_USB_HOST
-
347  Notify(PSTR("\r\nNunchuck connected"), 0x80);
-
348 #endif
-
349  wii_set_flag(WII_FLAG_NUNCHUCK_CONNECTED);
-
350  } else if(l2capinbuf[16] == 0x00 && (l2capinbuf[17] == 0xA6 || l2capinbuf[17] == 0xA4) && l2capinbuf[18] == 0x20 && l2capinbuf[19] == 0x00 && l2capinbuf[20] == 0x05) {
-
351 #ifdef DEBUG_USB_HOST
-
352  Notify(PSTR("\r\nMotion Plus connected"), 0x80);
-
353 #endif
-
354  wii_set_flag(WII_FLAG_MOTION_PLUS_CONNECTED);
-
355  } else if(l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA4 && l2capinbuf[18] == 0x20 && l2capinbuf[19] == 0x04 && l2capinbuf[20] == 0x05) {
-
356 #ifdef DEBUG_USB_HOST
-
357  Notify(PSTR("\r\nMotion Plus activated in normal mode"), 0x80);
-
358 #endif
-
359  motionPlusConnected = true;
-
360 #ifdef WIICAMERA
-
361  if(!isIRCameraEnabled()) // Don't activate the Motion Plus if we are trying to initialize the IR camera
-
362 #endif
-
363  setReportMode(false, 0x35); // Also read the extension
-
364  } else if(l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA4 && l2capinbuf[18] == 0x20 && l2capinbuf[19] == 0x05 && l2capinbuf[20] == 0x05) {
-
365 #ifdef DEBUG_USB_HOST
-
366  Notify(PSTR("\r\nMotion Plus activated in Nunchuck pass-through mode"), 0x80);
-
367 #endif
-
368  activateNunchuck = false;
-
369  motionPlusConnected = true;
-
370  nunchuckConnected = true;
-
371 #ifdef WIICAMERA
-
372  if(!isIRCameraEnabled()) // Don't activate the Motion Plus if we are trying to initialize the IR camera
-
373 #endif
-
374  setReportMode(false, 0x35); // Also read the extension
-
375  } else if(l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA6 && l2capinbuf[18] == 0x20 && (l2capinbuf[19] == 0x00 || l2capinbuf[19] == 0x04 || l2capinbuf[19] == 0x05 || l2capinbuf[19] == 0x07) && l2capinbuf[20] == 0x05) {
-
376 #ifdef DEBUG_USB_HOST
-
377  Notify(PSTR("\r\nInactive Wii Motion Plus"), 0x80);
-
378  Notify(PSTR("\r\nPlease unplug the Motion Plus, disconnect the Wiimote and then replug the Motion Plus Extension"), 0x80);
-
379 #endif
-
380  stateCounter = 300; // Skip the rest in "WII_CHECK_MOTION_PLUS_STATE"
-
381  } else if(l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA4 && l2capinbuf[18] == 0x20 && l2capinbuf[19] == 0x01 && l2capinbuf[20] == 0x20) {
-
382 #ifdef DEBUG_USB_HOST
-
383  Notify(PSTR("\r\nWii U Pro Controller connected"), 0x80);
-
384 #endif
-
385  wiiUProControllerConnected = true;
-
386  }
-
387 #ifdef DEBUG_USB_HOST
-
388  else {
-
389  Notify(PSTR("\r\nUnknown Device: "), 0x80);
-
390  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
-
391  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
-
392  Notify(PSTR("\r\nData: "), 0x80);
-
393  for(uint8_t i = 0; i < ((l2capinbuf[12] >> 4) + 1); i++) { // bit 4-7 is the length-1
-
394  D_PrintHex<uint8_t > (l2capinbuf[15 + i], 0x80);
-
395  Notify(PSTR(" "), 0x80);
-
396  }
-
397  }
-
398 #endif
-
399  }
-
400 #ifdef EXTRADEBUG
-
401  else {
-
402  Notify(PSTR("\r\nReport Error: "), 0x80);
-
403  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
-
404  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
-
405  }
-
406 #endif
-
407  break;
-
408  case 0x22: // Acknowledge output report, return function result
-
409 #ifdef DEBUG_USB_HOST
-
410  if(l2capinbuf[13] != 0x00) { // Check if there is an error
-
411  Notify(PSTR("\r\nCommand failed: "), 0x80);
-
412  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
-
413  }
-
414 #endif
-
415  break;
-
416  case 0x30: // Core buttons - (a1) 30 BB BB
-
417  break;
-
418  case 0x31: // Core Buttons and Accelerometer - (a1) 31 BB BB AA AA AA
-
419  break;
-
420  case 0x32: // Core Buttons with 8 Extension bytes - (a1) 32 BB BB EE EE EE EE EE EE EE EE
-
421  break;
-
422  case 0x33: // Core Buttons with Accelerometer and 12 IR bytes - (a1) 33 BB BB AA AA AA II II II II II II II II II II II II
-
423 #ifdef WIICAMERA
-
424  // Read the IR data
-
425  IR_object_x1 = (l2capinbuf[15] | ((uint16_t)(l2capinbuf[17] & 0x30) << 4)); // x position
-
426  IR_object_y1 = (l2capinbuf[16] | ((uint16_t)(l2capinbuf[17] & 0xC0) << 2)); // y position
-
427  IR_object_s1 = (l2capinbuf[17] & 0x0F); // size value, 0-15
-
428 
-
429  IR_object_x2 = (l2capinbuf[18] | ((uint16_t)(l2capinbuf[20] & 0x30) << 4));
-
430  IR_object_y2 = (l2capinbuf[19] | ((uint16_t)(l2capinbuf[20] & 0xC0) << 2));
-
431  IR_object_s2 = (l2capinbuf[20] & 0x0F);
-
432 
-
433  IR_object_x3 = (l2capinbuf[21] | ((uint16_t)(l2capinbuf[23] & 0x30) << 4));
-
434  IR_object_y3 = (l2capinbuf[22] | ((uint16_t)(l2capinbuf[23] & 0xC0) << 2));
-
435  IR_object_s3 = (l2capinbuf[23] & 0x0F);
-
436 
-
437  IR_object_x4 = (l2capinbuf[24] | ((uint16_t)(l2capinbuf[26] & 0x30) << 4));
-
438  IR_object_y4 = (l2capinbuf[25] | ((uint16_t)(l2capinbuf[26] & 0xC0) << 2));
-
439  IR_object_s4 = (l2capinbuf[26] & 0x0F);
-
440 #endif
-
441  break;
-
442  case 0x34: // Core Buttons with 19 Extension bytes - (a1) 34 BB BB EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE
-
443  break;
-
444  /* 0x3e and 0x3f both give unknown report types when report mode is 0x3e or 0x3f with mode number 0x05 */
-
445  case 0x3E: // Core Buttons with Accelerometer and 32 IR bytes
-
446  // (a1) 31 BB BB AA AA AA II II II II II II II II II II II II II II II II II II II II II II II II II II II II II II II II
-
447  // corresponds to output report mode 0x3e
-
448 
-
449  /**** for reading in full mode: DOES NOT WORK YET ****/
-
450  /* When it works it will also have intensity and bounding box data */
-
451  /*
-
452  IR_object_x1 = (l2capinbuf[13] | ((uint16_t)(l2capinbuf[15] & 0x30) << 4));
-
453  IR_object_y1 = (l2capinbuf[14] | ((uint16_t)(l2capinbuf[15] & 0xC0) << 2));
-
454  IR_object_s1 = (l2capinbuf[15] & 0x0F);
-
455  */
-
456  break;
-
457  case 0x3F:
-
458  /*
-
459  IR_object_x1 = (l2capinbuf[13] | ((uint16_t)(l2capinbuf[15] & 0x30) << 4));
-
460  IR_object_y1 = (l2capinbuf[14] | ((uint16_t)(l2capinbuf[15] & 0xC0) << 2));
-
461  IR_object_s1 = (l2capinbuf[15] & 0x0F);
-
462  */
-
463  break;
-
464  case 0x35: // Core Buttons and Accelerometer with 16 Extension Bytes
-
465  // (a1) 35 BB BB AA AA AA EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE
-
466  if(motionPlusConnected) {
-
467  if(l2capinbuf[20] & 0x02) { // Check if it's a report from the Motion controller or the extension
-
468  if(motionValuesReset) { // We will only use the values when the gyro value has been set
-
469  gyroYawRaw = ((l2capinbuf[15] | ((l2capinbuf[18] & 0xFC) << 6)) - gyroYawZero);
-
470  gyroRollRaw = ((l2capinbuf[16] | ((l2capinbuf[19] & 0xFC) << 6)) - gyroRollZero);
-
471  gyroPitchRaw = ((l2capinbuf[17] | ((l2capinbuf[20] & 0xFC) << 6)) - gyroPitchZero);
-
472 
-
473  yawGyroSpeed = (double)gyroYawRaw / ((double)gyroYawZero / yawGyroScale);
-
474  rollGyroSpeed = -(double)gyroRollRaw / ((double)gyroRollZero / rollGyroScale); // We invert these values so they will fit the acc values
-
475  pitchGyroSpeed = (double)gyroPitchRaw / ((double)gyroPitchZero / pitchGyroScale);
-
476 
-
477  /* The onboard gyro has two ranges for slow and fast mode */
-
478  if(!(l2capinbuf[18] & 0x02)) // Check if fast mode is used
-
479  yawGyroSpeed *= 4.545;
-
480  if(!(l2capinbuf[18] & 0x01)) // Check if fast mode is used
-
481  pitchGyroSpeed *= 4.545;
-
482  if(!(l2capinbuf[19] & 0x02)) // Check if fast mode is used
-
483  rollGyroSpeed *= 4.545;
+
101 void WII::Reset() {
+
102  wiimoteConnected = false;
+
103  nunchuckConnected = false;
+
104  motionPlusConnected = false;
+
105  activateNunchuck = false;
+
106  motionValuesReset = false;
+
107  activeConnection = false;
+
108  motionPlusInside = false;
+
109  pBtd->wiiUProController = false;
+
110  wiiUProControllerConnected = false;
+
111  l2cap_event_flag = 0; // Reset flags
+
112  l2cap_state = L2CAP_WAIT;
+
113 }
+
114 
+
115 void WII::disconnect() { // Use this void to disconnect any of the controllers
+
116  if(!motionPlusInside) { // The old Wiimote needs a delay after the first command or it will automatically reconnect
+
117  if(motionPlusConnected) {
+
118 #ifdef DEBUG_USB_HOST
+
119  Notify(PSTR("\r\nDeactivating Motion Plus"), 0x80);
+
120 #endif
+
121  initExtension1(); // This will disable the Motion Plus extension
+
122  }
+
123  timer = millis() + 1000; // We have to wait for the message before the rest of the channels can be deactivated
+
124  } else
+
125  timer = millis(); // Don't wait
+
126  // First the HID interrupt channel has to be disconnected, then the HID control channel and finally the HCI connection
+
127  pBtd->l2cap_disconnection_request(hci_handle, ++identifier, interrupt_scid, interrupt_dcid);
+
128  Reset();
+
129  l2cap_state = L2CAP_INTERRUPT_DISCONNECT;
+
130 }
+
131 
+
132 void WII::ACLData(uint8_t* l2capinbuf) {
+
133  if(!pBtd->l2capConnectionClaimed && pBtd->incomingWii && !wiimoteConnected && !activeConnection) {
+
134  if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
+
135  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_CTRL_PSM) {
+
136  motionPlusInside = pBtd->motionPlusInside;
+
137  pBtd->incomingWii = false;
+
138  pBtd->l2capConnectionClaimed = true; // Claim that the incoming connection belongs to this service
+
139  activeConnection = true;
+
140  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
+
141  l2cap_state = L2CAP_WAIT;
+
142  }
+
143  }
+
144  }
+
145 
+
146  if(checkHciHandle(l2capinbuf, hci_handle)) { // acl_handle_ok
+
147  if((l2capinbuf[6] | (l2capinbuf[7] << 8)) == 0x0001U) { // l2cap_control - Channel ID for ACL-U
+
148  if(l2capinbuf[8] == L2CAP_CMD_COMMAND_REJECT) {
+
149 #ifdef DEBUG_USB_HOST
+
150  Notify(PSTR("\r\nL2CAP Command Rejected - Reason: "), 0x80);
+
151  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
+
152  Notify(PSTR(" "), 0x80);
+
153  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
+
154  Notify(PSTR(" "), 0x80);
+
155  D_PrintHex<uint8_t > (l2capinbuf[17], 0x80);
+
156  Notify(PSTR(" "), 0x80);
+
157  D_PrintHex<uint8_t > (l2capinbuf[16], 0x80);
+
158  Notify(PSTR(" "), 0x80);
+
159  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
+
160  Notify(PSTR(" "), 0x80);
+
161  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
+
162 #endif
+
163  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_RESPONSE) {
+
164  if(((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) && ((l2capinbuf[18] | (l2capinbuf[19] << 8)) == SUCCESSFUL)) { // Success
+
165  if(l2capinbuf[14] == control_dcid[0] && l2capinbuf[15] == control_dcid[1]) {
+
166  //Notify(PSTR("\r\nHID Control Connection Complete"), 0x80);
+
167  identifier = l2capinbuf[9];
+
168  control_scid[0] = l2capinbuf[12];
+
169  control_scid[1] = l2capinbuf[13];
+
170  l2cap_set_flag(L2CAP_FLAG_CONTROL_CONNECTED);
+
171  } else if(l2capinbuf[14] == interrupt_dcid[0] && l2capinbuf[15] == interrupt_dcid[1]) {
+
172  //Notify(PSTR("\r\nHID Interrupt Connection Complete"), 0x80);
+
173  identifier = l2capinbuf[9];
+
174  interrupt_scid[0] = l2capinbuf[12];
+
175  interrupt_scid[1] = l2capinbuf[13];
+
176  l2cap_set_flag(L2CAP_FLAG_INTERRUPT_CONNECTED);
+
177  }
+
178  }
+
179  } else if(l2capinbuf[8] == L2CAP_CMD_CONNECTION_REQUEST) {
+
180 #ifdef EXTRADEBUG
+
181  Notify(PSTR("\r\nL2CAP Connection Request - PSM: "), 0x80);
+
182  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
+
183  Notify(PSTR(" "), 0x80);
+
184  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
+
185  Notify(PSTR(" SCID: "), 0x80);
+
186  D_PrintHex<uint8_t > (l2capinbuf[15], 0x80);
+
187  Notify(PSTR(" "), 0x80);
+
188  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
+
189  Notify(PSTR(" Identifier: "), 0x80);
+
190  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
+
191 #endif
+
192  if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_CTRL_PSM) {
+
193  identifier = l2capinbuf[9];
+
194  control_scid[0] = l2capinbuf[14];
+
195  control_scid[1] = l2capinbuf[15];
+
196  l2cap_set_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST);
+
197  } else if((l2capinbuf[12] | (l2capinbuf[13] << 8)) == HID_INTR_PSM) {
+
198  identifier = l2capinbuf[9];
+
199  interrupt_scid[0] = l2capinbuf[14];
+
200  interrupt_scid[1] = l2capinbuf[15];
+
201  l2cap_set_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST);
+
202  }
+
203  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_RESPONSE) {
+
204  if((l2capinbuf[16] | (l2capinbuf[17] << 8)) == 0x0000) { // Success
+
205  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
+
206  //Notify(PSTR("\r\nHID Control Configuration Complete"), 0x80);
+
207  identifier = l2capinbuf[9];
+
208  l2cap_set_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS);
+
209  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
+
210  //Notify(PSTR("\r\nHID Interrupt Configuration Complete"), 0x80);
+
211  identifier = l2capinbuf[9];
+
212  l2cap_set_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS);
+
213  }
+
214  }
+
215  } else if(l2capinbuf[8] == L2CAP_CMD_CONFIG_REQUEST) {
+
216  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
+
217  //Notify(PSTR("\r\nHID Control Configuration Request"), 0x80);
+
218  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], control_scid);
+
219  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
+
220  //Notify(PSTR("\r\nHID Interrupt Configuration Request"), 0x80);
+
221  pBtd->l2cap_config_response(hci_handle, l2capinbuf[9], interrupt_scid);
+
222  }
+
223  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_REQUEST) {
+
224  if(l2capinbuf[12] == control_dcid[0] && l2capinbuf[13] == control_dcid[1]) {
+
225 #ifdef DEBUG_USB_HOST
+
226  Notify(PSTR("\r\nDisconnect Request: Control Channel"), 0x80);
+
227 #endif
+
228  identifier = l2capinbuf[9];
+
229  pBtd->l2cap_disconnection_response(hci_handle, identifier, control_dcid, control_scid);
+
230  Reset();
+
231  } else if(l2capinbuf[12] == interrupt_dcid[0] && l2capinbuf[13] == interrupt_dcid[1]) {
+
232 #ifdef DEBUG_USB_HOST
+
233  Notify(PSTR("\r\nDisconnect Request: Interrupt Channel"), 0x80);
+
234 #endif
+
235  identifier = l2capinbuf[9];
+
236  pBtd->l2cap_disconnection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid);
+
237  Reset();
+
238  }
+
239  } else if(l2capinbuf[8] == L2CAP_CMD_DISCONNECT_RESPONSE) {
+
240  if(l2capinbuf[12] == control_scid[0] && l2capinbuf[13] == control_scid[1]) {
+
241  //Notify(PSTR("\r\nDisconnect Response: Control Channel"), 0x80);
+
242  identifier = l2capinbuf[9];
+
243  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE);
+
244  } else if(l2capinbuf[12] == interrupt_scid[0] && l2capinbuf[13] == interrupt_scid[1]) {
+
245  //Notify(PSTR("\r\nDisconnect Response: Interrupt Channel"), 0x80);
+
246  identifier = l2capinbuf[9];
+
247  l2cap_set_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE);
+
248  }
+
249  }
+
250 #ifdef EXTRADEBUG
+
251  else {
+
252  identifier = l2capinbuf[9];
+
253  Notify(PSTR("\r\nL2CAP Unknown Signaling Command: "), 0x80);
+
254  D_PrintHex<uint8_t > (l2capinbuf[8], 0x80);
+
255  }
+
256 #endif
+
257  } else if(l2capinbuf[6] == interrupt_dcid[0] && l2capinbuf[7] == interrupt_dcid[1]) { // l2cap_interrupt
+
258  //Notify(PSTR("\r\nL2CAP Interrupt"), 0x80);
+
259  if(l2capinbuf[8] == 0xA1) { // HID_THDR_DATA_INPUT
+
260  if((l2capinbuf[9] >= 0x20 && l2capinbuf[9] <= 0x22) || (l2capinbuf[9] >= 0x30 && l2capinbuf[9] <= 0x37) || l2capinbuf[9] == 0x3e || l2capinbuf[9] == 0x3f) { // These reports include the buttons
+
261  if((l2capinbuf[9] >= 0x20 && l2capinbuf[9] <= 0x22) || l2capinbuf[9] == 0x31 || l2capinbuf[9] == 0x33) // These reports have no extensions bytes
+
262  ButtonState = (uint32_t)((l2capinbuf[10] & 0x1F) | ((uint16_t)(l2capinbuf[11] & 0x9F) << 8));
+
263  else if(wiiUProControllerConnected)
+
264  ButtonState = (uint32_t)(((~l2capinbuf[23]) & 0xFE) | ((uint16_t)(~l2capinbuf[24]) << 8) | ((uint32_t)((~l2capinbuf[25]) & 0x03) << 16));
+
265  else if(motionPlusConnected) {
+
266  if(l2capinbuf[20] & 0x02) // Only update the wiimote buttons, since the extension bytes are from the Motion Plus
+
267  ButtonState = (uint32_t)((l2capinbuf[10] & 0x1F) | ((uint16_t)(l2capinbuf[11] & 0x9F) << 8) | ((uint32_t)(ButtonState & 0xFFFF0000)));
+
268  else if(nunchuckConnected) // Update if it's a report from the Nunchuck
+
269  ButtonState = (uint32_t)((l2capinbuf[10] & 0x1F) | ((uint16_t)(l2capinbuf[11] & 0x9F) << 8) | ((uint32_t)((~l2capinbuf[20]) & 0x0C) << 14));
+
270  //else if(classicControllerConnected) // Update if it's a report from the Classic Controller
+
271  } else if(nunchuckConnected) // The Nunchuck is directly connected
+
272  ButtonState = (uint32_t)((l2capinbuf[10] & 0x1F) | ((uint16_t)(l2capinbuf[11] & 0x9F) << 8) | ((uint32_t)((~l2capinbuf[20]) & 0x03) << 16));
+
273  //else if(classicControllerConnected) // The Classic Controller is directly connected
+
274  else if(!unknownExtensionConnected)
+
275  ButtonState = (uint32_t)((l2capinbuf[10] & 0x1F) | ((uint16_t)(l2capinbuf[11] & 0x9F) << 8));
+
276 #ifdef PRINTREPORT
+
277  Notify(PSTR("ButtonState: "), 0x80);
+
278  D_PrintHex<uint32_t > (ButtonState, 0x80);
+
279  Notify(PSTR("\r\n"), 0x80);
+
280 #endif
+
281  if(ButtonState != OldButtonState) {
+
282  ButtonClickState = ButtonState & ~OldButtonState; // Update click state variable
+
283  OldButtonState = ButtonState;
+
284  }
+
285  }
+
286  if(l2capinbuf[9] == 0x31 || l2capinbuf[9] == 0x33 || l2capinbuf[9] == 0x35 || l2capinbuf[9] == 0x37) { // Read the accelerometer
+
287  accXwiimote = ((l2capinbuf[12] << 2) | (l2capinbuf[10] & 0x60 >> 5)) - 500;
+
288  accYwiimote = ((l2capinbuf[13] << 2) | (l2capinbuf[11] & 0x20 >> 4)) - 500;
+
289  accZwiimote = ((l2capinbuf[14] << 2) | (l2capinbuf[11] & 0x40 >> 5)) - 500;
+
290  }
+
291  switch(l2capinbuf[9]) {
+
292  case 0x20: // Status Information - (a1) 20 BB BB LF 00 00 VV
+
293 #ifdef EXTRADEBUG
+
294  Notify(PSTR("\r\nStatus report was received"), 0x80);
+
295 #endif
+
296  wiiState = l2capinbuf[12]; // (0x01: Battery is nearly empty), (0x02: An Extension Controller is connected), (0x04: Speaker enabled), (0x08: IR enabled), (0x10: LED1, 0x20: LED2, 0x40: LED3, 0x80: LED4)
+
297  batteryLevel = l2capinbuf[15]; // Update battery level
+
298 #ifdef DEBUG_USB_HOST
+
299  if(l2capinbuf[12] & 0x01)
+
300  Notify(PSTR("\r\nWARNING: Battery is nearly empty"), 0x80);
+
301 #endif
+
302  if(checkExtension) { // If this is false it means that the user must have called getBatteryLevel()
+
303  if(l2capinbuf[12] & 0x02) { // Check if a extension is connected
+
304 #ifdef DEBUG_USB_HOST
+
305  if(!unknownExtensionConnected)
+
306  Notify(PSTR("\r\nExtension connected"), 0x80);
+
307 #endif
+
308  unknownExtensionConnected = true;
+
309 #ifdef WIICAMERA
+
310  if(!isIRCameraEnabled()) // Don't activate the Motion Plus if we are trying to initialize the IR camera
+
311 #endif
+
312  setReportMode(false, 0x35); // Also read the extension
+
313  } else {
+
314 #ifdef DEBUG_USB_HOST
+
315  Notify(PSTR("\r\nExtension disconnected"), 0x80);
+
316 #endif
+
317  if(motionPlusConnected) {
+
318 #ifdef DEBUG_USB_HOST
+
319  Notify(PSTR(" - from Motion Plus"), 0x80);
+
320 #endif
+
321  wii_clear_flag(WII_FLAG_NUNCHUCK_CONNECTED);
+
322  if(!activateNunchuck) // If it's already trying to initialize the Nunchuck don't set it to false
+
323  nunchuckConnected = false;
+
324  //else if(classicControllerConnected)
+
325  } else if(nunchuckConnected) {
+
326 #ifdef DEBUG_USB_HOST
+
327  Notify(PSTR(" - Nunchuck"), 0x80);
+
328 #endif
+
329  nunchuckConnected = false; // It must be the Nunchuck controller then
+
330  wii_clear_flag(WII_FLAG_NUNCHUCK_CONNECTED);
+
331  onInit();
+
332  setReportMode(false, 0x31); // If there is no extension connected we will read the buttons and accelerometer
+
333  } else
+
334  setReportMode(false, 0x31); // If there is no extension connected we will read the buttons and accelerometer
+
335  }
+
336  } else
+
337  checkExtension = true; // Check for extensions by default
+
338  break;
+
339  case 0x21: // Read Memory Data
+
340  if((l2capinbuf[12] & 0x0F) == 0) { // No error
+
341  // See: http://wiibrew.org/wiki/Wiimote/Extension_Controllers
+
342  if(l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA4 && l2capinbuf[18] == 0x20 && l2capinbuf[19] == 0x00 && l2capinbuf[20] == 0x00) {
+
343 #ifdef DEBUG_USB_HOST
+
344  Notify(PSTR("\r\nNunchuck connected"), 0x80);
+
345 #endif
+
346  wii_set_flag(WII_FLAG_NUNCHUCK_CONNECTED);
+
347  } else if(l2capinbuf[16] == 0x00 && (l2capinbuf[17] == 0xA6 || l2capinbuf[17] == 0xA4) && l2capinbuf[18] == 0x20 && l2capinbuf[19] == 0x00 && l2capinbuf[20] == 0x05) {
+
348 #ifdef DEBUG_USB_HOST
+
349  Notify(PSTR("\r\nMotion Plus connected"), 0x80);
+
350 #endif
+
351  wii_set_flag(WII_FLAG_MOTION_PLUS_CONNECTED);
+
352  } else if(l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA4 && l2capinbuf[18] == 0x20 && l2capinbuf[19] == 0x04 && l2capinbuf[20] == 0x05) {
+
353 #ifdef DEBUG_USB_HOST
+
354  Notify(PSTR("\r\nMotion Plus activated in normal mode"), 0x80);
+
355 #endif
+
356  motionPlusConnected = true;
+
357 #ifdef WIICAMERA
+
358  if(!isIRCameraEnabled()) // Don't activate the Motion Plus if we are trying to initialize the IR camera
+
359 #endif
+
360  setReportMode(false, 0x35); // Also read the extension
+
361  } else if(l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA4 && l2capinbuf[18] == 0x20 && l2capinbuf[19] == 0x05 && l2capinbuf[20] == 0x05) {
+
362 #ifdef DEBUG_USB_HOST
+
363  Notify(PSTR("\r\nMotion Plus activated in Nunchuck pass-through mode"), 0x80);
+
364 #endif
+
365  activateNunchuck = false;
+
366  motionPlusConnected = true;
+
367  nunchuckConnected = true;
+
368 #ifdef WIICAMERA
+
369  if(!isIRCameraEnabled()) // Don't activate the Motion Plus if we are trying to initialize the IR camera
+
370 #endif
+
371  setReportMode(false, 0x35); // Also read the extension
+
372  } else if(l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA6 && l2capinbuf[18] == 0x20 && (l2capinbuf[19] == 0x00 || l2capinbuf[19] == 0x04 || l2capinbuf[19] == 0x05 || l2capinbuf[19] == 0x07) && l2capinbuf[20] == 0x05) {
+
373 #ifdef DEBUG_USB_HOST
+
374  Notify(PSTR("\r\nInactive Wii Motion Plus"), 0x80);
+
375  Notify(PSTR("\r\nPlease unplug the Motion Plus, disconnect the Wiimote and then replug the Motion Plus Extension"), 0x80);
+
376 #endif
+
377  stateCounter = 300; // Skip the rest in "WII_CHECK_MOTION_PLUS_STATE"
+
378  } else if(l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA4 && l2capinbuf[18] == 0x20 && l2capinbuf[19] == 0x01 && l2capinbuf[20] == 0x20) {
+
379 #ifdef DEBUG_USB_HOST
+
380  Notify(PSTR("\r\nWii U Pro Controller connected"), 0x80);
+
381 #endif
+
382  wiiUProControllerConnected = true;
+
383  }
+
384 #ifdef DEBUG_USB_HOST
+
385  else {
+
386  Notify(PSTR("\r\nUnknown Device: "), 0x80);
+
387  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
+
388  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
+
389  Notify(PSTR("\r\nData: "), 0x80);
+
390  for(uint8_t i = 0; i < ((l2capinbuf[12] >> 4) + 1); i++) { // bit 4-7 is the length-1
+
391  D_PrintHex<uint8_t > (l2capinbuf[15 + i], 0x80);
+
392  Notify(PSTR(" "), 0x80);
+
393  }
+
394  }
+
395 #endif
+
396  }
+
397 #ifdef EXTRADEBUG
+
398  else {
+
399  Notify(PSTR("\r\nReport Error: "), 0x80);
+
400  D_PrintHex<uint8_t > (l2capinbuf[13], 0x80);
+
401  D_PrintHex<uint8_t > (l2capinbuf[14], 0x80);
+
402  }
+
403 #endif
+
404  break;
+
405  case 0x22: // Acknowledge output report, return function result
+
406 #ifdef DEBUG_USB_HOST
+
407  if(l2capinbuf[13] != 0x00) { // Check if there is an error
+
408  Notify(PSTR("\r\nCommand failed: "), 0x80);
+
409  D_PrintHex<uint8_t > (l2capinbuf[12], 0x80);
+
410  }
+
411 #endif
+
412  break;
+
413  case 0x30: // Core buttons - (a1) 30 BB BB
+
414  break;
+
415  case 0x31: // Core Buttons and Accelerometer - (a1) 31 BB BB AA AA AA
+
416  break;
+
417  case 0x32: // Core Buttons with 8 Extension bytes - (a1) 32 BB BB EE EE EE EE EE EE EE EE
+
418  break;
+
419  case 0x33: // Core Buttons with Accelerometer and 12 IR bytes - (a1) 33 BB BB AA AA AA II II II II II II II II II II II II
+
420 #ifdef WIICAMERA
+
421  // Read the IR data
+
422  IR_object_x1 = (l2capinbuf[15] | ((uint16_t)(l2capinbuf[17] & 0x30) << 4)); // x position
+
423  IR_object_y1 = (l2capinbuf[16] | ((uint16_t)(l2capinbuf[17] & 0xC0) << 2)); // y position
+
424  IR_object_s1 = (l2capinbuf[17] & 0x0F); // size value, 0-15
+
425 
+
426  IR_object_x2 = (l2capinbuf[18] | ((uint16_t)(l2capinbuf[20] & 0x30) << 4));
+
427  IR_object_y2 = (l2capinbuf[19] | ((uint16_t)(l2capinbuf[20] & 0xC0) << 2));
+
428  IR_object_s2 = (l2capinbuf[20] & 0x0F);
+
429 
+
430  IR_object_x3 = (l2capinbuf[21] | ((uint16_t)(l2capinbuf[23] & 0x30) << 4));
+
431  IR_object_y3 = (l2capinbuf[22] | ((uint16_t)(l2capinbuf[23] & 0xC0) << 2));
+
432  IR_object_s3 = (l2capinbuf[23] & 0x0F);
+
433 
+
434  IR_object_x4 = (l2capinbuf[24] | ((uint16_t)(l2capinbuf[26] & 0x30) << 4));
+
435  IR_object_y4 = (l2capinbuf[25] | ((uint16_t)(l2capinbuf[26] & 0xC0) << 2));
+
436  IR_object_s4 = (l2capinbuf[26] & 0x0F);
+
437 #endif
+
438  break;
+
439  case 0x34: // Core Buttons with 19 Extension bytes - (a1) 34 BB BB EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE
+
440  break;
+
441  /* 0x3e and 0x3f both give unknown report types when report mode is 0x3e or 0x3f with mode number 0x05 */
+
442  case 0x3E: // Core Buttons with Accelerometer and 32 IR bytes
+
443  // (a1) 31 BB BB AA AA AA II II II II II II II II II II II II II II II II II II II II II II II II II II II II II II II II
+
444  // corresponds to output report mode 0x3e
+
445 
+
446  /**** for reading in full mode: DOES NOT WORK YET ****/
+
447  /* When it works it will also have intensity and bounding box data */
+
448  /*
+
449  IR_object_x1 = (l2capinbuf[13] | ((uint16_t)(l2capinbuf[15] & 0x30) << 4));
+
450  IR_object_y1 = (l2capinbuf[14] | ((uint16_t)(l2capinbuf[15] & 0xC0) << 2));
+
451  IR_object_s1 = (l2capinbuf[15] & 0x0F);
+
452  */
+
453  break;
+
454  case 0x3F:
+
455  /*
+
456  IR_object_x1 = (l2capinbuf[13] | ((uint16_t)(l2capinbuf[15] & 0x30) << 4));
+
457  IR_object_y1 = (l2capinbuf[14] | ((uint16_t)(l2capinbuf[15] & 0xC0) << 2));
+
458  IR_object_s1 = (l2capinbuf[15] & 0x0F);
+
459  */
+
460  break;
+
461  case 0x35: // Core Buttons and Accelerometer with 16 Extension Bytes
+
462  // (a1) 35 BB BB AA AA AA EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE
+
463  if(motionPlusConnected) {
+
464  if(l2capinbuf[20] & 0x02) { // Check if it's a report from the Motion controller or the extension
+
465  if(motionValuesReset) { // We will only use the values when the gyro value has been set
+
466  gyroYawRaw = ((l2capinbuf[15] | ((l2capinbuf[18] & 0xFC) << 6)) - gyroYawZero);
+
467  gyroRollRaw = ((l2capinbuf[16] | ((l2capinbuf[19] & 0xFC) << 6)) - gyroRollZero);
+
468  gyroPitchRaw = ((l2capinbuf[17] | ((l2capinbuf[20] & 0xFC) << 6)) - gyroPitchZero);
+
469 
+
470  yawGyroSpeed = (double)gyroYawRaw / ((double)gyroYawZero / yawGyroScale);
+
471  rollGyroSpeed = -(double)gyroRollRaw / ((double)gyroRollZero / rollGyroScale); // We invert these values so they will fit the acc values
+
472  pitchGyroSpeed = (double)gyroPitchRaw / ((double)gyroPitchZero / pitchGyroScale);
+
473 
+
474  /* The onboard gyro has two ranges for slow and fast mode */
+
475  if(!(l2capinbuf[18] & 0x02)) // Check if fast mode is used
+
476  yawGyroSpeed *= 4.545;
+
477  if(!(l2capinbuf[18] & 0x01)) // Check if fast mode is used
+
478  pitchGyroSpeed *= 4.545;
+
479  if(!(l2capinbuf[19] & 0x02)) // Check if fast mode is used
+
480  rollGyroSpeed *= 4.545;
+
481 
+
482  compPitch = (0.93 * (compPitch + (pitchGyroSpeed * (double)(micros() - timer) / 1000000)))+(0.07 * getWiimotePitch()); // Use a complimentary filter to calculate the angle
+
483  compRoll = (0.93 * (compRoll + (rollGyroSpeed * (double)(micros() - timer) / 1000000)))+(0.07 * getWiimoteRoll());
484 
-
485  compPitch = (0.93 * (compPitch + (pitchGyroSpeed * (double)(micros() - timer) / 1000000)))+(0.07 * getWiimotePitch()); // Use a complimentary filter to calculate the angle
-
486  compRoll = (0.93 * (compRoll + (rollGyroSpeed * (double)(micros() - timer) / 1000000)))+(0.07 * getWiimoteRoll());
-
487 
-
488  gyroYaw += (yawGyroSpeed * ((double)(micros() - timer) / 1000000));
-
489  gyroRoll += (rollGyroSpeed * ((double)(micros() - timer) / 1000000));
-
490  gyroPitch += (pitchGyroSpeed * ((double)(micros() - timer) / 1000000));
-
491  timer = micros();
-
492  /*
-
493  // Uncomment these lines to tune the gyro scale variabels
-
494  Notify(PSTR("\r\ngyroYaw: "), 0x80);
-
495  Notify(gyroYaw, 0x80);
-
496  Notify(PSTR("\tgyroRoll: "), 0x80);
-
497  Notify(gyroRoll, 0x80);
-
498  Notify(PSTR("\tgyroPitch: "), 0x80);
-
499  Notify(gyroPitch, 0x80);
-
500  */
-
501  /*
-
502  Notify(PSTR("\twiimoteRoll: "), 0x80);
-
503  Notify(wiimoteRoll, 0x80);
-
504  Notify(PSTR("\twiimotePitch: "), 0x80);
-
505  Notify(wiimotePitch, 0x80);
-
506  */
-
507  } else {
-
508  if((micros() - timer) > 1000000) { // Loop for 1 sec before resetting the values
-
509 #ifdef DEBUG_USB_HOST
-
510  Notify(PSTR("\r\nThe gyro values has been reset"), 0x80);
-
511 #endif
-
512  gyroYawZero = (l2capinbuf[15] | ((l2capinbuf[18] & 0xFC) << 6));
-
513  gyroRollZero = (l2capinbuf[16] | ((l2capinbuf[19] & 0xFC) << 6));
-
514  gyroPitchZero = (l2capinbuf[17] | ((l2capinbuf[20] & 0xFC) << 6));
-
515 
-
516  rollGyroScale = 500; // You might need to adjust these
-
517  pitchGyroScale = 400;
-
518  yawGyroScale = 415;
-
519 
-
520  gyroYaw = 0;
-
521  gyroRoll = 0;
-
522  gyroPitch = 0;
-
523 
-
524  motionValuesReset = true;
-
525  timer = micros();
-
526  }
-
527  }
-
528  } else {
-
529  if(nunchuckConnected) {
-
530  hatValues[HatX] = l2capinbuf[15];
-
531  hatValues[HatY] = l2capinbuf[16];
-
532  accXnunchuck = ((l2capinbuf[17] << 2) | (l2capinbuf[20] & 0x10 >> 3)) - 416;
-
533  accYnunchuck = ((l2capinbuf[18] << 2) | (l2capinbuf[20] & 0x20 >> 4)) - 416;
-
534  accZnunchuck = (((l2capinbuf[19] & 0xFE) << 2) | (l2capinbuf[20] & 0xC0 >> 5)) - 416;
-
535  }
-
536  //else if(classicControllerConnected) { }
-
537  }
-
538  if(l2capinbuf[19] & 0x01) {
-
539  if(!extensionConnected) {
-
540  extensionConnected = true;
-
541  unknownExtensionConnected = true;
-
542 #ifdef DEBUG_USB_HOST
-
543  Notify(PSTR("\r\nExtension connected to Motion Plus"), 0x80);
-
544 #endif
-
545  }
-
546  } else {
-
547  if(extensionConnected && !unknownExtensionConnected) {
-
548  extensionConnected = false;
-
549  unknownExtensionConnected = true;
-
550 #ifdef DEBUG_USB_HOST
-
551  Notify(PSTR("\r\nExtension disconnected from Motion Plus"), 0x80);
-
552 #endif
-
553  nunchuckConnected = false; // There is no extension connected to the Motion Plus if this report is sent
-
554  }
-
555  }
-
556 
-
557  } else if(nunchuckConnected) {
-
558  hatValues[HatX] = l2capinbuf[15];
-
559  hatValues[HatY] = l2capinbuf[16];
-
560  accXnunchuck = ((l2capinbuf[17] << 2) | (l2capinbuf[20] & 0x0C >> 2)) - 416;
-
561  accYnunchuck = ((l2capinbuf[18] << 2) | (l2capinbuf[20] & 0x30 >> 4)) - 416;
-
562  accZnunchuck = ((l2capinbuf[19] << 2) | (l2capinbuf[20] & 0xC0 >> 6)) - 416;
-
563  } else if(wiiUProControllerConnected) {
-
564  hatValues[LeftHatX] = (l2capinbuf[15] | l2capinbuf[16] << 8);
-
565  hatValues[RightHatX] = (l2capinbuf[17] | l2capinbuf[18] << 8);
-
566  hatValues[LeftHatY] = (l2capinbuf[19] | l2capinbuf[20] << 8);
-
567  hatValues[RightHatY] = (l2capinbuf[21] | l2capinbuf[22] << 8);
-
568  }
-
569  break;
-
570 #ifdef DEBUG_USB_HOST
-
571  default:
-
572  Notify(PSTR("\r\nUnknown Report type: "), 0x80);
-
573  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
-
574  break;
-
575 #endif
-
576  }
-
577  }
-
578  }
-
579  L2CAP_task();
-
580  }
-
581 }
-
582 
-
583 void WII::L2CAP_task() {
-
584  switch(l2cap_state) {
-
585  /* These states are used if the Wiimote is the host */
-
586  case L2CAP_CONTROL_SUCCESS:
-
587  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)) {
-
588 #ifdef DEBUG_USB_HOST
-
589  Notify(PSTR("\r\nHID Control Successfully Configured"), 0x80);
-
590 #endif
-
591  l2cap_state = L2CAP_INTERRUPT_SETUP;
-
592  }
-
593  break;
-
594 
-
595  case L2CAP_INTERRUPT_SETUP:
-
596  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)) {
-
597 #ifdef DEBUG_USB_HOST
-
598  Notify(PSTR("\r\nHID Interrupt Incoming Connection Request"), 0x80);
-
599 #endif
-
600  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, PENDING);
+
485  gyroYaw += (yawGyroSpeed * ((double)(micros() - timer) / 1000000));
+
486  gyroRoll += (rollGyroSpeed * ((double)(micros() - timer) / 1000000));
+
487  gyroPitch += (pitchGyroSpeed * ((double)(micros() - timer) / 1000000));
+
488  timer = micros();
+
489  /*
+
490  // Uncomment these lines to tune the gyro scale variabels
+
491  Notify(PSTR("\r\ngyroYaw: "), 0x80);
+
492  Notify(gyroYaw, 0x80);
+
493  Notify(PSTR("\tgyroRoll: "), 0x80);
+
494  Notify(gyroRoll, 0x80);
+
495  Notify(PSTR("\tgyroPitch: "), 0x80);
+
496  Notify(gyroPitch, 0x80);
+
497  */
+
498  /*
+
499  Notify(PSTR("\twiimoteRoll: "), 0x80);
+
500  Notify(wiimoteRoll, 0x80);
+
501  Notify(PSTR("\twiimotePitch: "), 0x80);
+
502  Notify(wiimotePitch, 0x80);
+
503  */
+
504  } else {
+
505  if((micros() - timer) > 1000000) { // Loop for 1 sec before resetting the values
+
506 #ifdef DEBUG_USB_HOST
+
507  Notify(PSTR("\r\nThe gyro values has been reset"), 0x80);
+
508 #endif
+
509  gyroYawZero = (l2capinbuf[15] | ((l2capinbuf[18] & 0xFC) << 6));
+
510  gyroRollZero = (l2capinbuf[16] | ((l2capinbuf[19] & 0xFC) << 6));
+
511  gyroPitchZero = (l2capinbuf[17] | ((l2capinbuf[20] & 0xFC) << 6));
+
512 
+
513  rollGyroScale = 500; // You might need to adjust these
+
514  pitchGyroScale = 400;
+
515  yawGyroScale = 415;
+
516 
+
517  gyroYaw = 0;
+
518  gyroRoll = 0;
+
519  gyroPitch = 0;
+
520 
+
521  motionValuesReset = true;
+
522  timer = micros();
+
523  }
+
524  }
+
525  } else {
+
526  if(nunchuckConnected) {
+
527  hatValues[HatX] = l2capinbuf[15];
+
528  hatValues[HatY] = l2capinbuf[16];
+
529  accXnunchuck = ((l2capinbuf[17] << 2) | (l2capinbuf[20] & 0x10 >> 3)) - 416;
+
530  accYnunchuck = ((l2capinbuf[18] << 2) | (l2capinbuf[20] & 0x20 >> 4)) - 416;
+
531  accZnunchuck = (((l2capinbuf[19] & 0xFE) << 2) | (l2capinbuf[20] & 0xC0 >> 5)) - 416;
+
532  }
+
533  //else if(classicControllerConnected) { }
+
534  }
+
535  if(l2capinbuf[19] & 0x01) {
+
536  if(!extensionConnected) {
+
537  extensionConnected = true;
+
538  unknownExtensionConnected = true;
+
539 #ifdef DEBUG_USB_HOST
+
540  Notify(PSTR("\r\nExtension connected to Motion Plus"), 0x80);
+
541 #endif
+
542  }
+
543  } else {
+
544  if(extensionConnected && !unknownExtensionConnected) {
+
545  extensionConnected = false;
+
546  unknownExtensionConnected = true;
+
547 #ifdef DEBUG_USB_HOST
+
548  Notify(PSTR("\r\nExtension disconnected from Motion Plus"), 0x80);
+
549 #endif
+
550  nunchuckConnected = false; // There is no extension connected to the Motion Plus if this report is sent
+
551  }
+
552  }
+
553 
+
554  } else if(nunchuckConnected) {
+
555  hatValues[HatX] = l2capinbuf[15];
+
556  hatValues[HatY] = l2capinbuf[16];
+
557  accXnunchuck = ((l2capinbuf[17] << 2) | (l2capinbuf[20] & 0x0C >> 2)) - 416;
+
558  accYnunchuck = ((l2capinbuf[18] << 2) | (l2capinbuf[20] & 0x30 >> 4)) - 416;
+
559  accZnunchuck = ((l2capinbuf[19] << 2) | (l2capinbuf[20] & 0xC0 >> 6)) - 416;
+
560  } else if(wiiUProControllerConnected) {
+
561  hatValues[LeftHatX] = (l2capinbuf[15] | l2capinbuf[16] << 8);
+
562  hatValues[RightHatX] = (l2capinbuf[17] | l2capinbuf[18] << 8);
+
563  hatValues[LeftHatY] = (l2capinbuf[19] | l2capinbuf[20] << 8);
+
564  hatValues[RightHatY] = (l2capinbuf[21] | l2capinbuf[22] << 8);
+
565  }
+
566  break;
+
567 #ifdef DEBUG_USB_HOST
+
568  default:
+
569  Notify(PSTR("\r\nUnknown Report type: "), 0x80);
+
570  D_PrintHex<uint8_t > (l2capinbuf[9], 0x80);
+
571  break;
+
572 #endif
+
573  }
+
574  }
+
575  }
+
576  L2CAP_task();
+
577  }
+
578 }
+
579 
+
580 void WII::L2CAP_task() {
+
581  switch(l2cap_state) {
+
582  /* These states are used if the Wiimote is the host */
+
583  case L2CAP_CONTROL_SUCCESS:
+
584  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)) {
+
585 #ifdef DEBUG_USB_HOST
+
586  Notify(PSTR("\r\nHID Control Successfully Configured"), 0x80);
+
587 #endif
+
588  l2cap_state = L2CAP_INTERRUPT_SETUP;
+
589  }
+
590  break;
+
591 
+
592  case L2CAP_INTERRUPT_SETUP:
+
593  if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)) {
+
594 #ifdef DEBUG_USB_HOST
+
595  Notify(PSTR("\r\nHID Interrupt Incoming Connection Request"), 0x80);
+
596 #endif
+
597  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, PENDING);
+
598  delay(1);
+
599  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, SUCCESSFUL);
+
600  identifier++;
601  delay(1);
-
602  pBtd->l2cap_connection_response(hci_handle, identifier, interrupt_dcid, interrupt_scid, SUCCESSFUL);
-
603  identifier++;
-
604  delay(1);
-
605  pBtd->l2cap_config_request(hci_handle, identifier, interrupt_scid);
-
606 
-
607  l2cap_state = L2CAP_INTERRUPT_CONFIG_REQUEST;
-
608  }
-
609  break;
-
610 
-
611  /* These states are used if the Arduino is the host */
-
612  case L2CAP_CONTROL_CONNECT_REQUEST:
-
613  if(l2cap_check_flag(L2CAP_FLAG_CONTROL_CONNECTED)) {
-
614 #ifdef DEBUG_USB_HOST
-
615  Notify(PSTR("\r\nSend HID Control Config Request"), 0x80);
-
616 #endif
-
617  identifier++;
-
618  pBtd->l2cap_config_request(hci_handle, identifier, control_scid);
-
619  l2cap_state = L2CAP_CONTROL_CONFIG_REQUEST;
-
620  }
-
621  break;
-
622 
-
623  case L2CAP_CONTROL_CONFIG_REQUEST:
-
624  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)) {
-
625 #ifdef DEBUG_USB_HOST
-
626  Notify(PSTR("\r\nSend HID Interrupt Connection Request"), 0x80);
-
627 #endif
-
628  identifier++;
-
629  pBtd->l2cap_connection_request(hci_handle, identifier, interrupt_dcid, HID_INTR_PSM);
-
630  l2cap_state = L2CAP_INTERRUPT_CONNECT_REQUEST;
-
631  }
-
632  break;
-
633 
-
634  case L2CAP_INTERRUPT_CONNECT_REQUEST:
-
635  if(l2cap_check_flag(L2CAP_FLAG_INTERRUPT_CONNECTED)) {
-
636 #ifdef DEBUG_USB_HOST
-
637  Notify(PSTR("\r\nSend HID Interrupt Config Request"), 0x80);
-
638 #endif
-
639  identifier++;
-
640  pBtd->l2cap_config_request(hci_handle, identifier, interrupt_scid);
-
641  l2cap_state = L2CAP_INTERRUPT_CONFIG_REQUEST;
-
642  }
-
643  break;
-
644 
-
645  case L2CAP_INTERRUPT_CONFIG_REQUEST:
-
646  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)) { // Now the HID channels is established
-
647 #ifdef DEBUG_USB_HOST
-
648  Notify(PSTR("\r\nHID Channels Established"), 0x80);
-
649 #endif
-
650  pBtd->connectToWii = false;
-
651  pBtd->pairWithWii = false;
-
652  stateCounter = 0;
-
653  l2cap_state = WII_CHECK_MOTION_PLUS_STATE;
-
654  }
-
655  break;
-
656 
-
657  /* The next states are in run() */
-
658 
-
659  case L2CAP_INTERRUPT_DISCONNECT:
-
660  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE) && ((long)(millis() - timer) >= 0L)) {
-
661 #ifdef DEBUG_USB_HOST
-
662  Notify(PSTR("\r\nDisconnected Interrupt Channel"), 0x80);
-
663 #endif
-
664  identifier++;
-
665  pBtd->l2cap_disconnection_request(hci_handle, identifier, control_scid, control_dcid);
-
666  l2cap_state = L2CAP_CONTROL_DISCONNECT;
-
667  }
-
668  break;
-
669 
-
670  case L2CAP_CONTROL_DISCONNECT:
-
671  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)) {
-
672 #ifdef DEBUG_USB_HOST
-
673  Notify(PSTR("\r\nDisconnected Control Channel"), 0x80);
-
674 #endif
-
675  pBtd->hci_disconnect(hci_handle);
-
676  hci_handle = -1; // Reset handle
-
677  l2cap_event_flag = 0; // Reset flags
-
678  l2cap_state = L2CAP_WAIT;
-
679  }
-
680  break;
-
681  }
-
682 }
-
683 
-
684 void WII::Run() {
-
685  if(l2cap_state == L2CAP_INTERRUPT_DISCONNECT && ((long)(millis() - timer) >= 0L))
-
686  L2CAP_task(); // Call the rest of the disconnection routine after we have waited long enough
-
687 
-
688  switch(l2cap_state) {
-
689  case L2CAP_WAIT:
-
690  if(pBtd->connectToWii && !pBtd->l2capConnectionClaimed && !wiimoteConnected && !activeConnection) {
-
691  pBtd->l2capConnectionClaimed = true;
-
692  activeConnection = true;
-
693  motionPlusInside = pBtd->motionPlusInside;
-
694 #ifdef DEBUG_USB_HOST
-
695  Notify(PSTR("\r\nSend HID Control Connection Request"), 0x80);
-
696 #endif
-
697  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
-
698  l2cap_event_flag = 0; // Reset flags
-
699  identifier = 0;
-
700  pBtd->l2cap_connection_request(hci_handle, identifier, control_dcid, HID_CTRL_PSM);
-
701  l2cap_state = L2CAP_CONTROL_CONNECT_REQUEST;
-
702  } else if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)) {
-
703 #ifdef DEBUG_USB_HOST
-
704  Notify(PSTR("\r\nHID Control Incoming Connection Request"), 0x80);
-
705 #endif
-
706  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, PENDING);
+
602  pBtd->l2cap_config_request(hci_handle, identifier, interrupt_scid);
+
603 
+
604  l2cap_state = L2CAP_INTERRUPT_CONFIG_REQUEST;
+
605  }
+
606  break;
+
607 
+
608  /* These states are used if the Arduino is the host */
+
609  case L2CAP_CONTROL_CONNECT_REQUEST:
+
610  if(l2cap_check_flag(L2CAP_FLAG_CONTROL_CONNECTED)) {
+
611 #ifdef DEBUG_USB_HOST
+
612  Notify(PSTR("\r\nSend HID Control Config Request"), 0x80);
+
613 #endif
+
614  identifier++;
+
615  pBtd->l2cap_config_request(hci_handle, identifier, control_scid);
+
616  l2cap_state = L2CAP_CONTROL_CONFIG_REQUEST;
+
617  }
+
618  break;
+
619 
+
620  case L2CAP_CONTROL_CONFIG_REQUEST:
+
621  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)) {
+
622 #ifdef DEBUG_USB_HOST
+
623  Notify(PSTR("\r\nSend HID Interrupt Connection Request"), 0x80);
+
624 #endif
+
625  identifier++;
+
626  pBtd->l2cap_connection_request(hci_handle, identifier, interrupt_dcid, HID_INTR_PSM);
+
627  l2cap_state = L2CAP_INTERRUPT_CONNECT_REQUEST;
+
628  }
+
629  break;
+
630 
+
631  case L2CAP_INTERRUPT_CONNECT_REQUEST:
+
632  if(l2cap_check_flag(L2CAP_FLAG_INTERRUPT_CONNECTED)) {
+
633 #ifdef DEBUG_USB_HOST
+
634  Notify(PSTR("\r\nSend HID Interrupt Config Request"), 0x80);
+
635 #endif
+
636  identifier++;
+
637  pBtd->l2cap_config_request(hci_handle, identifier, interrupt_scid);
+
638  l2cap_state = L2CAP_INTERRUPT_CONFIG_REQUEST;
+
639  }
+
640  break;
+
641 
+
642  case L2CAP_INTERRUPT_CONFIG_REQUEST:
+
643  if(l2cap_check_flag(L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)) { // Now the HID channels is established
+
644 #ifdef DEBUG_USB_HOST
+
645  Notify(PSTR("\r\nHID Channels Established"), 0x80);
+
646 #endif
+
647  pBtd->connectToWii = false;
+
648  pBtd->pairWithWii = false;
+
649  stateCounter = 0;
+
650  l2cap_state = WII_CHECK_MOTION_PLUS_STATE;
+
651  }
+
652  break;
+
653 
+
654  /* The next states are in run() */
+
655 
+
656  case L2CAP_INTERRUPT_DISCONNECT:
+
657  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE) && ((long)(millis() - timer) >= 0L)) {
+
658 #ifdef DEBUG_USB_HOST
+
659  Notify(PSTR("\r\nDisconnected Interrupt Channel"), 0x80);
+
660 #endif
+
661  identifier++;
+
662  pBtd->l2cap_disconnection_request(hci_handle, identifier, control_scid, control_dcid);
+
663  l2cap_state = L2CAP_CONTROL_DISCONNECT;
+
664  }
+
665  break;
+
666 
+
667  case L2CAP_CONTROL_DISCONNECT:
+
668  if(l2cap_check_flag(L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)) {
+
669 #ifdef DEBUG_USB_HOST
+
670  Notify(PSTR("\r\nDisconnected Control Channel"), 0x80);
+
671 #endif
+
672  pBtd->hci_disconnect(hci_handle);
+
673  hci_handle = -1; // Reset handle
+
674  l2cap_event_flag = 0; // Reset flags
+
675  l2cap_state = L2CAP_WAIT;
+
676  }
+
677  break;
+
678  }
+
679 }
+
680 
+
681 void WII::Run() {
+
682  if(l2cap_state == L2CAP_INTERRUPT_DISCONNECT && ((long)(millis() - timer) >= 0L))
+
683  L2CAP_task(); // Call the rest of the disconnection routine after we have waited long enough
+
684 
+
685  switch(l2cap_state) {
+
686  case L2CAP_WAIT:
+
687  if(pBtd->connectToWii && !pBtd->l2capConnectionClaimed && !wiimoteConnected && !activeConnection) {
+
688  pBtd->l2capConnectionClaimed = true;
+
689  activeConnection = true;
+
690  motionPlusInside = pBtd->motionPlusInside;
+
691 #ifdef DEBUG_USB_HOST
+
692  Notify(PSTR("\r\nSend HID Control Connection Request"), 0x80);
+
693 #endif
+
694  hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
+
695  l2cap_event_flag = 0; // Reset flags
+
696  identifier = 0;
+
697  pBtd->l2cap_connection_request(hci_handle, identifier, control_dcid, HID_CTRL_PSM);
+
698  l2cap_state = L2CAP_CONTROL_CONNECT_REQUEST;
+
699  } else if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)) {
+
700 #ifdef DEBUG_USB_HOST
+
701  Notify(PSTR("\r\nHID Control Incoming Connection Request"), 0x80);
+
702 #endif
+
703  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, PENDING);
+
704  delay(1);
+
705  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, SUCCESSFUL);
+
706  identifier++;
707  delay(1);
-
708  pBtd->l2cap_connection_response(hci_handle, identifier, control_dcid, control_scid, SUCCESSFUL);
-
709  identifier++;
-
710  delay(1);
-
711  pBtd->l2cap_config_request(hci_handle, identifier, control_scid);
-
712  l2cap_state = L2CAP_CONTROL_SUCCESS;
-
713  }
-
714  break;
-
715 
-
716  case WII_CHECK_MOTION_PLUS_STATE:
-
717 #ifdef DEBUG_USB_HOST
-
718  if(stateCounter == 0) // Only print onnce
-
719  Notify(PSTR("\r\nChecking if a Motion Plus is connected"), 0x80);
-
720 #endif
-
721  stateCounter++;
-
722  if(stateCounter % 200 == 0)
-
723  checkMotionPresent(); // Check if there is a motion plus connected
-
724  if(wii_check_flag(WII_FLAG_MOTION_PLUS_CONNECTED)) {
-
725  stateCounter = 0;
-
726  l2cap_state = WII_INIT_MOTION_PLUS_STATE;
-
727  timer = micros();
-
728 
-
729  if(unknownExtensionConnected) {
-
730 #ifdef DEBUG_USB_HOST
-
731  Notify(PSTR("\r\nA extension is also connected"), 0x80);
-
732 #endif
-
733  activateNunchuck = true; // For we will just set this to true as this the only extension supported so far
-
734  }
-
735 
-
736  } else if(stateCounter == 601) { // We will try three times to check for the motion plus
-
737 #ifdef DEBUG_USB_HOST
-
738  Notify(PSTR("\r\nNo Motion Plus was detected"), 0x80);
-
739 #endif
-
740  stateCounter = 0;
-
741  l2cap_state = WII_CHECK_EXTENSION_STATE;
-
742  }
-
743  break;
-
744 
-
745  case WII_CHECK_EXTENSION_STATE: // This is used to check if there is anything plugged in to the extension port
-
746 #ifdef DEBUG_USB_HOST
-
747  if(stateCounter == 0) // Only print onnce
-
748  Notify(PSTR("\r\nChecking if there is any extension connected"), 0x80);
-
749 #endif
-
750  stateCounter++; // We use this counter as there has to be a short delay between the commands
-
751  if(stateCounter == 1)
-
752  statusRequest(); // See if a new device has connected
-
753  if(stateCounter == 100) {
-
754  if(unknownExtensionConnected) // Check if there is a extension is connected to the port
-
755  initExtension1();
-
756  else
-
757  stateCounter = 399;
-
758  } else if(stateCounter == 200)
-
759  initExtension2();
-
760  else if(stateCounter == 300) {
-
761  readExtensionType();
-
762  unknownExtensionConnected = false;
-
763  } else if(stateCounter == 400) {
-
764  stateCounter = 0;
-
765  l2cap_state = TURN_ON_LED;
-
766  }
-
767  break;
-
768 
-
769  case WII_INIT_MOTION_PLUS_STATE:
-
770  stateCounter++;
-
771  if(stateCounter == 1)
-
772  initMotionPlus();
-
773  else if(stateCounter == 100)
-
774  activateMotionPlus();
-
775  else if(stateCounter == 200)
-
776  readExtensionType(); // Check if it has been activated
-
777  else if(stateCounter == 300) {
-
778  stateCounter = 0;
-
779  unknownExtensionConnected = false; // The motion plus will send a status report when it's activated, we will set this to false so it doesn't reinitialize the Motion Plus
-
780  l2cap_state = TURN_ON_LED;
-
781  }
-
782  break;
-
783 
-
784  case TURN_ON_LED:
-
785  if(wii_check_flag(WII_FLAG_NUNCHUCK_CONNECTED))
-
786  nunchuckConnected = true;
-
787  wiimoteConnected = true;
-
788  onInit();
-
789  l2cap_state = L2CAP_DONE;
-
790  break;
-
791 
-
792  case L2CAP_DONE:
-
793  if(unknownExtensionConnected) {
-
794 #ifdef DEBUG_USB_HOST
-
795  if(stateCounter == 0) // Only print once
-
796  Notify(PSTR("\r\nChecking extension port"), 0x80);
-
797 #endif
-
798  stateCounter++; // We will use this counter as there has to be a short delay between the commands
-
799  if(stateCounter == 50)
-
800  statusRequest();
-
801  else if(stateCounter == 100)
-
802  initExtension1();
-
803  else if(stateCounter == 150)
-
804  if((extensionConnected && motionPlusConnected) || (unknownExtensionConnected && !motionPlusConnected))
-
805  initExtension2();
-
806  else
-
807  stateCounter = 299; // There is no extension connected
-
808  else if(stateCounter == 200)
-
809  readExtensionType();
-
810  else if(stateCounter == 250) {
-
811  if(wii_check_flag(WII_FLAG_NUNCHUCK_CONNECTED)) {
-
812 #ifdef DEBUG_USB_HOST
-
813  Notify(PSTR("\r\nNunchuck was reconnected"), 0x80);
-
814 #endif
-
815  activateNunchuck = true;
-
816  nunchuckConnected = true;
-
817  }
-
818  if(!motionPlusConnected)
-
819  stateCounter = 449;
-
820  } else if(stateCounter == 300) {
-
821  if(motionPlusConnected) {
-
822 #ifdef DEBUG_USB_HOST
-
823  Notify(PSTR("\r\nReactivating the Motion Plus"), 0x80);
-
824 #endif
-
825  initMotionPlus();
-
826  } else
-
827  stateCounter = 449;
-
828  } else if(stateCounter == 350)
-
829  activateMotionPlus();
-
830  else if(stateCounter == 400)
-
831  readExtensionType(); // Check if it has been activated
-
832  else if(stateCounter == 450) {
-
833  onInit();
-
834  stateCounter = 0;
-
835  unknownExtensionConnected = false;
-
836  }
-
837  } else
-
838  stateCounter = 0;
-
839  break;
-
840  }
-
841 }
+
708  pBtd->l2cap_config_request(hci_handle, identifier, control_scid);
+
709  l2cap_state = L2CAP_CONTROL_SUCCESS;
+
710  }
+
711  break;
+
712 
+
713  case WII_CHECK_MOTION_PLUS_STATE:
+
714 #ifdef DEBUG_USB_HOST
+
715  if(stateCounter == 0) // Only print onnce
+
716  Notify(PSTR("\r\nChecking if a Motion Plus is connected"), 0x80);
+
717 #endif
+
718  stateCounter++;
+
719  if(stateCounter % 200 == 0)
+
720  checkMotionPresent(); // Check if there is a motion plus connected
+
721  if(wii_check_flag(WII_FLAG_MOTION_PLUS_CONNECTED)) {
+
722  stateCounter = 0;
+
723  l2cap_state = WII_INIT_MOTION_PLUS_STATE;
+
724  timer = micros();
+
725 
+
726  if(unknownExtensionConnected) {
+
727 #ifdef DEBUG_USB_HOST
+
728  Notify(PSTR("\r\nA extension is also connected"), 0x80);
+
729 #endif
+
730  activateNunchuck = true; // For we will just set this to true as this the only extension supported so far
+
731  }
+
732 
+
733  } else if(stateCounter == 601) { // We will try three times to check for the motion plus
+
734 #ifdef DEBUG_USB_HOST
+
735  Notify(PSTR("\r\nNo Motion Plus was detected"), 0x80);
+
736 #endif
+
737  stateCounter = 0;
+
738  l2cap_state = WII_CHECK_EXTENSION_STATE;
+
739  }
+
740  break;
+
741 
+
742  case WII_CHECK_EXTENSION_STATE: // This is used to check if there is anything plugged in to the extension port
+
743 #ifdef DEBUG_USB_HOST
+
744  if(stateCounter == 0) // Only print onnce
+
745  Notify(PSTR("\r\nChecking if there is any extension connected"), 0x80);
+
746 #endif
+
747  stateCounter++; // We use this counter as there has to be a short delay between the commands
+
748  if(stateCounter == 1)
+
749  statusRequest(); // See if a new device has connected
+
750  if(stateCounter == 100) {
+
751  if(unknownExtensionConnected) // Check if there is a extension is connected to the port
+
752  initExtension1();
+
753  else
+
754  stateCounter = 399;
+
755  } else if(stateCounter == 200)
+
756  initExtension2();
+
757  else if(stateCounter == 300) {
+
758  readExtensionType();
+
759  unknownExtensionConnected = false;
+
760  } else if(stateCounter == 400) {
+
761  stateCounter = 0;
+
762  l2cap_state = TURN_ON_LED;
+
763  }
+
764  break;
+
765 
+
766  case WII_INIT_MOTION_PLUS_STATE:
+
767  stateCounter++;
+
768  if(stateCounter == 1)
+
769  initMotionPlus();
+
770  else if(stateCounter == 100)
+
771  activateMotionPlus();
+
772  else if(stateCounter == 200)
+
773  readExtensionType(); // Check if it has been activated
+
774  else if(stateCounter == 300) {
+
775  stateCounter = 0;
+
776  unknownExtensionConnected = false; // The motion plus will send a status report when it's activated, we will set this to false so it doesn't reinitialize the Motion Plus
+
777  l2cap_state = TURN_ON_LED;
+
778  }
+
779  break;
+
780 
+
781  case TURN_ON_LED:
+
782  if(wii_check_flag(WII_FLAG_NUNCHUCK_CONNECTED))
+
783  nunchuckConnected = true;
+
784  wiimoteConnected = true;
+
785  onInit();
+
786  l2cap_state = L2CAP_DONE;
+
787  break;
+
788 
+
789  case L2CAP_DONE:
+
790  if(unknownExtensionConnected) {
+
791 #ifdef DEBUG_USB_HOST
+
792  if(stateCounter == 0) // Only print once
+
793  Notify(PSTR("\r\nChecking extension port"), 0x80);
+
794 #endif
+
795  stateCounter++; // We will use this counter as there has to be a short delay between the commands
+
796  if(stateCounter == 50)
+
797  statusRequest();
+
798  else if(stateCounter == 100)
+
799  initExtension1();
+
800  else if(stateCounter == 150)
+
801  if((extensionConnected && motionPlusConnected) || (unknownExtensionConnected && !motionPlusConnected))
+
802  initExtension2();
+
803  else
+
804  stateCounter = 299; // There is no extension connected
+
805  else if(stateCounter == 200)
+
806  readExtensionType();
+
807  else if(stateCounter == 250) {
+
808  if(wii_check_flag(WII_FLAG_NUNCHUCK_CONNECTED)) {
+
809 #ifdef DEBUG_USB_HOST
+
810  Notify(PSTR("\r\nNunchuck was reconnected"), 0x80);
+
811 #endif
+
812  activateNunchuck = true;
+
813  nunchuckConnected = true;
+
814  }
+
815  if(!motionPlusConnected)
+
816  stateCounter = 449;
+
817  } else if(stateCounter == 300) {
+
818  if(motionPlusConnected) {
+
819 #ifdef DEBUG_USB_HOST
+
820  Notify(PSTR("\r\nReactivating the Motion Plus"), 0x80);
+
821 #endif
+
822  initMotionPlus();
+
823  } else
+
824  stateCounter = 449;
+
825  } else if(stateCounter == 350)
+
826  activateMotionPlus();
+
827  else if(stateCounter == 400)
+
828  readExtensionType(); // Check if it has been activated
+
829  else if(stateCounter == 450) {
+
830  onInit();
+
831  stateCounter = 0;
+
832  unknownExtensionConnected = false;
+
833  }
+
834  } else
+
835  stateCounter = 0;
+
836  break;
+
837  }
+
838 }
+
839 
+
840 /************************************************************/
+
841 /* HID Commands */
842 
843 /************************************************************/
-
844 /* HID Commands */
-
845 
-
846 /************************************************************/
-
847 void WII::HID_Command(uint8_t* data, uint8_t nbytes) {
-
848  if(motionPlusInside)
-
849  pBtd->L2CAP_Command(hci_handle, data, nbytes, interrupt_scid[0], interrupt_scid[1]); // It's the new Wiimote with the Motion Plus Inside or Wii U Pro controller
-
850  else
-
851  pBtd->L2CAP_Command(hci_handle, data, nbytes, control_scid[0], control_scid[1]);
-
852 }
-
853 
-
854 void WII::setAllOff() {
-
855  HIDBuffer[1] = 0x11;
-
856  HIDBuffer[2] = 0x00;
-
857  HID_Command(HIDBuffer, 3);
-
858 }
-
859 
-
860 void WII::setRumbleOff() {
-
861  HIDBuffer[1] = 0x11;
-
862  HIDBuffer[2] &= ~0x01; // Bit 0 control the rumble
-
863  HID_Command(HIDBuffer, 3);
-
864 }
-
865 
-
866 void WII::setRumbleOn() {
-
867  HIDBuffer[1] = 0x11;
-
868  HIDBuffer[2] |= 0x01; // Bit 0 control the rumble
-
869  HID_Command(HIDBuffer, 3);
-
870 }
-
871 
-
872 void WII::setRumbleToggle() {
-
873  HIDBuffer[1] = 0x11;
-
874  HIDBuffer[2] ^= 0x01; // Bit 0 control the rumble
-
875  HID_Command(HIDBuffer, 3);
-
876 }
-
877 
-
878 void WII::setLedRaw(uint8_t value) {
-
879  HIDBuffer[1] = 0x11;
-
880  HIDBuffer[2] = value | (HIDBuffer[2] & 0x01); // Keep the rumble bit
-
881  HID_Command(HIDBuffer, 3);
-
882 }
-
883 
-
884 void WII::setLedOff(LEDEnum a) {
-
885  HIDBuffer[1] = 0x11;
-
886  HIDBuffer[2] &= ~(pgm_read_byte(&WII_LEDS[(uint8_t)a]));
-
887  HID_Command(HIDBuffer, 3);
-
888 }
-
889 
-
890 void WII::setLedOn(LEDEnum a) {
-
891  if(a == OFF)
-
892  setLedRaw(0);
-
893  else {
-
894  HIDBuffer[1] = 0x11;
-
895  HIDBuffer[2] |= pgm_read_byte(&WII_LEDS[(uint8_t)a]);
-
896  HID_Command(HIDBuffer, 3);
-
897  }
-
898 }
-
899 
-
900 void WII::setLedToggle(LEDEnum a) {
-
901  HIDBuffer[1] = 0x11;
-
902  HIDBuffer[2] ^= pgm_read_byte(&WII_LEDS[(uint8_t)a]);
-
903  HID_Command(HIDBuffer, 3);
-
904 }
-
905 
-
906 void WII::setLedStatus() {
-
907  HIDBuffer[1] = 0x11;
-
908  HIDBuffer[2] = (HIDBuffer[2] & 0x01); // Keep the rumble bit
-
909  if(wiimoteConnected)
-
910  HIDBuffer[2] |= 0x10; // If it's connected LED1 will light up
-
911  if(motionPlusConnected)
-
912  HIDBuffer[2] |= 0x20; // If it's connected LED2 will light up
-
913  if(nunchuckConnected)
-
914  HIDBuffer[2] |= 0x40; // If it's connected LED3 will light up
+
844 void WII::HID_Command(uint8_t* data, uint8_t nbytes) {
+
845  if(motionPlusInside)
+
846  pBtd->L2CAP_Command(hci_handle, data, nbytes, interrupt_scid[0], interrupt_scid[1]); // It's the new Wiimote with the Motion Plus Inside or Wii U Pro controller
+
847  else
+
848  pBtd->L2CAP_Command(hci_handle, data, nbytes, control_scid[0], control_scid[1]);
+
849 }
+
850 
+
851 void WII::setAllOff() {
+
852  HIDBuffer[1] = 0x11;
+
853  HIDBuffer[2] = 0x00;
+
854  HID_Command(HIDBuffer, 3);
+
855 }
+
856 
+
857 void WII::setRumbleOff() {
+
858  HIDBuffer[1] = 0x11;
+
859  HIDBuffer[2] &= ~0x01; // Bit 0 control the rumble
+
860  HID_Command(HIDBuffer, 3);
+
861 }
+
862 
+
863 void WII::setRumbleOn() {
+
864  HIDBuffer[1] = 0x11;
+
865  HIDBuffer[2] |= 0x01; // Bit 0 control the rumble
+
866  HID_Command(HIDBuffer, 3);
+
867 }
+
868 
+
869 void WII::setRumbleToggle() {
+
870  HIDBuffer[1] = 0x11;
+
871  HIDBuffer[2] ^= 0x01; // Bit 0 control the rumble
+
872  HID_Command(HIDBuffer, 3);
+
873 }
+
874 
+
875 void WII::setLedRaw(uint8_t value) {
+
876  HIDBuffer[1] = 0x11;
+
877  HIDBuffer[2] = value | (HIDBuffer[2] & 0x01); // Keep the rumble bit
+
878  HID_Command(HIDBuffer, 3);
+
879 }
+
880 
+
881 void WII::setLedOff(LEDEnum a) {
+
882  HIDBuffer[1] = 0x11;
+
883  HIDBuffer[2] &= ~(pgm_read_byte(&WII_LEDS[(uint8_t)a]));
+
884  HID_Command(HIDBuffer, 3);
+
885 }
+
886 
+
887 void WII::setLedOn(LEDEnum a) {
+
888  if(a == OFF)
+
889  setLedRaw(0);
+
890  else {
+
891  HIDBuffer[1] = 0x11;
+
892  HIDBuffer[2] |= pgm_read_byte(&WII_LEDS[(uint8_t)a]);
+
893  HID_Command(HIDBuffer, 3);
+
894  }
+
895 }
+
896 
+
897 void WII::setLedToggle(LEDEnum a) {
+
898  HIDBuffer[1] = 0x11;
+
899  HIDBuffer[2] ^= pgm_read_byte(&WII_LEDS[(uint8_t)a]);
+
900  HID_Command(HIDBuffer, 3);
+
901 }
+
902 
+
903 void WII::setLedStatus() {
+
904  HIDBuffer[1] = 0x11;
+
905  HIDBuffer[2] = (HIDBuffer[2] & 0x01); // Keep the rumble bit
+
906  if(wiimoteConnected)
+
907  HIDBuffer[2] |= 0x10; // If it's connected LED1 will light up
+
908  if(motionPlusConnected)
+
909  HIDBuffer[2] |= 0x20; // If it's connected LED2 will light up
+
910  if(nunchuckConnected)
+
911  HIDBuffer[2] |= 0x40; // If it's connected LED3 will light up
+
912 
+
913  HID_Command(HIDBuffer, 3);
+
914 }
915 
-
916  HID_Command(HIDBuffer, 3);
-
917 }
-
918 
-
919 uint8_t WII::getBatteryLevel() {
-
920  checkExtension = false; // This is needed so the library knows that the status response is a response to this function
-
921  statusRequest(); // This will update the battery level
-
922  return batteryLevel;
-
923 };
-
924 
-
925 void WII::setReportMode(bool continuous, uint8_t mode) {
-
926  uint8_t cmd_buf[4];
-
927  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
-
928  cmd_buf[1] = 0x12;
-
929  if(continuous)
-
930  cmd_buf[2] = 0x04 | (HIDBuffer[2] & 0x01); // Keep the rumble bit
-
931  else
-
932  cmd_buf[2] = 0x00 | (HIDBuffer[2] & 0x01); // Keep the rumble bit
-
933  cmd_buf[3] = mode;
-
934  HID_Command(cmd_buf, 4);
-
935 }
-
936 
-
937 void WII::statusRequest() {
-
938  uint8_t cmd_buf[3];
-
939  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
-
940  cmd_buf[1] = 0x15;
-
941  cmd_buf[2] = (HIDBuffer[2] & 0x01); // Keep the rumble bit
-
942  HID_Command(cmd_buf, 3);
-
943 }
+
916 uint8_t WII::getBatteryLevel() {
+
917  checkExtension = false; // This is needed so the library knows that the status response is a response to this function
+
918  statusRequest(); // This will update the battery level
+
919  return batteryLevel;
+
920 };
+
921 
+
922 void WII::setReportMode(bool continuous, uint8_t mode) {
+
923  uint8_t cmd_buf[4];
+
924  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
+
925  cmd_buf[1] = 0x12;
+
926  if(continuous)
+
927  cmd_buf[2] = 0x04 | (HIDBuffer[2] & 0x01); // Keep the rumble bit
+
928  else
+
929  cmd_buf[2] = 0x00 | (HIDBuffer[2] & 0x01); // Keep the rumble bit
+
930  cmd_buf[3] = mode;
+
931  HID_Command(cmd_buf, 4);
+
932 }
+
933 
+
934 void WII::statusRequest() {
+
935  uint8_t cmd_buf[3];
+
936  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
+
937  cmd_buf[1] = 0x15;
+
938  cmd_buf[2] = (HIDBuffer[2] & 0x01); // Keep the rumble bit
+
939  HID_Command(cmd_buf, 3);
+
940 }
+
941 
+
942 /************************************************************/
+
943 /* Memmory Commands */
944 
945 /************************************************************/
-
946 /* Memmory Commands */
-
947 
-
948 /************************************************************/
-
949 void WII::writeData(uint32_t offset, uint8_t size, uint8_t* data) {
-
950  uint8_t cmd_buf[23];
-
951  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
-
952  cmd_buf[1] = 0x16; // Write data
-
953  cmd_buf[2] = 0x04 | (HIDBuffer[2] & 0x01); // Write to memory, clear bit 2 to write to EEPROM
-
954  cmd_buf[3] = (uint8_t)((offset & 0xFF0000) >> 16);
-
955  cmd_buf[4] = (uint8_t)((offset & 0xFF00) >> 8);
-
956  cmd_buf[5] = (uint8_t)(offset & 0xFF);
-
957  cmd_buf[6] = size;
-
958  uint8_t i = 0;
-
959  for(; i < size; i++)
-
960  cmd_buf[7 + i] = data[i];
-
961  for(; i < 16; i++) // Set the rest to zero
-
962  cmd_buf[7 + i] = 0x00;
-
963  HID_Command(cmd_buf, 23);
-
964 }
-
965 
-
966 void WII::initExtension1() {
-
967  uint8_t buf[1];
-
968  buf[0] = 0x55;
-
969  writeData(0xA400F0, 1, buf);
-
970 }
-
971 
-
972 void WII::initExtension2() {
-
973  uint8_t buf[1];
-
974  buf[0] = 0x00;
-
975  writeData(0xA400FB, 1, buf);
-
976 }
-
977 
-
978 void WII::initMotionPlus() {
-
979  uint8_t buf[1];
-
980  buf[0] = 0x55;
-
981  writeData(0xA600F0, 1, buf);
-
982 }
-
983 
-
984 void WII::activateMotionPlus() {
-
985  uint8_t buf[1];
-
986  if(pBtd->wiiUProController) {
-
987 #ifdef DEBUG_USB_HOST
-
988  Notify(PSTR("\r\nActivating Wii U Pro Controller"), 0x80);
-
989 #endif
-
990  buf[0] = 0x00; // It seems like you can send anything but 0x04, 0x05, and 0x07
-
991  } else if(activateNunchuck) {
-
992 #ifdef DEBUG_USB_HOST
-
993  Notify(PSTR("\r\nActivating Motion Plus in pass-through mode"), 0x80);
-
994 #endif
-
995  buf[0] = 0x05; // Activate nunchuck pass-through mode
-
996  }//else if(classicControllerConnected && extensionConnected)
-
997  //buf[0] = 0x07;
-
998  else {
-
999 #ifdef DEBUG_USB_HOST
-
1000  Notify(PSTR("\r\nActivating Motion Plus in normal mode"), 0x80);
-
1001 #endif
-
1002  buf[0] = 0x04; // Don't use any extension
-
1003  }
-
1004  writeData(0xA600FE, 1, buf);
-
1005 }
-
1006 
-
1007 void WII::readData(uint32_t offset, uint16_t size, bool EEPROM) {
-
1008  uint8_t cmd_buf[8];
-
1009  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
-
1010  cmd_buf[1] = 0x17; // Read data
-
1011  if(EEPROM)
-
1012  cmd_buf[2] = 0x00 | (HIDBuffer[2] & 0x01); // Read from EEPROM
-
1013  else
-
1014  cmd_buf[2] = 0x04 | (HIDBuffer[2] & 0x01); // Read from memory
-
1015  cmd_buf[3] = (uint8_t)((offset & 0xFF0000) >> 16);
-
1016  cmd_buf[4] = (uint8_t)((offset & 0xFF00) >> 8);
-
1017  cmd_buf[5] = (uint8_t)(offset & 0xFF);
-
1018  cmd_buf[6] = (uint8_t)((size & 0xFF00) >> 8);
-
1019  cmd_buf[7] = (uint8_t)(size & 0xFF);
+
946 void WII::writeData(uint32_t offset, uint8_t size, uint8_t* data) {
+
947  uint8_t cmd_buf[23];
+
948  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
+
949  cmd_buf[1] = 0x16; // Write data
+
950  cmd_buf[2] = 0x04 | (HIDBuffer[2] & 0x01); // Write to memory, clear bit 2 to write to EEPROM
+
951  cmd_buf[3] = (uint8_t)((offset & 0xFF0000) >> 16);
+
952  cmd_buf[4] = (uint8_t)((offset & 0xFF00) >> 8);
+
953  cmd_buf[5] = (uint8_t)(offset & 0xFF);
+
954  cmd_buf[6] = size;
+
955  uint8_t i = 0;
+
956  for(; i < size; i++)
+
957  cmd_buf[7 + i] = data[i];
+
958  for(; i < 16; i++) // Set the rest to zero
+
959  cmd_buf[7 + i] = 0x00;
+
960  HID_Command(cmd_buf, 23);
+
961 }
+
962 
+
963 void WII::initExtension1() {
+
964  uint8_t buf[1];
+
965  buf[0] = 0x55;
+
966  writeData(0xA400F0, 1, buf);
+
967 }
+
968 
+
969 void WII::initExtension2() {
+
970  uint8_t buf[1];
+
971  buf[0] = 0x00;
+
972  writeData(0xA400FB, 1, buf);
+
973 }
+
974 
+
975 void WII::initMotionPlus() {
+
976  uint8_t buf[1];
+
977  buf[0] = 0x55;
+
978  writeData(0xA600F0, 1, buf);
+
979 }
+
980 
+
981 void WII::activateMotionPlus() {
+
982  uint8_t buf[1];
+
983  if(pBtd->wiiUProController) {
+
984 #ifdef DEBUG_USB_HOST
+
985  Notify(PSTR("\r\nActivating Wii U Pro Controller"), 0x80);
+
986 #endif
+
987  buf[0] = 0x00; // It seems like you can send anything but 0x04, 0x05, and 0x07
+
988  } else if(activateNunchuck) {
+
989 #ifdef DEBUG_USB_HOST
+
990  Notify(PSTR("\r\nActivating Motion Plus in pass-through mode"), 0x80);
+
991 #endif
+
992  buf[0] = 0x05; // Activate nunchuck pass-through mode
+
993  }//else if(classicControllerConnected && extensionConnected)
+
994  //buf[0] = 0x07;
+
995  else {
+
996 #ifdef DEBUG_USB_HOST
+
997  Notify(PSTR("\r\nActivating Motion Plus in normal mode"), 0x80);
+
998 #endif
+
999  buf[0] = 0x04; // Don't use any extension
+
1000  }
+
1001  writeData(0xA600FE, 1, buf);
+
1002 }
+
1003 
+
1004 void WII::readData(uint32_t offset, uint16_t size, bool EEPROM) {
+
1005  uint8_t cmd_buf[8];
+
1006  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
+
1007  cmd_buf[1] = 0x17; // Read data
+
1008  if(EEPROM)
+
1009  cmd_buf[2] = 0x00 | (HIDBuffer[2] & 0x01); // Read from EEPROM
+
1010  else
+
1011  cmd_buf[2] = 0x04 | (HIDBuffer[2] & 0x01); // Read from memory
+
1012  cmd_buf[3] = (uint8_t)((offset & 0xFF0000) >> 16);
+
1013  cmd_buf[4] = (uint8_t)((offset & 0xFF00) >> 8);
+
1014  cmd_buf[5] = (uint8_t)(offset & 0xFF);
+
1015  cmd_buf[6] = (uint8_t)((size & 0xFF00) >> 8);
+
1016  cmd_buf[7] = (uint8_t)(size & 0xFF);
+
1017 
+
1018  HID_Command(cmd_buf, 8);
+
1019 }
1020 
-
1021  HID_Command(cmd_buf, 8);
-
1022 }
-
1023 
-
1024 void WII::readExtensionType() {
-
1025  readData(0xA400FA, 6, false);
-
1026 }
-
1027 
-
1028 void WII::readCalData() {
-
1029  readData(0x0016, 8, true);
-
1030 }
-
1031 
-
1032 void WII::checkMotionPresent() {
-
1033  readData(0xA600FA, 6, false);
-
1034 }
+
1021 void WII::readExtensionType() {
+
1022  readData(0xA400FA, 6, false);
+
1023 }
+
1024 
+
1025 void WII::readCalData() {
+
1026  readData(0x0016, 8, true);
+
1027 }
+
1028 
+
1029 void WII::checkMotionPresent() {
+
1030  readData(0xA600FA, 6, false);
+
1031 }
+
1032 
+
1033 /************************************************************/
+
1034 /* WII Commands */
1035 
1036 /************************************************************/
-
1037 /* WII Commands */
-
1038 
-
1039 /************************************************************/
-
1040 
-
1041 bool WII::getButtonPress(ButtonEnum b) { // Return true when a button is pressed
-
1042  if(wiiUProControllerConnected)
-
1043  return (ButtonState & pgm_read_dword(&WII_PROCONTROLLER_BUTTONS[(uint8_t)b]));
-
1044  else
-
1045  return (ButtonState & pgm_read_dword(&WII_BUTTONS[(uint8_t)b]));
-
1046 }
-
1047 
-
1048 bool WII::getButtonClick(ButtonEnum b) { // Only return true when a button is clicked
-
1049  uint32_t button;
-
1050  if(wiiUProControllerConnected)
-
1051  button = pgm_read_dword(&WII_PROCONTROLLER_BUTTONS[(uint8_t)b]);
-
1052  else
-
1053  button = pgm_read_dword(&WII_BUTTONS[(uint8_t)b]);
-
1054  bool click = (ButtonClickState & button);
-
1055  ButtonClickState &= ~button; // clear "click" event
-
1056  return click;
-
1057 }
-
1058 
-
1059 uint8_t WII::getAnalogHat(HatEnum a) {
-
1060  if(!nunchuckConnected)
-
1061  return 127; // Return center position
-
1062  else {
-
1063  uint8_t output = hatValues[(uint8_t)a];
-
1064  if(output == 0xFF || output == 0x00) // The joystick will only read 255 or 0 when the cable is unplugged or initializing, so we will just return the center position
-
1065  return 127;
-
1066  else
-
1067  return output;
-
1068  }
-
1069 }
-
1070 
-
1071 uint16_t WII::getAnalogHat(AnalogHatEnum a) {
-
1072  if(!wiiUProControllerConnected)
-
1073  return 2000;
-
1074  else {
-
1075  uint16_t output = hatValues[(uint8_t)a];
-
1076  if(output == 0x00) // The joystick will only read 0 when it is first initializing, so we will just return the center position
-
1077  return 2000;
-
1078  else
-
1079  return output;
-
1080  }
-
1081 }
-
1082 
-
1083 void WII::onInit() {
-
1084  if(pFuncOnInit)
-
1085  pFuncOnInit(); // Call the user function
-
1086  else
-
1087  setLedStatus();
-
1088 }
-
1089 
-
1090 /************************************************************/
-
1091 /* The following functions are for the IR camera */
-
1092 /************************************************************/
-
1093 
-
1094 #ifdef WIICAMERA
-
1095 
-
1096 void WII::IRinitialize() { // Turns on and initialises the IR camera
-
1097 
-
1098  enableIRCamera1();
-
1099 #ifdef DEBUG_USB_HOST
-
1100  Notify(PSTR("\r\nEnable IR Camera1 Complete"), 0x80);
-
1101 #endif
-
1102  delay(80);
-
1103 
-
1104  enableIRCamera2();
-
1105 #ifdef DEBUG_USB_HOST
-
1106  Notify(PSTR("\r\nEnable IR Camera2 Complete"), 0x80);
-
1107 #endif
-
1108  delay(80);
-
1109 
-
1110  write0x08Value();
-
1111 #ifdef DEBUG_USB_HOST
-
1112  Notify(PSTR("\r\nWrote hex number 0x08"), 0x80);
-
1113 #endif
-
1114  delay(80);
-
1115 
-
1116  writeSensitivityBlock1();
-
1117 #ifdef DEBUG_USB_HOST
-
1118  Notify(PSTR("\r\nWrote Sensitivity Block 1"), 0x80);
-
1119 #endif
-
1120  delay(80);
-
1121 
-
1122  writeSensitivityBlock2();
-
1123 #ifdef DEBUG_USB_HOST
-
1124  Notify(PSTR("\r\nWrote Sensitivity Block 2"), 0x80);
-
1125 #endif
-
1126  delay(80);
-
1127 
-
1128  uint8_t mode_num = 0x03;
-
1129  setWiiModeNumber(mode_num); // Change input for whatever mode you want i.e. 0x01, 0x03, or 0x05
-
1130 #ifdef DEBUG_USB_HOST
-
1131  Notify(PSTR("\r\nSet Wii Mode Number To 0x"), 0x80);
-
1132  D_PrintHex<uint8_t > (mode_num, 0x80);
-
1133 #endif
-
1134  delay(80);
-
1135 
-
1136  write0x08Value();
-
1137 #ifdef DEBUG_USB_HOST
-
1138  Notify(PSTR("\r\nWrote Hex Number 0x08"), 0x80);
-
1139 #endif
-
1140  delay(80);
-
1141 
-
1142  setReportMode(false, 0x33);
-
1143  //setReportMode(false, 0x3f); // For full reporting mode, doesn't work yet
-
1144 #ifdef DEBUG_USB_HOST
-
1145  Notify(PSTR("\r\nSet Report Mode to 0x33"), 0x80);
-
1146 #endif
-
1147  delay(80);
-
1148 
-
1149  statusRequest(); // Used to update wiiState - call isIRCameraEnabled() afterwards to check if it actually worked
-
1150 #ifdef DEBUG_USB_HOST
-
1151  Notify(PSTR("\r\nIR Initialized"), 0x80);
-
1152 #endif
-
1153 }
-
1154 
-
1155 void WII::enableIRCamera1() {
-
1156  uint8_t cmd_buf[3];
-
1157  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
-
1158  cmd_buf[1] = 0x13; // Output report 13
-
1159  cmd_buf[2] = 0x04 | (HIDBuffer[2] & 0x01); // Keep the rumble bit and sets bit 2
-
1160  HID_Command(cmd_buf, 3);
-
1161 }
-
1162 
-
1163 void WII::enableIRCamera2() {
-
1164  uint8_t cmd_buf[3];
-
1165  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
-
1166  cmd_buf[1] = 0x1A; // Output report 1A
-
1167  cmd_buf[2] = 0x04 | (HIDBuffer[2] & 0x01); // Keep the rumble bit and sets bit 2
-
1168  HID_Command(cmd_buf, 3);
-
1169 }
-
1170 
-
1171 void WII::writeSensitivityBlock1() {
-
1172  uint8_t buf[9];
-
1173  buf[0] = 0x00;
-
1174  buf[1] = 0x00;
-
1175  buf[2] = 0x00;
-
1176  buf[3] = 0x00;
-
1177  buf[4] = 0x00;
-
1178  buf[5] = 0x00;
-
1179  buf[6] = 0x90;
-
1180  buf[7] = 0x00;
-
1181  buf[8] = 0x41;
+
1037 
+
1038 bool WII::getButtonPress(ButtonEnum b) { // Return true when a button is pressed
+
1039  if(wiiUProControllerConnected)
+
1040  return (ButtonState & pgm_read_dword(&WII_PROCONTROLLER_BUTTONS[(uint8_t)b]));
+
1041  else
+
1042  return (ButtonState & pgm_read_dword(&WII_BUTTONS[(uint8_t)b]));
+
1043 }
+
1044 
+
1045 bool WII::getButtonClick(ButtonEnum b) { // Only return true when a button is clicked
+
1046  uint32_t button;
+
1047  if(wiiUProControllerConnected)
+
1048  button = pgm_read_dword(&WII_PROCONTROLLER_BUTTONS[(uint8_t)b]);
+
1049  else
+
1050  button = pgm_read_dword(&WII_BUTTONS[(uint8_t)b]);
+
1051  bool click = (ButtonClickState & button);
+
1052  ButtonClickState &= ~button; // clear "click" event
+
1053  return click;
+
1054 }
+
1055 
+
1056 uint8_t WII::getAnalogHat(HatEnum a) {
+
1057  if(!nunchuckConnected)
+
1058  return 127; // Return center position
+
1059  else {
+
1060  uint8_t output = hatValues[(uint8_t)a];
+
1061  if(output == 0xFF || output == 0x00) // The joystick will only read 255 or 0 when the cable is unplugged or initializing, so we will just return the center position
+
1062  return 127;
+
1063  else
+
1064  return output;
+
1065  }
+
1066 }
+
1067 
+
1068 uint16_t WII::getAnalogHat(AnalogHatEnum a) {
+
1069  if(!wiiUProControllerConnected)
+
1070  return 2000;
+
1071  else {
+
1072  uint16_t output = hatValues[(uint8_t)a];
+
1073  if(output == 0x00) // The joystick will only read 0 when it is first initializing, so we will just return the center position
+
1074  return 2000;
+
1075  else
+
1076  return output;
+
1077  }
+
1078 }
+
1079 
+
1080 void WII::onInit() {
+
1081  if(pFuncOnInit)
+
1082  pFuncOnInit(); // Call the user function
+
1083  else
+
1084  setLedStatus();
+
1085 }
+
1086 
+
1087 /************************************************************/
+
1088 /* The following functions are for the IR camera */
+
1089 /************************************************************/
+
1090 
+
1091 #ifdef WIICAMERA
+
1092 
+
1093 void WII::IRinitialize() { // Turns on and initialises the IR camera
+
1094 
+
1095  enableIRCamera1();
+
1096 #ifdef DEBUG_USB_HOST
+
1097  Notify(PSTR("\r\nEnable IR Camera1 Complete"), 0x80);
+
1098 #endif
+
1099  delay(80);
+
1100 
+
1101  enableIRCamera2();
+
1102 #ifdef DEBUG_USB_HOST
+
1103  Notify(PSTR("\r\nEnable IR Camera2 Complete"), 0x80);
+
1104 #endif
+
1105  delay(80);
+
1106 
+
1107  write0x08Value();
+
1108 #ifdef DEBUG_USB_HOST
+
1109  Notify(PSTR("\r\nWrote hex number 0x08"), 0x80);
+
1110 #endif
+
1111  delay(80);
+
1112 
+
1113  writeSensitivityBlock1();
+
1114 #ifdef DEBUG_USB_HOST
+
1115  Notify(PSTR("\r\nWrote Sensitivity Block 1"), 0x80);
+
1116 #endif
+
1117  delay(80);
+
1118 
+
1119  writeSensitivityBlock2();
+
1120 #ifdef DEBUG_USB_HOST
+
1121  Notify(PSTR("\r\nWrote Sensitivity Block 2"), 0x80);
+
1122 #endif
+
1123  delay(80);
+
1124 
+
1125  uint8_t mode_num = 0x03;
+
1126  setWiiModeNumber(mode_num); // Change input for whatever mode you want i.e. 0x01, 0x03, or 0x05
+
1127 #ifdef DEBUG_USB_HOST
+
1128  Notify(PSTR("\r\nSet Wii Mode Number To 0x"), 0x80);
+
1129  D_PrintHex<uint8_t > (mode_num, 0x80);
+
1130 #endif
+
1131  delay(80);
+
1132 
+
1133  write0x08Value();
+
1134 #ifdef DEBUG_USB_HOST
+
1135  Notify(PSTR("\r\nWrote Hex Number 0x08"), 0x80);
+
1136 #endif
+
1137  delay(80);
+
1138 
+
1139  setReportMode(false, 0x33);
+
1140  //setReportMode(false, 0x3f); // For full reporting mode, doesn't work yet
+
1141 #ifdef DEBUG_USB_HOST
+
1142  Notify(PSTR("\r\nSet Report Mode to 0x33"), 0x80);
+
1143 #endif
+
1144  delay(80);
+
1145 
+
1146  statusRequest(); // Used to update wiiState - call isIRCameraEnabled() afterwards to check if it actually worked
+
1147 #ifdef DEBUG_USB_HOST
+
1148  Notify(PSTR("\r\nIR Initialized"), 0x80);
+
1149 #endif
+
1150 }
+
1151 
+
1152 void WII::enableIRCamera1() {
+
1153  uint8_t cmd_buf[3];
+
1154  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
+
1155  cmd_buf[1] = 0x13; // Output report 13
+
1156  cmd_buf[2] = 0x04 | (HIDBuffer[2] & 0x01); // Keep the rumble bit and sets bit 2
+
1157  HID_Command(cmd_buf, 3);
+
1158 }
+
1159 
+
1160 void WII::enableIRCamera2() {
+
1161  uint8_t cmd_buf[3];
+
1162  cmd_buf[0] = 0xA2; // HID BT DATA_request (0xA0) | Report Type (Output 0x02)
+
1163  cmd_buf[1] = 0x1A; // Output report 1A
+
1164  cmd_buf[2] = 0x04 | (HIDBuffer[2] & 0x01); // Keep the rumble bit and sets bit 2
+
1165  HID_Command(cmd_buf, 3);
+
1166 }
+
1167 
+
1168 void WII::writeSensitivityBlock1() {
+
1169  uint8_t buf[9];
+
1170  buf[0] = 0x00;
+
1171  buf[1] = 0x00;
+
1172  buf[2] = 0x00;
+
1173  buf[3] = 0x00;
+
1174  buf[4] = 0x00;
+
1175  buf[5] = 0x00;
+
1176  buf[6] = 0x90;
+
1177  buf[7] = 0x00;
+
1178  buf[8] = 0x41;
+
1179 
+
1180  writeData(0xB00000, 9, buf);
+
1181 }
1182 
-
1183  writeData(0xB00000, 9, buf);
-
1184 }
-
1185 
-
1186 void WII::writeSensitivityBlock2() {
-
1187  uint8_t buf[2];
-
1188  buf[0] = 0x40;
-
1189  buf[1] = 0x00;
+
1183 void WII::writeSensitivityBlock2() {
+
1184  uint8_t buf[2];
+
1185  buf[0] = 0x40;
+
1186  buf[1] = 0x00;
+
1187 
+
1188  writeData(0xB0001A, 2, buf);
+
1189 }
1190 
-
1191  writeData(0xB0001A, 2, buf);
-
1192 }
-
1193 
-
1194 void WII::write0x08Value() {
-
1195  uint8_t cmd = 0x08;
-
1196  writeData(0xb00030, 1, &cmd);
-
1197 }
-
1198 
-
1199 void WII::setWiiModeNumber(uint8_t mode_number) { // mode_number in hex i.e. 0x03 for extended mode
-
1200  writeData(0xb00033, 1, &mode_number);
-
1201 }
-
1202 #endif
-
bool wiimoteConnected
Definition: Wii.h:199
-
#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE
Definition: BTD.h:139
-
bool incomingWii
Definition: BTD.h:507
-
#define UHS_ACL_HANDLE_OK(x, y)
Definition: BTD.h:207
+
1191 void WII::write0x08Value() {
+
1192  uint8_t cmd = 0x08;
+
1193  writeData(0xb00030, 1, &cmd);
+
1194 }
+
1195 
+
1196 void WII::setWiiModeNumber(uint8_t mode_number) { // mode_number in hex i.e. 0x03 for extended mode
+
1197  writeData(0xb00033, 1, &mode_number);
+
1198 }
+
1199 #endif
+
bool wiimoteConnected
Definition: Wii.h:182
+
#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE
Definition: BTD.h:137
+
bool incomingWii
Definition: BTD.h:471
+
void onInit()
Definition: Wii.cpp:1080
-
int16_t gyroPitchRaw
Definition: Wii.h:271
+
int16_t gyroPitchRaw
Definition: Wii.h:254
+
#define pgm_read_dword(addr)
#define wii_clear_flag(flag)
Definition: Wii.h:32
-
#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS
Definition: BTD.h:143
-
#define L2CAP_INTERRUPT_CONFIG_REQUEST
Definition: BTD.h:115
-
#define L2CAP_INTERRUPT_SETUP
Definition: BTD.h:113
-
uint16_t rollGyroScale
Definition: Wii.h:263
-
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1231
-
#define SUCCESSFUL
Definition: BTD.h:177
-
void l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)
Definition: BTD.cpp:1218
-
#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST
Definition: BTD.h:142
-
void setLedToggle(LEDEnum a)
Definition: Wii.cpp:900
-
void setLedRaw(uint8_t value)
Definition: Wii.cpp:878
-
uint8_t getAnalogHat(HatEnum a)
Definition: Wii.cpp:1059
-
uint16_t yawGyroScale
Definition: Wii.h:264
+
#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS
Definition: BTD.h:141
+
#define L2CAP_INTERRUPT_CONFIG_REQUEST
Definition: BTD.h:113
+
#define L2CAP_INTERRUPT_SETUP
Definition: BTD.h:111
+
uint16_t rollGyroScale
Definition: Wii.h:246
+
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
Definition: BTD.cpp:1239
+
#define SUCCESSFUL
Definition: BTD.h:175
+
void l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)
Definition: BTD.cpp:1226
+
#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST
Definition: BTD.h:140
+
void setLedToggle(LEDEnum a)
Definition: Wii.cpp:897
+
void setLedRaw(uint8_t value)
Definition: Wii.cpp:875
+
uint8_t getAnalogHat(HatEnum a)
Definition: Wii.cpp:1056
+
uint16_t yawGyroScale
Definition: Wii.h:247
Definition: Wii.h:39
-
Definition: BTD.h:230
+
Definition: BTD.h:198
#define WII_FLAG_NUNCHUCK_CONNECTED
Definition: Wii.h:28
-
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1284
-
virtual void ACLData(uint8_t *ACLData)
Definition: Wii.cpp:135
-
bool pairWithWii
Definition: BTD.h:509
-
double gyroRoll
Definition: Wii.h:249
-
void setRumbleOn()
Definition: Wii.cpp:866
-
virtual void Reset()
Definition: Wii.cpp:104
+
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1292
+
void ACLData(uint8_t *ACLData)
Definition: Wii.cpp:132
+
bool pairWithWii
Definition: BTD.h:473
+
uint8_t identifier
Definition: BTD.h:615
+
double gyroRoll
Definition: Wii.h:232
+
void setRumbleOn()
Definition: Wii.cpp:863
+
void Reset()
Definition: Wii.cpp:101
AnalogHatEnum
-
#define TURN_ON_LED
Definition: BTD.h:129
-
int16_t accZnunchuck
Definition: Wii.h:242
-
uint8_t getBatteryLevel()
Definition: Wii.cpp:919
-
virtual void disconnect()
Definition: Wii.cpp:118
-
bool motionPlusInside
Definition: BTD.h:511
-
#define L2CAP_DONE
Definition: BTD.h:104
+
#define TURN_ON_LED
Definition: BTD.h:127
+
int16_t accZnunchuck
Definition: Wii.h:225
+
uint8_t getBatteryLevel()
Definition: Wii.cpp:916
+
void disconnect()
Definition: Wii.cpp:115
+
bool motionPlusInside
Definition: BTD.h:475
+
#define L2CAP_DONE
Definition: BTD.h:102
#define wii_set_flag(flag)
Definition: Wii.h:31
-
#define L2CAP_CONTROL_SUCCESS
Definition: BTD.h:109
-
#define L2CAP_WAIT
Definition: BTD.h:103
-
int16_t accXnunchuck
Definition: Wii.h:242
-
#define L2CAP_CONTROL_CONFIG_REQUEST
Definition: BTD.h:108
-
int16_t gyroRollRaw
Definition: Wii.h:270
+
#define L2CAP_CONTROL_SUCCESS
Definition: BTD.h:107
+
#define L2CAP_WAIT
Definition: BTD.h:101
+
int16_t accXnunchuck
Definition: Wii.h:225
+
#define pgm_read_byte(addr)
+
#define L2CAP_CONTROL_CONFIG_REQUEST
Definition: BTD.h:106
+
int16_t gyroRollRaw
Definition: Wii.h:253
LEDEnum
-
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1297
-
void IRinitialize()
Definition: Wii.cpp:1096
+
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
Definition: BTD.cpp:1305
+
void IRinitialize()
Definition: Wii.cpp:1093
Definition: Wii.h:37
#define Notify(...)
Definition: message.h:44
-
void setRumbleToggle()
Definition: Wii.cpp:872
-
int16_t gyroPitchZero
Definition: Wii.h:278
-
uint16_t pitchGyroScale
Definition: Wii.h:262
-
#define L2CAP_CONTROL_CONNECT_REQUEST
Definition: BTD.h:107
-
#define HID_CTRL_PSM
Definition: BTD.h:182
-
double getWiimoteRoll()
Definition: Wii.h:222
+
void setRumbleToggle()
Definition: Wii.cpp:869
+
int16_t gyroPitchZero
Definition: Wii.h:261
+
uint16_t pitchGyroScale
Definition: Wii.h:245
+
#define L2CAP_CONTROL_CONNECT_REQUEST
Definition: BTD.h:105
+
#define HID_CTRL_PSM
Definition: BTD.h:180
+
double getWiimoteRoll()
Definition: Wii.h:205
WII(BTD *p, bool pair=false)
Definition: Wii.cpp:85
-
double rollGyroSpeed
Definition: Wii.h:256
-
#define WII_CHECK_EXTENSION_STATE
Definition: BTD.h:132
+
double rollGyroSpeed
Definition: Wii.h:239
+
#define WII_CHECK_EXTENSION_STATE
Definition: BTD.h:130
-
bool connectToWii
Definition: BTD.h:503
-
bool wiiUProController
Definition: BTD.h:513
-
uint16_t hci_handle
Definition: BTD.h:487
-
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1142
-
void setLedStatus()
Definition: Wii.cpp:906
-
#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE
Definition: BTD.h:145
+
bool connectToWii
Definition: BTD.h:467
+
bool wiiUProController
Definition: BTD.h:477
+
uint16_t hci_handle
Definition: BTD.h:451
+
void hci_disconnect(uint16_t handle)
Definition: BTD.cpp:1150
+
Definition: BTD.h:563
+
void setLedStatus()
Definition: Wii.cpp:903
+
#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE
Definition: BTD.h:143
#define WII_FLAG_MOTION_PLUS_CONNECTED
Definition: Wii.h:27
const uint8_t WII_LEDS[]
Definition: Wii.cpp:25
ButtonEnum
-
bool getButtonClick(ButtonEnum b)
Definition: Wii.cpp:1048
-
int16_t accYwiimote
Definition: Wii.h:236
-
bool wiiUProControllerConnected
Definition: Wii.h:210
+
bool getButtonClick(ButtonEnum b)
Definition: Wii.cpp:1045
+
int16_t accYwiimote
Definition: Wii.h:219
+
bool wiiUProControllerConnected
Definition: Wii.h:193
+
void(* pFuncOnInit)(void)
Definition: BTD.h:603
-
#define l2cap_check_flag(flag)
Definition: BTD.h:160
-
void setRumbleOff()
Definition: Wii.cpp:860
-
#define L2CAP_CMD_CONFIG_REQUEST
Definition: BTD.h:168
-
#define L2CAP_FLAG_CONTROL_CONNECTED
Definition: BTD.h:138
-
#define L2CAP_CMD_DISCONNECT_REQUEST
Definition: BTD.h:170
-
void setAllOff()
Definition: Wii.cpp:854
-
#define L2CAP_CONTROL_DISCONNECT
Definition: BTD.h:110
+
#define l2cap_check_flag(flag)
Definition: BTD.h:158
+
void setRumbleOff()
Definition: Wii.cpp:857
+
#define L2CAP_CMD_CONFIG_REQUEST
Definition: BTD.h:166
+
#define L2CAP_FLAG_CONTROL_CONNECTED
Definition: BTD.h:136
+
#define PSTR(str)
+
#define L2CAP_CMD_DISCONNECT_REQUEST
Definition: BTD.h:168
+
void setAllOff()
Definition: Wii.cpp:851
+
#define L2CAP_CONTROL_DISCONNECT
Definition: BTD.h:108
const uint32_t WII_BUTTONS[]
Definition: Wii.cpp:40
-
#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST
Definition: BTD.h:136
-
void setLedOff()
Definition: Wii.h:152
-
#define WII_CHECK_MOTION_PLUS_STATE
Definition: BTD.h:131
-
double gyroYaw
Definition: Wii.h:251
-
#define HID_INTR_PSM
Definition: BTD.h:183
-
bool nunchuckConnected
Definition: Wii.h:206
+
#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST
Definition: BTD.h:134
+
void setLedOff()
Definition: Wii.h:143
+
#define WII_CHECK_MOTION_PLUS_STATE
Definition: BTD.h:129
+
BTD * pBtd
Definition: BTD.h:606
+
double gyroYaw
Definition: Wii.h:234
+
#define HID_INTR_PSM
Definition: BTD.h:181
+
bool nunchuckConnected
Definition: Wii.h:189
-
int8_t registerServiceClass(BluetoothService *pService)
Definition: BTD.h:333
-
bool l2capConnectionClaimed
Definition: BTD.h:473
-
int16_t gyroYawRaw
Definition: Wii.h:269
-
bool isIRCameraEnabled()
Definition: Wii.h:389
+
bool l2capConnectionClaimed
Definition: BTD.h:437
+
int16_t gyroYawRaw
Definition: Wii.h:252
+
bool isIRCameraEnabled()
Definition: Wii.h:372
const uint32_t WII_PROCONTROLLER_BUTTONS[]
Definition: Wii.cpp:59
-
#define L2CAP_CMD_DISCONNECT_RESPONSE
Definition: BTD.h:171
-
#define L2CAP_CMD_CONNECTION_RESPONSE
Definition: BTD.h:167
-
#define L2CAP_CMD_CONFIG_RESPONSE
Definition: BTD.h:169
-
double getWiimotePitch()
Definition: Wii.h:218
-
void pair(void)
Definition: Wii.h:89
-
void setLedOn(LEDEnum a)
Definition: Wii.cpp:890
-
double yawGyroSpeed
Definition: Wii.h:257
+
#define L2CAP_CMD_DISCONNECT_RESPONSE
Definition: BTD.h:169
+
#define L2CAP_CMD_CONNECTION_RESPONSE
Definition: BTD.h:165
+
#define L2CAP_CMD_CONFIG_RESPONSE
Definition: BTD.h:167
+
double getWiimotePitch()
Definition: Wii.h:201
+
void pair(void)
Definition: Wii.h:80
+
uint16_t hci_handle
Definition: BTD.h:609
+
void setLedOn(LEDEnum a)
Definition: Wii.cpp:887
+
double yawGyroSpeed
Definition: Wii.h:240
HatEnum
Definition: Wii.h:35
-
int16_t accYnunchuck
Definition: Wii.h:242
-
int16_t gyroYawZero
Definition: Wii.h:276
+
int16_t accYnunchuck
Definition: Wii.h:225
+
int16_t gyroYawZero
Definition: Wii.h:259
+
uint32_t l2cap_event_flag
Definition: BTD.h:612
#define wii_check_flag(flag)
Definition: Wii.h:30
-
double pitchGyroSpeed
Definition: Wii.h:255
-
double gyroPitch
Definition: Wii.h:247
-
#define WII_INIT_MOTION_PLUS_STATE
Definition: BTD.h:133
-
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1190
-
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1265
-
#define PENDING
Definition: BTD.h:176
-
#define L2CAP_FLAG_INTERRUPT_CONNECTED
Definition: BTD.h:144
-
#define l2cap_set_flag(flag)
Definition: BTD.h:161
-
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1248
+
double pitchGyroSpeed
Definition: Wii.h:238
+
double gyroPitch
Definition: Wii.h:230
+
#define WII_INIT_MOTION_PLUS_STATE
Definition: BTD.h:131
+
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
Definition: BTD.cpp:1198
+
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
Definition: BTD.cpp:1273
+
#define PENDING
Definition: BTD.h:174
+
#define L2CAP_FLAG_INTERRUPT_CONNECTED
Definition: BTD.h:142
+
#define l2cap_set_flag(flag)
Definition: BTD.h:159
+
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
Definition: BTD.cpp:1256
-
bool getButtonPress(ButtonEnum b)
Definition: Wii.cpp:1041
-
#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS
Definition: BTD.h:137
+
bool getButtonPress(ButtonEnum b)
Definition: Wii.cpp:1038
+
#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS
Definition: BTD.h:135
-
#define L2CAP_CMD_CONNECTION_REQUEST
Definition: BTD.h:166
-
bool motionPlusConnected
Definition: Wii.h:208
-
int16_t gyroRollZero
Definition: Wii.h:277
-
#define L2CAP_INTERRUPT_CONNECT_REQUEST
Definition: BTD.h:114
-
virtual void Run()
Definition: Wii.cpp:684
-
#define L2CAP_INTERRUPT_DISCONNECT
Definition: BTD.h:116
-
int16_t accXwiimote
Definition: Wii.h:236
-
int16_t accZwiimote
Definition: Wii.h:236
-
#define L2CAP_CMD_COMMAND_REJECT
Definition: BTD.h:165
+
#define L2CAP_CMD_CONNECTION_REQUEST
Definition: BTD.h:164
+
bool motionPlusConnected
Definition: Wii.h:191
+
int16_t gyroRollZero
Definition: Wii.h:260
+
bool checkHciHandle(uint8_t *buf, uint16_t handle)
Definition: BTD.h:598
+
#define L2CAP_INTERRUPT_CONNECT_REQUEST
Definition: BTD.h:112
+
void Run()
Definition: Wii.cpp:681
+
#define L2CAP_INTERRUPT_DISCONNECT
Definition: BTD.h:114
+
int16_t accXwiimote
Definition: Wii.h:219
+
int16_t accZwiimote
Definition: Wii.h:219
+
#define L2CAP_CMD_COMMAND_REJECT
Definition: BTD.h:163
diff --git a/_wii_8h.html b/_wii_8h.html index 68ec671e..0c7c1310 100644 --- a/_wii_8h.html +++ b/_wii_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Wii.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -100,7 +101,7 @@ Include dependency graph for Wii.h:
- +
This graph shows which files directly or indirectly include this file:
@@ -249,7 +250,7 @@ Enumerations diff --git a/_wii_8h__dep__incl.md5 b/_wii_8h__dep__incl.md5 index 1300a3e5..141f0cf4 100644 --- a/_wii_8h__dep__incl.md5 +++ b/_wii_8h__dep__incl.md5 @@ -1 +1 @@ -4f5ed0d059dbe61d52339b9d9d877c07 \ No newline at end of file +68e486939ecaf1de2be16bf264fe38d3 \ No newline at end of file diff --git a/_wii_8h__incl.map b/_wii_8h__incl.map index fe6475a4..7893419c 100644 --- a/_wii_8h__incl.map +++ b/_wii_8h__incl.map @@ -1,5 +1,7 @@ - - + + + + diff --git a/_wii_8h__incl.md5 b/_wii_8h__incl.md5 index 8af172ab..f8ae3450 100644 --- a/_wii_8h__incl.md5 +++ b/_wii_8h__incl.md5 @@ -1 +1 @@ -8f6053582134fdb8a44a345a833d0cc3 \ No newline at end of file +1975c7b33cbe34ad70871dbfd062d74a \ No newline at end of file diff --git a/_wii_8h__incl.png b/_wii_8h__incl.png index bc6aac08..1be2f584 100644 Binary files a/_wii_8h__incl.png and b/_wii_8h__incl.png differ diff --git a/_wii_8h_source.html b/_wii_8h_source.html index e2a17752..c49390a8 100644 --- a/_wii_8h_source.html +++ b/_wii_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Wii.h Source File + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -131,329 +132,321 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
48 public:
55  WII(BTD *p, bool pair = false);
56 
-
62  virtual void ACLData(uint8_t* ACLData);
-
64  virtual void Run();
-
66  virtual void Reset();
-
68  virtual void disconnect();
-
82  bool getButtonPress(ButtonEnum b);
-
83  bool getButtonClick(ButtonEnum b);
-
89  void pair(void) {
-
90  if(pBtd)
-
91  pBtd->pairWithWiimote();
-
92  };
-
98  uint8_t getAnalogHat(HatEnum a);
-
104  uint16_t getAnalogHat(AnalogHatEnum a);
-
105 
-
110  double getPitch() {
-
111  if(motionPlusConnected)
-
112  return compPitch;
-
113  return getWiimotePitch();
-
114  };
-
115 
-
120  double getRoll() {
-
121  if(motionPlusConnected)
-
122  return compRoll;
-
123  return getWiimoteRoll();
-
124  };
-
125 
-
132  double getYaw() {
-
133  return gyroYaw;
-
134  };
+
59  void disconnect();
+
73  bool getButtonPress(ButtonEnum b);
+
74  bool getButtonClick(ButtonEnum b);
+
80  void pair(void) {
+
81  if(pBtd)
+
82  pBtd->pairWithWiimote();
+
83  };
+
89  uint8_t getAnalogHat(HatEnum a);
+
95  uint16_t getAnalogHat(AnalogHatEnum a);
+
96 
+
101  double getPitch() {
+
102  if(motionPlusConnected)
+
103  return compPitch;
+
104  return getWiimotePitch();
+
105  };
+
106 
+
111  double getRoll() {
+
112  if(motionPlusConnected)
+
113  return compRoll;
+
114  return getWiimoteRoll();
+
115  };
+
116 
+
123  double getYaw() {
+
124  return gyroYaw;
+
125  };
+
126 
+
128  void setAllOff();
+
130  void setRumbleOff();
+
132  void setRumbleOn();
+
134  void setRumbleToggle();
135 
-
137  void setAllOff();
-
139  void setRumbleOff();
-
141  void setRumbleOn();
-
143  void setRumbleToggle();
-
144 
-
149  void setLedRaw(uint8_t value);
-
150 
-
152  void setLedOff() {
-
153  setLedRaw(0);
-
154  };
-
159  void setLedOff(LEDEnum a);
-
164  void setLedOn(LEDEnum a);
-
169  void setLedToggle(LEDEnum a);
-
177  void setLedStatus();
-
178 
-
183  uint8_t getBatteryLevel();
-
184 
-
189  uint8_t getWiiState() {
-
190  return wiiState;
-
191  };
-
192 
-
197  void attachOnInit(void (*funcOnInit)(void)) {
-
198  pFuncOnInit = funcOnInit;
-
199  };
-
204  bool wiimoteConnected;
-
206  bool nunchuckConnected;
-
208  bool motionPlusConnected;
-
210  bool wiiUProControllerConnected;
-
213  /* IMU Data, might be usefull if you need to do something more advanced than just calculating the angle */
-
214 
-
218  double getWiimotePitch() {
-
219  return (atan2(accYwiimote, accZwiimote) + PI) * RAD_TO_DEG;
-
220  };
-
221 
-
222  double getWiimoteRoll() {
-
223  return (atan2(accXwiimote, accZwiimote) + PI) * RAD_TO_DEG;
-
224  };
-
230  double getNunchuckPitch() {
-
231  return (atan2(accYnunchuck, accZnunchuck) + PI) * RAD_TO_DEG;
-
232  };
-
233 
-
234  double getNunchuckRoll() {
-
235  return (atan2(accXnunchuck, accZnunchuck) + PI) * RAD_TO_DEG;
-
236  };
-
241  int16_t accXwiimote, accYwiimote, accZwiimote;
-
242  int16_t accXnunchuck, accYnunchuck, accZnunchuck;
-
245  /* Variables for the gyro inside the Motion Plus */
-
247  double gyroPitch;
-
249  double gyroRoll;
-
251  double gyroYaw;
-
252 
-
255  double pitchGyroSpeed;
-
256  double rollGyroSpeed;
-
257  double yawGyroSpeed;
-
262  uint16_t pitchGyroScale;
-
263  uint16_t rollGyroScale;
-
264  uint16_t yawGyroScale;
-
269  int16_t gyroYawRaw;
-
270  int16_t gyroRollRaw;
-
271  int16_t gyroPitchRaw;
-
276  int16_t gyroYawZero;
-
277  int16_t gyroRollZero;
-
278  int16_t gyroPitchZero;
-
281 #ifdef WIICAMERA
-
282 
-
286  void IRinitialize();
-
287 
-
292  uint16_t getIRx1() {
-
293  return IR_object_x1;
-
294  };
-
295 
-
300  uint16_t getIRy1() {
-
301  return IR_object_y1;
-
302  };
-
303 
-
308  uint8_t getIRs1() {
-
309  return IR_object_s1;
-
310  };
-
311 
-
316  uint16_t getIRx2() {
-
317  return IR_object_x2;
-
318  };
-
319 
-
324  uint16_t getIRy2() {
-
325  return IR_object_y2;
-
326  };
-
327 
-
332  uint8_t getIRs2() {
-
333  return IR_object_s2;
-
334  };
-
335 
-
340  uint16_t getIRx3() {
-
341  return IR_object_x3;
-
342  };
-
343 
-
348  uint16_t getIRy3() {
-
349  return IR_object_y3;
-
350  };
-
351 
-
356  uint8_t getIRs3() {
-
357  return IR_object_s3;
-
358  };
-
359 
-
364  uint16_t getIRx4() {
-
365  return IR_object_x4;
-
366  };
-
367 
-
372  uint16_t getIRy4() {
-
373  return IR_object_y4;
+
140  void setLedRaw(uint8_t value);
+
141 
+
143  void setLedOff() {
+
144  setLedRaw(0);
+
145  };
+
150  void setLedOff(LEDEnum a);
+
155  void setLedOn(LEDEnum a);
+
160  void setLedToggle(LEDEnum a);
+
168  void setLedStatus();
+
169 
+
174  uint8_t getBatteryLevel();
+
175 
+
180  uint8_t getWiiState() {
+
181  return wiiState;
+
182  };
+
187  bool wiimoteConnected;
+
189  bool nunchuckConnected;
+
191  bool motionPlusConnected;
+
193  bool wiiUProControllerConnected;
+
196  /* IMU Data, might be usefull if you need to do something more advanced than just calculating the angle */
+
197 
+
201  double getWiimotePitch() {
+
202  return (atan2(accYwiimote, accZwiimote) + PI) * RAD_TO_DEG;
+
203  };
+
204 
+
205  double getWiimoteRoll() {
+
206  return (atan2(accXwiimote, accZwiimote) + PI) * RAD_TO_DEG;
+
207  };
+
213  double getNunchuckPitch() {
+
214  return (atan2(accYnunchuck, accZnunchuck) + PI) * RAD_TO_DEG;
+
215  };
+
216 
+
217  double getNunchuckRoll() {
+
218  return (atan2(accXnunchuck, accZnunchuck) + PI) * RAD_TO_DEG;
+
219  };
+
224  int16_t accXwiimote, accYwiimote, accZwiimote;
+
225  int16_t accXnunchuck, accYnunchuck, accZnunchuck;
+
228  /* Variables for the gyro inside the Motion Plus */
+
230  double gyroPitch;
+
232  double gyroRoll;
+
234  double gyroYaw;
+
235 
+
238  double pitchGyroSpeed;
+
239  double rollGyroSpeed;
+
240  double yawGyroSpeed;
+
245  uint16_t pitchGyroScale;
+
246  uint16_t rollGyroScale;
+
247  uint16_t yawGyroScale;
+
252  int16_t gyroYawRaw;
+
253  int16_t gyroRollRaw;
+
254  int16_t gyroPitchRaw;
+
259  int16_t gyroYawZero;
+
260  int16_t gyroRollZero;
+
261  int16_t gyroPitchZero;
+
264 #ifdef WIICAMERA
+
265 
+
269  void IRinitialize();
+
270 
+
275  uint16_t getIRx1() {
+
276  return IR_object_x1;
+
277  };
+
278 
+
283  uint16_t getIRy1() {
+
284  return IR_object_y1;
+
285  };
+
286 
+
291  uint8_t getIRs1() {
+
292  return IR_object_s1;
+
293  };
+
294 
+
299  uint16_t getIRx2() {
+
300  return IR_object_x2;
+
301  };
+
302 
+
307  uint16_t getIRy2() {
+
308  return IR_object_y2;
+
309  };
+
310 
+
315  uint8_t getIRs2() {
+
316  return IR_object_s2;
+
317  };
+
318 
+
323  uint16_t getIRx3() {
+
324  return IR_object_x3;
+
325  };
+
326 
+
331  uint16_t getIRy3() {
+
332  return IR_object_y3;
+
333  };
+
334 
+
339  uint8_t getIRs3() {
+
340  return IR_object_s3;
+
341  };
+
342 
+
347  uint16_t getIRx4() {
+
348  return IR_object_x4;
+
349  };
+
350 
+
355  uint16_t getIRy4() {
+
356  return IR_object_y4;
+
357  };
+
358 
+
363  uint8_t getIRs4() {
+
364  return IR_object_s4;
+
365  };
+
366 
+
372  bool isIRCameraEnabled() {
+
373  return (wiiState & 0x08);
374  };
-
375 
-
380  uint8_t getIRs4() {
-
381  return IR_object_s4;
-
382  };
-
383 
-
389  bool isIRCameraEnabled() {
-
390  return (wiiState & 0x08);
-
391  };
-
393 #endif
-
394 
-
395 private:
-
396  BTD *pBtd; // Pointer to BTD instance
-
397 
-
403  void onInit();
-
404  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
-
405 
-
406  void L2CAP_task(); // L2CAP state machine
+
376 #endif
+
377 
+
378 protected:
+
384  void ACLData(uint8_t* ACLData);
+
386  void Run();
+
388  void Reset();
+
394  void onInit();
+
397 private:
+
398 
+
399  void L2CAP_task(); // L2CAP state machine
+
400 
+
401  /* Variables filled from HCI event management */
+
402  bool activeConnection; // Used to indicate if it's already has established a connection
+
403 
+
404  /* Variables used by high level L2CAP task */
+
405  uint8_t l2cap_state;
+
406  uint8_t wii_event_flag; // Used for Wii flags
407 
-
408  /* Variables filled from HCI event management */
-
409  uint16_t hci_handle;
-
410  bool activeConnection; // Used to indicate if it's already has established a connection
-
411 
-
412  /* Variables used by high level L2CAP task */
-
413  uint8_t l2cap_state;
-
414  uint32_t l2cap_event_flag; // L2CAP flags of received Bluetooth events
-
415  uint8_t wii_event_flag; // Used for Wii flags
-
416 
-
417  uint32_t ButtonState;
-
418  uint32_t OldButtonState;
-
419  uint32_t ButtonClickState;
-
420  uint16_t hatValues[4];
-
421 
-
422  uint8_t HIDBuffer[3]; // Used to store HID commands
-
423 
-
424  uint16_t stateCounter;
-
425  bool unknownExtensionConnected;
-
426  bool extensionConnected;
-
427  bool checkExtension; // Set to false when getBatteryLevel() is called otherwise if should be true
-
428  bool motionPlusInside; // True if it's a new Wiimote with the Motion Plus extension build into it
-
429 
-
430  /* L2CAP Channels */
-
431  uint8_t control_scid[2]; // L2CAP source CID for HID_Control
-
432  uint8_t control_dcid[2]; // 0x0060
-
433  uint8_t interrupt_scid[2]; // L2CAP source CID for HID_Interrupt
-
434  uint8_t interrupt_dcid[2]; // 0x0061
-
435  uint8_t identifier; // Identifier for connection
+
408  uint32_t ButtonState;
+
409  uint32_t OldButtonState;
+
410  uint32_t ButtonClickState;
+
411  uint16_t hatValues[4];
+
412 
+
413  uint8_t HIDBuffer[3]; // Used to store HID commands
+
414 
+
415  uint16_t stateCounter;
+
416  bool unknownExtensionConnected;
+
417  bool extensionConnected;
+
418  bool checkExtension; // Set to false when getBatteryLevel() is called otherwise if should be true
+
419  bool motionPlusInside; // True if it's a new Wiimote with the Motion Plus extension build into it
+
420 
+
421  /* L2CAP Channels */
+
422  uint8_t control_scid[2]; // L2CAP source CID for HID_Control
+
423  uint8_t control_dcid[2]; // 0x0060
+
424  uint8_t interrupt_scid[2]; // L2CAP source CID for HID_Interrupt
+
425  uint8_t interrupt_dcid[2]; // 0x0061
+
426 
+
427  /* HID Commands */
+
428  void HID_Command(uint8_t* data, uint8_t nbytes);
+
429  void setReportMode(bool continuous, uint8_t mode);
+
430 
+
431  void writeData(uint32_t offset, uint8_t size, uint8_t* data);
+
432  void initExtension1();
+
433  void initExtension2();
+
434 
+
435  void statusRequest(); // Used to update the Wiimote state and battery level
436 
-
437  /* HID Commands */
-
438  void HID_Command(uint8_t* data, uint8_t nbytes);
-
439  void setReportMode(bool continuous, uint8_t mode);
+
437  void readData(uint32_t offset, uint16_t size, bool EEPROM);
+
438  void readExtensionType();
+
439  void readCalData();
440 
-
441  void writeData(uint32_t offset, uint8_t size, uint8_t* data);
-
442  void initExtension1();
-
443  void initExtension2();
+
441  void checkMotionPresent(); // Used to see if a Motion Plus is connected to the Wiimote
+
442  void initMotionPlus();
+
443  void activateMotionPlus();
444 
-
445  void statusRequest(); // Used to update the Wiimote state and battery level
-
446 
-
447  void readData(uint32_t offset, uint16_t size, bool EEPROM);
-
448  void readExtensionType();
-
449  void readCalData();
-
450 
-
451  void checkMotionPresent(); // Used to see if a Motion Plus is connected to the Wiimote
-
452  void initMotionPlus();
-
453  void activateMotionPlus();
+
445  double compPitch; // Fusioned angle using a complimentary filter if the Motion Plus is connected
+
446  double compRoll; // Fusioned angle using a complimentary filter if the Motion Plus is connected
+
447 
+
448  bool activateNunchuck;
+
449  bool motionValuesReset; // This bool is true when the gyro values has been reset
+
450  uint32_t timer;
+
451 
+
452  uint8_t wiiState; // Stores the value in l2capinbuf[12] - (0x01: Battery is nearly empty), (0x02: An Extension Controller is connected), (0x04: Speaker enabled), (0x08: IR enabled), (0x10: LED1, 0x20: LED2, 0x40: LED3, 0x80: LED4)
+
453  uint8_t batteryLevel;
454 
-
455  double compPitch; // Fusioned angle using a complimentary filter if the Motion Plus is connected
-
456  double compRoll; // Fusioned angle using a complimentary filter if the Motion Plus is connected
-
457 
-
458  bool activateNunchuck;
-
459  bool motionValuesReset; // This bool is true when the gyro values has been reset
-
460  unsigned long timer;
-
461 
-
462  uint8_t wiiState; // Stores the value in l2capinbuf[12] - (0x01: Battery is nearly empty), (0x02: An Extension Controller is connected), (0x04: Speaker enabled), (0x08: IR enabled), (0x10: LED1, 0x20: LED2, 0x40: LED3, 0x80: LED4)
-
463  uint8_t batteryLevel;
-
464 
-
465 #ifdef WIICAMERA
-
466  /* Private function and variables for the readings from the IR Camera */
-
467  void enableIRCamera1(); // Sets bit 2 of output report 13
-
468  void enableIRCamera2(); // Sets bit 2 of output report 1A
-
469  void writeSensitivityBlock1();
-
470  void writeSensitivityBlock2();
-
471  void write0x08Value();
-
472  void setWiiModeNumber(uint8_t mode_number);
-
473 
-
474  uint16_t IR_object_x1; // IR x position 10 bits
-
475  uint16_t IR_object_y1; // IR y position 10 bits
-
476  uint8_t IR_object_s1; // IR size value
-
477  uint16_t IR_object_x2;
-
478  uint16_t IR_object_y2;
-
479  uint8_t IR_object_s2;
-
480  uint16_t IR_object_x3; // IR x position 10 bits
-
481  uint16_t IR_object_y3; // IR y position 10 bits
-
482  uint8_t IR_object_s3; // IR size value
-
483  uint16_t IR_object_x4;
-
484  uint16_t IR_object_y4;
-
485  uint8_t IR_object_s4;
-
486 #endif
-
487 };
-
488 #endif
-
bool wiimoteConnected
Definition: Wii.h:199
-
int16_t gyroPitchRaw
Definition: Wii.h:271
-
uint16_t rollGyroScale
Definition: Wii.h:263
-
double getNunchuckPitch()
Definition: Wii.h:230
-
void setLedToggle(LEDEnum a)
Definition: Wii.cpp:900
-
void setLedRaw(uint8_t value)
Definition: Wii.cpp:878
-
uint8_t getAnalogHat(HatEnum a)
Definition: Wii.cpp:1059
-
uint16_t yawGyroScale
Definition: Wii.h:264
+
455 #ifdef WIICAMERA
+
456  /* Private function and variables for the readings from the IR Camera */
+
457  void enableIRCamera1(); // Sets bit 2 of output report 13
+
458  void enableIRCamera2(); // Sets bit 2 of output report 1A
+
459  void writeSensitivityBlock1();
+
460  void writeSensitivityBlock2();
+
461  void write0x08Value();
+
462  void setWiiModeNumber(uint8_t mode_number);
+
463 
+
464  uint16_t IR_object_x1; // IR x position 10 bits
+
465  uint16_t IR_object_y1; // IR y position 10 bits
+
466  uint8_t IR_object_s1; // IR size value
+
467  uint16_t IR_object_x2;
+
468  uint16_t IR_object_y2;
+
469  uint8_t IR_object_s2;
+
470  uint16_t IR_object_x3; // IR x position 10 bits
+
471  uint16_t IR_object_y3; // IR y position 10 bits
+
472  uint8_t IR_object_s3; // IR size value
+
473  uint16_t IR_object_x4;
+
474  uint16_t IR_object_y4;
+
475  uint8_t IR_object_s4;
+
476 #endif
+
477 };
+
478 #endif
+
bool wiimoteConnected
Definition: Wii.h:182
+
void onInit()
Definition: Wii.cpp:1080
+
int16_t gyroPitchRaw
Definition: Wii.h:254
+
uint16_t rollGyroScale
Definition: Wii.h:246
+
double getNunchuckPitch()
Definition: Wii.h:213
+
void setLedToggle(LEDEnum a)
Definition: Wii.cpp:897
+
void setLedRaw(uint8_t value)
Definition: Wii.cpp:875
+
uint8_t getAnalogHat(HatEnum a)
Definition: Wii.cpp:1056
+
uint16_t yawGyroScale
Definition: Wii.h:247
Definition: Wii.h:39
-
Definition: BTD.h:230
-
uint8_t getIRs1()
Definition: Wii.h:308
-
uint8_t getIRs3()
Definition: Wii.h:356
-
double getNunchuckRoll()
Definition: Wii.h:234
-
virtual void ACLData(uint8_t *ACLData)
Definition: Wii.cpp:135
-
double gyroRoll
Definition: Wii.h:249
-
uint16_t getIRx4()
Definition: Wii.h:364
-
void setRumbleOn()
Definition: Wii.cpp:866
-
virtual void Reset()
Definition: Wii.cpp:104
-
double getRoll()
Definition: Wii.h:120
+
Definition: BTD.h:198
+
uint8_t getIRs1()
Definition: Wii.h:291
+
uint8_t getIRs3()
Definition: Wii.h:339
+
double getNunchuckRoll()
Definition: Wii.h:217
+
void ACLData(uint8_t *ACLData)
Definition: Wii.cpp:132
+
double gyroRoll
Definition: Wii.h:232
+
uint16_t getIRx4()
Definition: Wii.h:347
+
void setRumbleOn()
Definition: Wii.cpp:863
+
void Reset()
Definition: Wii.cpp:101
+
double getRoll()
Definition: Wii.h:111
AnalogHatEnum
-
int16_t accZnunchuck
Definition: Wii.h:242
-
uint8_t getBatteryLevel()
Definition: Wii.cpp:919
-
virtual void disconnect()
Definition: Wii.cpp:118
-
double getPitch()
Definition: Wii.h:110
-
int16_t accXnunchuck
Definition: Wii.h:242
-
uint8_t getWiiState()
Definition: Wii.h:189
-
uint16_t getIRy2()
Definition: Wii.h:324
-
int16_t gyroRollRaw
Definition: Wii.h:270
+
int16_t accZnunchuck
Definition: Wii.h:225
+
uint8_t getBatteryLevel()
Definition: Wii.cpp:916
+
void disconnect()
Definition: Wii.cpp:115
+
double getPitch()
Definition: Wii.h:101
+
int16_t accXnunchuck
Definition: Wii.h:225
+
uint8_t getWiiState()
Definition: Wii.h:180
+
uint16_t getIRy2()
Definition: Wii.h:307
+
int16_t gyroRollRaw
Definition: Wii.h:253
LEDEnum
-
void IRinitialize()
Definition: Wii.cpp:1096
+
void IRinitialize()
Definition: Wii.cpp:1093
Definition: Wii.h:37
-
uint16_t getIRx2()
Definition: Wii.h:316
-
uint16_t getIRx1()
Definition: Wii.h:292
-
void setRumbleToggle()
Definition: Wii.cpp:872
-
int16_t gyroPitchZero
Definition: Wii.h:278
-
uint16_t pitchGyroScale
Definition: Wii.h:262
-
double getWiimoteRoll()
Definition: Wii.h:222
+
uint16_t getIRx2()
Definition: Wii.h:299
+
uint16_t getIRx1()
Definition: Wii.h:275
+
void setRumbleToggle()
Definition: Wii.cpp:869
+
int16_t gyroPitchZero
Definition: Wii.h:261
+
uint16_t pitchGyroScale
Definition: Wii.h:245
+
double getWiimoteRoll()
Definition: Wii.h:205
WII(BTD *p, bool pair=false)
Definition: Wii.cpp:85
-
double rollGyroSpeed
Definition: Wii.h:256
-
uint8_t getIRs4()
Definition: Wii.h:380
-
uint16_t getIRy3()
Definition: Wii.h:348
-
Definition: BTD.h:211
-
void setLedStatus()
Definition: Wii.cpp:906
+
double rollGyroSpeed
Definition: Wii.h:239
+
uint8_t getIRs4()
Definition: Wii.h:363
+
uint16_t getIRy3()
Definition: Wii.h:331
+
Definition: BTD.h:563
+
void setLedStatus()
Definition: Wii.cpp:903
ButtonEnum
-
bool getButtonClick(ButtonEnum b)
Definition: Wii.cpp:1048
-
int16_t accYwiimote
Definition: Wii.h:236
-
bool wiiUProControllerConnected
Definition: Wii.h:210
-
void setRumbleOff()
Definition: Wii.cpp:860
-
void setAllOff()
Definition: Wii.cpp:854
-
void setLedOff()
Definition: Wii.h:152
-
uint16_t getIRy1()
Definition: Wii.h:300
-
uint16_t getIRx3()
Definition: Wii.h:340
-
double gyroYaw
Definition: Wii.h:251
-
bool nunchuckConnected
Definition: Wii.h:206
-
uint16_t getIRy4()
Definition: Wii.h:372
-
int16_t gyroYawRaw
Definition: Wii.h:269
-
bool isIRCameraEnabled()
Definition: Wii.h:389
-
void attachOnInit(void(*funcOnInit)(void))
Definition: Wii.h:197
-
double getYaw()
Definition: Wii.h:132
-
double getWiimotePitch()
Definition: Wii.h:218
-
void pair(void)
Definition: Wii.h:89
-
void setLedOn(LEDEnum a)
Definition: Wii.cpp:890
-
double yawGyroSpeed
Definition: Wii.h:257
+
bool getButtonClick(ButtonEnum b)
Definition: Wii.cpp:1045
+
int16_t accYwiimote
Definition: Wii.h:219
+
bool wiiUProControllerConnected
Definition: Wii.h:193
+
void setRumbleOff()
Definition: Wii.cpp:857
+
void setAllOff()
Definition: Wii.cpp:851
+
void setLedOff()
Definition: Wii.h:143
+
uint16_t getIRy1()
Definition: Wii.h:283
+
uint16_t getIRx3()
Definition: Wii.h:323
+
BTD * pBtd
Definition: BTD.h:606
+
double gyroYaw
Definition: Wii.h:234
+
bool nunchuckConnected
Definition: Wii.h:189
+
uint16_t getIRy4()
Definition: Wii.h:355
+
int16_t gyroYawRaw
Definition: Wii.h:252
+
bool isIRCameraEnabled()
Definition: Wii.h:372
+
double getYaw()
Definition: Wii.h:123
+
double getWiimotePitch()
Definition: Wii.h:201
+
void pair(void)
Definition: Wii.h:80
+
void setLedOn(LEDEnum a)
Definition: Wii.cpp:887
+
double yawGyroSpeed
Definition: Wii.h:240
HatEnum
Definition: Wii.h:35
-
int16_t accYnunchuck
Definition: Wii.h:242
-
int16_t gyroYawZero
Definition: Wii.h:276
-
double pitchGyroSpeed
Definition: Wii.h:255
-
void pairWithWiimote()
Definition: BTD.h:500
-
uint8_t getIRs2()
Definition: Wii.h:332
-
double gyroPitch
Definition: Wii.h:247
+
int16_t accYnunchuck
Definition: Wii.h:225
+
int16_t gyroYawZero
Definition: Wii.h:259
+
double pitchGyroSpeed
Definition: Wii.h:238
+
void pairWithWiimote()
Definition: BTD.h:464
+
uint8_t getIRs2()
Definition: Wii.h:315
+
double gyroPitch
Definition: Wii.h:230
Definition: Wii.h:47
-
bool getButtonPress(ButtonEnum b)
Definition: Wii.cpp:1041
+
bool getButtonPress(ButtonEnum b)
Definition: Wii.cpp:1038
-
bool motionPlusConnected
Definition: Wii.h:208
-
int16_t gyroRollZero
Definition: Wii.h:277
-
virtual void Run()
Definition: Wii.cpp:684
-
int16_t accXwiimote
Definition: Wii.h:236
-
int16_t accZwiimote
Definition: Wii.h:236
+
bool motionPlusConnected
Definition: Wii.h:191
+
int16_t gyroRollZero
Definition: Wii.h:260
+
void Run()
Definition: Wii.cpp:681
+
int16_t accXwiimote
Definition: Wii.h:219
+
int16_t accZwiimote
Definition: Wii.h:219
diff --git a/_wii_camera_readme_8md.html b/_wii_camera_readme_8md.html index 84c74590..a60c281d 100644 --- a/_wii_camera_readme_8md.html +++ b/_wii_camera_readme_8md.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: WiiCameraReadme.md File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -92,7 +93,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/_wii_camera_readme_8md_source.html b/_wii_camera_readme_8md_source.html index cb258d86..a456bb65 100644 --- a/_wii_camera_readme_8md_source.html +++ b/_wii_camera_readme_8md_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: WiiCameraReadme.md Source File + @@ -31,7 +32,7 @@
- + @@ -71,7 +72,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -85,27 +86,25 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
WiiCameraReadme.md
-Go to the documentation of this file.
1 Please see <http://wiibrew.org/wiki/Wiimote#IR_Camera> for the complete capabilities of the Wii camera. The IR camera code was written based on the above website and with support from Kristian Lauszus.
+Go to the documentation of this file.
1 Please see <http://wiibrew.org/wiki/Wiimote#IR_Camera> for the complete capabilities of the Wii camera. The IR camera code was written based on the above website and with support from Kristian Lauszus.
2 
-
3 This library is large, if you run into memory problems when uploading to the Arduino, disable serial debugging.
+
3 This library is large, if you run into memory problems when uploading to the Arduino, disable serial debugging.
4 
-
5 To enable the IR camera code, simply set ```ENABLE_WII_IR_CAMERA``` to 1 in [settings.h](settings.h).
+
5 To enable the IR camera code, simply set ```ENABLE_WII_IR_CAMERA``` to 1 in [settings.h](settings.h).
6 
7 This library implements the following settings:
8 
-
9 * Report sensitivity mode: 00 00 00 00 00 00 90 00 41 40 00 Suggested by inio (high sensitivity)
-
10 * Data Format: Extended mode (0x03). Full mode is not working yet. The output reports 0x3e and 0x3f need tampering with
-
11  * In this mode the camera outputs x and y coordinates and a size dimension for the 4 brightest points.
+
9 * Report sensitivity mode: 00 00 00 00 00 00 90 00 41 40 00 Suggested by inio (high sensitivity)
+
10 * Data Format: Extended mode (0x03). Full mode is not working yet. The output reports 0x3e and 0x3f need tampering with
+
11  * In this mode the camera outputs x and y coordinates and a size dimension for the 4 brightest points.
12 
-
13 Again, read through <http://wiibrew.org/wiki/Wiimote#IR_Camera> to get an understanding of the camera and its settings.
-
#define ENABLE_WII_IR_CAMERA
Definition: settings.h:55
-
Definition: PS3Enums.h:125
+
13 Again, read through <http://wiibrew.org/wiki/Wiimote#IR_Camera> to get an understanding of the camera and its settings.
diff --git a/_x_b_o_x_o_l_d_8cpp.html b/_x_b_o_x_o_l_d_8cpp.html index fc59f891..d51e4b33 100644 --- a/_x_b_o_x_o_l_d_8cpp.html +++ b/_x_b_o_x_o_l_d_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXOLD.cpp File Reference + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -97,7 +98,7 @@ Include dependency graph for XBOXOLD.cpp:
- +

Go to the source code of this file.

@@ -150,7 +151,7 @@ Variables diff --git a/_x_b_o_x_o_l_d_8cpp__incl.map b/_x_b_o_x_o_l_d_8cpp__incl.map index f891722c..db35a5e0 100644 --- a/_x_b_o_x_o_l_d_8cpp__incl.map +++ b/_x_b_o_x_o_l_d_8cpp__incl.map @@ -1,5 +1,7 @@ - - - + + + + + diff --git a/_x_b_o_x_o_l_d_8cpp__incl.md5 b/_x_b_o_x_o_l_d_8cpp__incl.md5 index a14166fb..fc70e91c 100644 --- a/_x_b_o_x_o_l_d_8cpp__incl.md5 +++ b/_x_b_o_x_o_l_d_8cpp__incl.md5 @@ -1 +1 @@ -824a8833fbb3f9293199791af2e49083 \ No newline at end of file +6ca487f1802363c83de863e788aae1c0 \ No newline at end of file diff --git a/_x_b_o_x_o_l_d_8cpp__incl.png b/_x_b_o_x_o_l_d_8cpp__incl.png index e2f4427d..a83a3b0c 100644 Binary files a/_x_b_o_x_o_l_d_8cpp__incl.png and b/_x_b_o_x_o_l_d_8cpp__incl.png differ diff --git a/_x_b_o_x_o_l_d_8cpp_source.html b/_x_b_o_x_o_l_d_8cpp_source.html index 0e7a7478..10682926 100644 --- a/_x_b_o_x_o_l_d_8cpp_source.html +++ b/_x_b_o_x_o_l_d_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXOLD.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -161,12 +162,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
71  // get memory address of USB device address pool
72  AddressPool &addrPool = pUsb->GetAddressPool();
73 #ifdef EXTRADEBUG
-
74  Notify(PSTR("\r\nXBOXUSB Init"), 0x80);
+
74  Notify(PSTR("\r\nXBOXUSB Init"), 0x80);
75 #endif
76  // check if address has already been assigned to an instance
77  if(bAddress) {
78 #ifdef DEBUG_USB_HOST
-
79  Notify(PSTR("\r\nAddress in use"), 0x80);
+
79  Notify(PSTR("\r\nAddress in use"), 0x80);
80 #endif
81  return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE;
82  }
@@ -176,14 +177,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
86 
87  if(!p) {
88 #ifdef DEBUG_USB_HOST
-
89  Notify(PSTR("\r\nAddress not found"), 0x80);
+
89  Notify(PSTR("\r\nAddress not found"), 0x80);
90 #endif
91  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
92  }
93 
94  if(!p->epinfo) {
95 #ifdef DEBUG_USB_HOST
-
96  Notify(PSTR("\r\nepinfo is null"), 0x80);
+
96  Notify(PSTR("\r\nepinfo is null"), 0x80);
97 #endif
98  return USB_ERROR_EPINFO_IS_NULL;
99  }
@@ -226,13 +227,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
136  addrPool.FreeAddress(bAddress);
137  bAddress = 0;
138 #ifdef DEBUG_USB_HOST
-
139  Notify(PSTR("\r\nsetAddr: "), 0x80);
+
139  Notify(PSTR("\r\nsetAddr: "), 0x80);
140  D_PrintHex<uint8_t > (rcode, 0x80);
141 #endif
142  return rcode;
143  }
144 #ifdef EXTRADEBUG
-
145  Notify(PSTR("\r\nAddr: "), 0x80);
+
145  Notify(PSTR("\r\nAddr: "), 0x80);
146  D_PrintHex<uint8_t > (bAddress, 0x80);
147 #endif
148  //delay(300); // Spec says you should wait at least 200ms
@@ -257,13 +258,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
167 
168  /* Initialize data structures for endpoints of device */
169  epInfo[ XBOX_INPUT_PIPE ].epAddr = 0x01; // XBOX report endpoint
-
170  epInfo[ XBOX_INPUT_PIPE ].epAttribs = EP_INTERRUPT;
+
170  epInfo[ XBOX_INPUT_PIPE ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
171  epInfo[ XBOX_INPUT_PIPE ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
172  epInfo[ XBOX_INPUT_PIPE ].maxPktSize = EP_MAXPKTSIZE;
173  epInfo[ XBOX_INPUT_PIPE ].bmSndToggle = 0;
174  epInfo[ XBOX_INPUT_PIPE ].bmRcvToggle = 0;
175  epInfo[ XBOX_OUTPUT_PIPE ].epAddr = 0x02; // XBOX output endpoint
-
176  epInfo[ XBOX_OUTPUT_PIPE ].epAttribs = EP_INTERRUPT;
+
176  epInfo[ XBOX_OUTPUT_PIPE ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
177  epInfo[ XBOX_OUTPUT_PIPE ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
178  epInfo[ XBOX_OUTPUT_PIPE ].maxPktSize = EP_MAXPKTSIZE;
179  epInfo[ XBOX_OUTPUT_PIPE ].bmSndToggle = 0;
@@ -280,7 +281,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
190  goto FailSetConfDescr;
191 
192 #ifdef DEBUG_USB_HOST
-
193  Notify(PSTR("\r\nXbox Controller Connected\r\n"), 0x80);
+
193  Notify(PSTR("\r\nXbox Controller Connected\r\n"), 0x80);
194 #endif
195  if(pFuncOnInit)
196  pFuncOnInit(); // Call the user function
@@ -315,7 +316,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
225 
226 Fail:
227 #ifdef DEBUG_USB_HOST
-
228  Notify(PSTR("\r\nXbox Init Failed, error code: "), 0x80);
+
228  Notify(PSTR("\r\nXbox Init Failed, error code: "), 0x80);
229  NotifyFail(rcode);
230 #endif
231  Release();
@@ -375,21 +376,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
285  return;
286  for(uint8_t i = 0; i < length; i++) {
287  D_PrintHex<uint8_t > (readBuf[i], 0x80);
-
288  Notify(PSTR(" "), 0x80);
+
288  Notify(PSTR(" "), 0x80);
289  }
-
290  Notify(PSTR("\r\n"), 0x80);
+
290  Notify(PSTR("\r\n"), 0x80);
291 #endif
292 }
293 
294 uint8_t XBOXOLD::getButtonPress(ButtonEnum b) {
-
295  uint8_t button = pgm_read_byte(&XBOXOLD_BUTTONS[(uint8_t)b]);
+
295  uint8_t button = pgm_read_byte(&XBOXOLD_BUTTONS[(uint8_t)b]);
296  if(b == A || b == B || b == X || b == Y || b == BLACK || b == WHITE || b == L1 || b == R1) // A, B, X, Y, BLACK, WHITE, L1, and R1 are analog buttons
297  return buttonValues[button]; // Analog buttons
298  return (ButtonState & button); // Digital buttons
299 }
300 
301 bool XBOXOLD::getButtonClick(ButtonEnum b) {
-
302  uint8_t button = pgm_read_byte(&XBOXOLD_BUTTONS[(uint8_t)b]);
+
302  uint8_t button = pgm_read_byte(&XBOXOLD_BUTTONS[(uint8_t)b]);
303  if(b == A || b == B || b == X || b == Y || b == BLACK || b == WHITE || b == L1 || b == R1) { // A, B, X, Y, BLACK, WHITE, L1, and R1 are analog buttons
304  if(buttonClicked[button]) {
305  buttonClicked[button] = false;
@@ -410,7 +411,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
320 /* Xbox Controller commands */
321 void XBOXOLD::XboxCommand(uint8_t* data, uint16_t nbytes) {
322  //bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x00), Report Type (Output 0x02), interface (0x00), datalength, datalength, data)
-
323  pUsb->ctrlReq(bAddress, epInfo[XBOX_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x00, 0x02, 0x00, nbytes, nbytes, data, NULL);
+
323  pUsb->ctrlReq(bAddress, epInfo[XBOX_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x00, 0x02, 0x00, nbytes, nbytes, data, NULL);
324 }
325 
326 void XBOXOLD::setRumbleOn(uint8_t lValue, uint8_t rValue) {
@@ -431,22 +432,26 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
EpInfo * epinfo
Definition: address.h:76
bool lowspeed
Definition: address.h:79
-
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:81
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
uint8_t bmNakPower
Definition: address.h:42
Definition: address.h:75
-
virtual uint8_t Release()
Definition: XBOXOLD.cpp:236
+
uint8_t Release()
Definition: XBOXOLD.cpp:236
+
#define HID_REQUEST_SET_REPORT
Definition: hid.h:72
#define NotifyFail(...)
Definition: message.h:55
AnalogHatEnum
-
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:805
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
+
#define bmREQ_HID_OUT
Definition: hid.h:63
+
#define USB_TRANSFER_TYPE_INTERRUPT
Definition: usb_ch9.h:86
+
#define pgm_read_byte(addr)
void setRumbleOn(uint8_t lValue, uint8_t rValue)
Definition: XBOXOLD.cpp:326
#define NotifyFailGetDevDescr(...)
Definition: message.h:50
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
-
#define XBOX_OLD_PID4
Definition: XBOXOLD.h:43
-
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXOLD.h:159
-
#define EP_MAXPKTSIZE
Definition: PS3USB.h:25
+
#define XBOX_OLD_PID4
Definition: XBOXOLD.h:41
+
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXOLD.h:153
+
#define EP_MAXPKTSIZE
Definition: PS3USB.h:26
virtual void FreeAddress(uint8_t addr)=0
uint8_t epAttribs
Definition: address.h:37
@@ -455,54 +460,52 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
const uint8_t XBOXOLD_BUTTONS[]
Definition: XBOXOLD.cpp:24
#define Notify(...)
Definition: message.h:44
-
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:796
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
uint8_t epAddr
Definition: address.h:33
#define NotifyFailUnknownDevice(...)
Definition: message.h:54
#define USB_NAK_MAX_POWER
Definition: address.h:27
int16_t getAnalogHat(AnalogHatEnum a)
Definition: XBOXOLD.cpp:316
-
#define XBOX_VID
Definition: XBOXOLD.h:36
-
#define XBOX_INPUT_PIPE
Definition: XBOXOLD.h:32
+
#define XBOX_VID
Definition: XBOXOLD.h:34
+
#define XBOX_INPUT_PIPE
Definition: XBOXOLD.h:30
XBOXOLD(USB *pUsb)
Definition: XBOXOLD.cpp:47
-
#define EP_INTERRUPT
Definition: PS3USB.h:28
-
#define XBOX_OLD_PID1
Definition: XBOXOLD.h:40
+
#define XBOX_OLD_PID1
Definition: XBOXOLD.h:38
Definition: address.h:32
ButtonEnum
-
#define HID_REQUEST_SET_REPORT
Definition: BTD.h:39
-
#define JOYTECH_VID
Definition: XBOXOLD.h:38
-
USB * pUsb
Definition: XBOXOLD.h:155
+
#define JOYTECH_VID
Definition: XBOXOLD.h:36
+
USB * pUsb
Definition: XBOXOLD.h:149
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
uint8_t bmSndToggle
Definition: address.h:40
-
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:83
-
virtual uint8_t Poll()
Definition: XBOXOLD.cpp:244
-
#define XBOX_OLD_PID2
Definition: XBOXOLD.h:41
-
#define MADCATZ_VID
Definition: XBOXOLD.h:37
-
#define XBOX_OUTPUT_PIPE
Definition: XBOXOLD.h:33
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
+
#define PSTR(str)
+
uint8_t Poll()
Definition: XBOXOLD.cpp:244
+
#define XBOX_OLD_PID2
Definition: XBOXOLD.h:39
+
#define MADCATZ_VID
Definition: XBOXOLD.h:35
+
#define XBOX_OUTPUT_PIPE
Definition: XBOXOLD.h:31
#define USB_NAK_NOWAIT
Definition: address.h:29
-
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:80
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
Definition: Usb.cpp:206
-
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:75
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXOLD.cpp:62
-
#define XBOX_MAX_ENDPOINTS
Definition: XBOXOLD.h:49
-
#define XBOX_OLD_PID3
Definition: XBOXOLD.h:42
-
#define bmREQ_HID_OUT
Definition: BTD.h:38
-
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:78
-
bool XboxConnected
Definition: XBOXOLD.h:147
+
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:77
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXOLD.cpp:62
+
#define XBOX_MAX_ENDPOINTS
Definition: XBOXOLD.h:43
+
#define XBOX_OLD_PID3
Definition: XBOXOLD.h:40
+
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:80
+
bool XboxConnected
Definition: XBOXOLD.h:141
uint8_t maxPktSize
Definition: address.h:34
-
AddressPool & GetAddressPool()
Definition: UsbCore.h:206
-
Definition: UsbCore.h:190
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
Definition: UsbCore.h:197
bool getButtonClick(ButtonEnum b)
Definition: XBOXOLD.cpp:301
uint8_t getButtonPress(ButtonEnum b)
Definition: XBOXOLD.cpp:294
-
#define XBOX_CONTROL_PIPE
Definition: XBOXOLD.h:31
-
uint8_t bAddress
Definition: XBOXOLD.h:157
+
#define XBOX_CONTROL_PIPE
Definition: XBOXOLD.h:29
+
uint8_t bAddress
Definition: XBOXOLD.h:151
-
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:210
+
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:217
#define NotifyFailSetConfDescr(...)
Definition: message.h:53
-
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:761
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:51
Definition: usb_ch9.h:98
@@ -510,7 +513,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/_x_b_o_x_o_l_d_8h.html b/_x_b_o_x_o_l_d_8h.html index d2fc7a6c..91f38801 100644 --- a/_x_b_o_x_o_l_d_8h.html +++ b/_x_b_o_x_o_l_d_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXOLD.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -93,13 +94,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
#include "Usb.h"
+#include "hid.h"
#include "controllerEnums.h"
Include dependency graph for XBOXOLD.h:
- +
This graph shows which files directly or indirectly include this file:
@@ -120,8 +122,6 @@ Classes Macros #define EP_MAXPKTSIZE   32   -#define EP_INTERRUPT   0x03 -  #define XBOX_CONTROL_PIPE   0   #define XBOX_INPUT_PIPE   1 @@ -142,10 +142,6 @@ Macros   #define XBOX_OLD_PID4   0x0289   -#define bmREQ_HID_OUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE -  -#define HID_REQUEST_SET_REPORT   0x09 -  #define XBOX_MAX_ENDPOINTS   3   @@ -160,21 +156,7 @@ Macros
-

Definition at line 25 of file XBOXOLD.h.

- -
-
- -
-
- - - - -
#define EP_INTERRUPT   0x03
-
- -

Definition at line 28 of file XBOXOLD.h.

+

Definition at line 26 of file XBOXOLD.h.

@@ -188,7 +170,7 @@ Macros
-

Definition at line 31 of file XBOXOLD.h.

+

Definition at line 29 of file XBOXOLD.h.

@@ -202,7 +184,7 @@ Macros
-

Definition at line 32 of file XBOXOLD.h.

+

Definition at line 30 of file XBOXOLD.h.

@@ -216,7 +198,7 @@ Macros
-

Definition at line 33 of file XBOXOLD.h.

+

Definition at line 31 of file XBOXOLD.h.

@@ -230,7 +212,7 @@ Macros
-

Definition at line 36 of file XBOXOLD.h.

+

Definition at line 34 of file XBOXOLD.h.

@@ -244,7 +226,7 @@ Macros
-

Definition at line 37 of file XBOXOLD.h.

+

Definition at line 35 of file XBOXOLD.h.

@@ -258,7 +240,7 @@ Macros
-

Definition at line 38 of file XBOXOLD.h.

+

Definition at line 36 of file XBOXOLD.h.

@@ -272,7 +254,7 @@ Macros
-

Definition at line 40 of file XBOXOLD.h.

+

Definition at line 38 of file XBOXOLD.h.

@@ -286,7 +268,7 @@ Macros
-

Definition at line 41 of file XBOXOLD.h.

+

Definition at line 39 of file XBOXOLD.h.

@@ -300,7 +282,7 @@ Macros
-

Definition at line 42 of file XBOXOLD.h.

+

Definition at line 40 of file XBOXOLD.h.

@@ -314,35 +296,7 @@ Macros
-

Definition at line 43 of file XBOXOLD.h.

- -
- - -
-
- - - - -
#define bmREQ_HID_OUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
-
- -

Definition at line 46 of file XBOXOLD.h.

- -
-
- -
-
- - - - -
#define HID_REQUEST_SET_REPORT   0x09
-
- -

Definition at line 47 of file XBOXOLD.h.

+

Definition at line 41 of file XBOXOLD.h.

@@ -356,7 +310,7 @@ Macros
-

Definition at line 49 of file XBOXOLD.h.

+

Definition at line 43 of file XBOXOLD.h.

@@ -365,7 +319,7 @@ Macros diff --git a/_x_b_o_x_o_l_d_8h__dep__incl.md5 b/_x_b_o_x_o_l_d_8h__dep__incl.md5 index 0678f7d2..cc366f2a 100644 --- a/_x_b_o_x_o_l_d_8h__dep__incl.md5 +++ b/_x_b_o_x_o_l_d_8h__dep__incl.md5 @@ -1 +1 @@ -4624e3aee3651b0e57e6bf6ae6dd27ec \ No newline at end of file +82c0a98cce5027def9ffaed26c3bac43 \ No newline at end of file diff --git a/_x_b_o_x_o_l_d_8h__incl.map b/_x_b_o_x_o_l_d_8h__incl.map index becbba3c..33e489b5 100644 --- a/_x_b_o_x_o_l_d_8h__incl.map +++ b/_x_b_o_x_o_l_d_8h__incl.map @@ -1,4 +1,6 @@ - - + + + + diff --git a/_x_b_o_x_o_l_d_8h__incl.md5 b/_x_b_o_x_o_l_d_8h__incl.md5 index f13dfbe6..0d076c8d 100644 --- a/_x_b_o_x_o_l_d_8h__incl.md5 +++ b/_x_b_o_x_o_l_d_8h__incl.md5 @@ -1 +1 @@ -6940d62d40c6dde15fe74f063d6e1a3a \ No newline at end of file +dd156c3d5965e1290a24adfc14d297d7 \ No newline at end of file diff --git a/_x_b_o_x_o_l_d_8h__incl.png b/_x_b_o_x_o_l_d_8h__incl.png index 111db7ca..708e1e4f 100644 Binary files a/_x_b_o_x_o_l_d_8h__incl.png and b/_x_b_o_x_o_l_d_8h__incl.png differ diff --git a/_x_b_o_x_o_l_d_8h_source.html b/_x_b_o_x_o_l_d_8h_source.html index e60dfed7..954b0a15 100644 --- a/_x_b_o_x_o_l_d_8h_source.html +++ b/_x_b_o_x_o_l_d_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXOLD.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -110,139 +111,134 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
19 #define _xboxold_h_
20 
21 #include "Usb.h"
-
22 #include "controllerEnums.h"
-
23 
-
24 /* Data Xbox taken from descriptors */
-
25 #define EP_MAXPKTSIZE 32 // Max size for data via USB
-
26 
-
27 /* Endpoint types */
-
28 #define EP_INTERRUPT 0x03
-
29 
-
30 /* Names we give to the 3 Xbox pipes */
-
31 #define XBOX_CONTROL_PIPE 0
-
32 #define XBOX_INPUT_PIPE 1
-
33 #define XBOX_OUTPUT_PIPE 2
-
34 
-
35 // PID and VID of the different devices
-
36 #define XBOX_VID 0x045E // Microsoft Corporation
-
37 #define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers
-
38 #define JOYTECH_VID 0x162E // For unofficial Joytech controllers
-
39 
-
40 #define XBOX_OLD_PID1 0x0202 // Original Microsoft Xbox controller (US)
-
41 #define XBOX_OLD_PID2 0x0285 // Original Microsoft Xbox controller (Japan)
-
42 #define XBOX_OLD_PID3 0x0287 // Microsoft Microsoft Xbox Controller S
-
43 #define XBOX_OLD_PID4 0x0289 // Smaller Microsoft Xbox controller (US)
+
22 #include "hid.h"
+
23 #include "controllerEnums.h"
+
24 
+
25 /* Data Xbox taken from descriptors */
+
26 #define EP_MAXPKTSIZE 32 // Max size for data via USB
+
27 
+
28 /* Names we give to the 3 Xbox pipes */
+
29 #define XBOX_CONTROL_PIPE 0
+
30 #define XBOX_INPUT_PIPE 1
+
31 #define XBOX_OUTPUT_PIPE 2
+
32 
+
33 // PID and VID of the different devices
+
34 #define XBOX_VID 0x045E // Microsoft Corporation
+
35 #define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers
+
36 #define JOYTECH_VID 0x162E // For unofficial Joytech controllers
+
37 
+
38 #define XBOX_OLD_PID1 0x0202 // Original Microsoft Xbox controller (US)
+
39 #define XBOX_OLD_PID2 0x0285 // Original Microsoft Xbox controller (Japan)
+
40 #define XBOX_OLD_PID3 0x0287 // Microsoft Microsoft Xbox Controller S
+
41 #define XBOX_OLD_PID4 0x0289 // Smaller Microsoft Xbox controller (US)
+
42 
+
43 #define XBOX_MAX_ENDPOINTS 3
44 
-
45 // Used in control endpoint header for HID Commands
-
46 #define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
-
47 #define HID_REQUEST_SET_REPORT 0x09
-
48 
-
49 #define XBOX_MAX_ENDPOINTS 3
-
50 
-
52 class XBOXOLD : public USBDeviceConfig {
-
53 public:
-
58  XBOXOLD(USB *pUsb);
-
59 
-
68  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
-
73  virtual uint8_t Release();
-
78  virtual uint8_t Poll();
-
79 
-
84  virtual uint8_t GetAddress() {
-
85  return bAddress;
-
86  };
-
87 
-
92  virtual bool isReady() {
-
93  return bPollEnable;
-
94  };
-
95 
-
102  virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
-
103  return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID) && (pid == XBOX_OLD_PID1 || pid == XBOX_OLD_PID2 || pid == XBOX_OLD_PID3 || pid == XBOX_OLD_PID4));
-
104  };
-
118  uint8_t getButtonPress(ButtonEnum b);
-
119  bool getButtonClick(ButtonEnum b);
-
128  int16_t getAnalogHat(AnalogHatEnum a);
-
129 
-
131  void setRumbleOff() {
-
132  setRumbleOn(0, 0);
-
133  };
-
139  void setRumbleOn(uint8_t lValue, uint8_t rValue);
-
140 
-
145  void attachOnInit(void (*funcOnInit)(void)) {
-
146  pFuncOnInit = funcOnInit;
-
147  };
-
151  bool XboxConnected;
-
152 
-
153 protected:
-
155  USB *pUsb;
-
157  uint8_t bAddress;
-
159  EpInfo epInfo[XBOX_MAX_ENDPOINTS];
-
160 
-
161 private:
-
167  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
-
168 
-
169  bool bPollEnable;
-
170 
-
171  /* Variables to store the digital buttons */
-
172  uint8_t ButtonState;
-
173  uint8_t OldButtonState;
-
174  uint8_t ButtonClickState;
-
175 
-
176  /* Variables to store the analog buttons */
-
177  uint8_t buttonValues[8]; // A, B, X, Y, BLACK, WHITE, L1, and R1
-
178  uint8_t oldButtonValues[8];
-
179  bool buttonClicked[8];
-
180 
-
181  int16_t hatValue[4]; // Joystick values
-
182 
-
183  uint8_t readBuf[EP_MAXPKTSIZE]; // General purpose buffer for input data
-
184 
-
185  void readReport(); // Read incoming data
-
186  void printReport(uint16_t length); // Print incoming date
-
187 
-
188  /* Private commands */
-
189  void XboxCommand(uint8_t* data, uint16_t nbytes);
-
190 };
-
191 #endif
-
virtual uint8_t Release()
Definition: XBOXOLD.cpp:236
-
void attachOnInit(void(*funcOnInit)(void))
Definition: XBOXOLD.h:145
+
46 class XBOXOLD : public USBDeviceConfig {
+
47 public:
+
52  XBOXOLD(USB *pUsb);
+
53 
+
62  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
+
67  uint8_t Release();
+
72  uint8_t Poll();
+
73 
+
78  virtual uint8_t GetAddress() {
+
79  return bAddress;
+
80  };
+
81 
+
86  virtual bool isReady() {
+
87  return bPollEnable;
+
88  };
+
89 
+
96  virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
+
97  return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID) && (pid == XBOX_OLD_PID1 || pid == XBOX_OLD_PID2 || pid == XBOX_OLD_PID3 || pid == XBOX_OLD_PID4));
+
98  };
+
112  uint8_t getButtonPress(ButtonEnum b);
+
113  bool getButtonClick(ButtonEnum b);
+
122  int16_t getAnalogHat(AnalogHatEnum a);
+
123 
+
125  void setRumbleOff() {
+
126  setRumbleOn(0, 0);
+
127  };
+
133  void setRumbleOn(uint8_t lValue, uint8_t rValue);
+
134 
+
139  void attachOnInit(void (*funcOnInit)(void)) {
+
140  pFuncOnInit = funcOnInit;
+
141  };
+
145  bool XboxConnected;
+
146 
+
147 protected:
+
149  USB *pUsb;
+
151  uint8_t bAddress;
+
153  EpInfo epInfo[XBOX_MAX_ENDPOINTS];
+
154 
+
155 private:
+
161  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
+
162 
+
163  bool bPollEnable;
+
164 
+
165  /* Variables to store the digital buttons */
+
166  uint8_t ButtonState;
+
167  uint8_t OldButtonState;
+
168  uint8_t ButtonClickState;
+
169 
+
170  /* Variables to store the analog buttons */
+
171  uint8_t buttonValues[8]; // A, B, X, Y, BLACK, WHITE, L1, and R1
+
172  uint8_t oldButtonValues[8];
+
173  bool buttonClicked[8];
+
174 
+
175  int16_t hatValue[4]; // Joystick values
+
176 
+
177  uint8_t readBuf[EP_MAXPKTSIZE]; // General purpose buffer for input data
+
178 
+
179  void readReport(); // Read incoming data
+
180  void printReport(uint16_t length); // Print incoming date
+
181 
+
182  /* Private commands */
+
183  void XboxCommand(uint8_t* data, uint16_t nbytes);
+
184 };
+
185 #endif
+
uint8_t Release()
Definition: XBOXOLD.cpp:236
+
void attachOnInit(void(*funcOnInit)(void))
Definition: XBOXOLD.h:139
+
AnalogHatEnum
-
virtual uint8_t GetAddress()
Definition: XBOXOLD.h:84
-
Definition: UsbCore.h:119
+
virtual uint8_t GetAddress()
Definition: XBOXOLD.h:78
+
Definition: UsbCore.h:121
-
Definition: XBOXOLD.h:52
+
Definition: XBOXOLD.h:46
void setRumbleOn(uint8_t lValue, uint8_t rValue)
Definition: XBOXOLD.cpp:326
-
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: XBOXOLD.h:102
-
#define XBOX_OLD_PID4
Definition: XBOXOLD.h:43
-
virtual bool isReady()
Definition: XBOXOLD.h:92
-
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXOLD.h:159
+
#define XBOX_OLD_PID4
Definition: XBOXOLD.h:41
+
virtual bool isReady()
Definition: XBOXOLD.h:86
+
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXOLD.h:153
int16_t getAnalogHat(AnalogHatEnum a)
Definition: XBOXOLD.cpp:316
-
#define XBOX_VID
Definition: XBOXOLD.h:36
+
#define XBOX_VID
Definition: XBOXOLD.h:34
XBOXOLD(USB *pUsb)
Definition: XBOXOLD.cpp:47
-
#define XBOX_OLD_PID1
Definition: XBOXOLD.h:40
+
#define XBOX_OLD_PID1
Definition: XBOXOLD.h:38
Definition: address.h:32
ButtonEnum
-
#define JOYTECH_VID
Definition: XBOXOLD.h:38
-
USB * pUsb
Definition: XBOXOLD.h:155
-
virtual uint8_t Poll()
Definition: XBOXOLD.cpp:244
-
#define XBOX_OLD_PID2
Definition: XBOXOLD.h:41
-
#define MADCATZ_VID
Definition: XBOXOLD.h:37
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXOLD.cpp:62
-
#define XBOX_MAX_ENDPOINTS
Definition: XBOXOLD.h:49
-
#define XBOX_OLD_PID3
Definition: XBOXOLD.h:42
-
bool XboxConnected
Definition: XBOXOLD.h:147
-
Definition: UsbCore.h:190
+
#define JOYTECH_VID
Definition: XBOXOLD.h:36
+
USB * pUsb
Definition: XBOXOLD.h:149
+
uint8_t Poll()
Definition: XBOXOLD.cpp:244
+
#define XBOX_OLD_PID2
Definition: XBOXOLD.h:39
+
#define MADCATZ_VID
Definition: XBOXOLD.h:35
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXOLD.cpp:62
+
#define XBOX_MAX_ENDPOINTS
Definition: XBOXOLD.h:43
+
#define XBOX_OLD_PID3
Definition: XBOXOLD.h:40
+
bool XboxConnected
Definition: XBOXOLD.h:141
+
Definition: UsbCore.h:197
bool getButtonClick(ButtonEnum b)
Definition: XBOXOLD.cpp:301
-
void setRumbleOff()
Definition: XBOXOLD.h:131
+
void setRumbleOff()
Definition: XBOXOLD.h:125
uint8_t getButtonPress(ButtonEnum b)
Definition: XBOXOLD.cpp:294
-
uint8_t bAddress
Definition: XBOXOLD.h:157
-
#define EP_MAXPKTSIZE
Definition: XBOXOLD.h:25
+
uint8_t bAddress
Definition: XBOXOLD.h:151
+
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: XBOXOLD.h:96
+
#define EP_MAXPKTSIZE
Definition: XBOXOLD.h:26
diff --git a/_x_b_o_x_o_n_e_8cpp.html b/_x_b_o_x_o_n_e_8cpp.html new file mode 100644 index 00000000..95b7c608 --- /dev/null +++ b/_x_b_o_x_o_n_e_8cpp.html @@ -0,0 +1,111 @@ + + + + + + +USB Host Shield 2.0: XBOXONE.cpp File Reference + + + + + + + + + + + +
+
+ + + + + + +
+
USB Host Shield 2.0 +
+
+
+ + + + + + +
+
+ + +
+ +
+ + +
+
+
+
XBOXONE.cpp File Reference
+
+
+
#include "XBOXONE.h"
+
+Include dependency graph for XBOXONE.cpp:
+
+
+ + +
+
+

Go to the source code of this file.

+
+ + + + diff --git a/_x_b_o_x_o_n_e_8cpp__incl.map b/_x_b_o_x_o_n_e_8cpp__incl.map new file mode 100644 index 00000000..975bd31d --- /dev/null +++ b/_x_b_o_x_o_n_e_8cpp__incl.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/_x_b_o_x_o_n_e_8cpp__incl.md5 b/_x_b_o_x_o_n_e_8cpp__incl.md5 new file mode 100644 index 00000000..adfce4de --- /dev/null +++ b/_x_b_o_x_o_n_e_8cpp__incl.md5 @@ -0,0 +1 @@ +a31c4a2760319c972359266d1c3ccfe5 \ No newline at end of file diff --git a/_x_b_o_x_o_n_e_8cpp__incl.png b/_x_b_o_x_o_n_e_8cpp__incl.png new file mode 100644 index 00000000..48da411f Binary files /dev/null and b/_x_b_o_x_o_n_e_8cpp__incl.png differ diff --git a/_x_b_o_x_o_n_e_8cpp_source.html b/_x_b_o_x_o_n_e_8cpp_source.html new file mode 100644 index 00000000..c9bd571d --- /dev/null +++ b/_x_b_o_x_o_n_e_8cpp_source.html @@ -0,0 +1,544 @@ + + + + + + +USB Host Shield 2.0: XBOXONE.cpp Source File + + + + + + + + + + + +
+
+ + + + + + +
+
USB Host Shield 2.0 +
+
+
+ + + + + + +
+
+ + +
+ +
+ + +
+
+
+
XBOXONE.cpp
+
+
+Go to the documentation of this file.
1 /* Copyright (C) 2012 Kristian Lauszus, TKJ Electronics. All rights reserved.
+
2  Copyright (C) 2015 guruthree
+
3 
+
4  This software may be distributed and modified under the terms of the GNU
+
5  General Public License version 2 (GPL2) as published by the Free Software
+
6  Foundation and appearing in the file GPL2.TXT included in the packaging of
+
7  this file. Please note that GPL2 Section 2[b] requires that all works based
+
8  on this software must also be made publicly available under the terms of
+
9  the GPL2 ("Copyleft").
+
10 
+
11  Contact information
+
12  -------------------
+
13 
+
14  Kristian Lauszus, TKJ Electronics
+
15  Web : http://www.tkjelectronics.com
+
16  e-mail : kristianl@tkjelectronics.com
+
17 
+
18  guruthree
+
19  Web : https://github.com/guruthree/
+
20  */
+
21 
+
22 #include "XBOXONE.h"
+
23 // To enable serial debugging see "settings.h"
+
24 //#define EXTRADEBUG // Uncomment to get even more debugging data
+
25 //#define PRINTREPORT // Uncomment to print the report send by the Xbox ONE Controller
+
26 
+ +
28 pUsb(p), // pointer to USB class instance - mandatory
+
29 bAddress(0), // device address - mandatory
+
30 bPollEnable(false) { // don't start polling before dongle is connected
+
31  for(uint8_t i = 0; i < XBOX_MAX_ENDPOINTS; i++) {
+
32  epInfo[i].epAddr = 0;
+
33  epInfo[i].maxPktSize = (i) ? 0 : 8;
+
34  epInfo[i].epAttribs = 0;
+ +
36  }
+
37 
+
38  if(pUsb) // register in USB subsystem
+
39  pUsb->RegisterDeviceClass(this); //set devConfig[] entry
+
40 }
+
41 
+
42 uint8_t XBOXONE::Init(uint8_t parent, uint8_t port, bool lowspeed) {
+
43  uint8_t buf[sizeof (USB_DEVICE_DESCRIPTOR)];
+
44  USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
+
45  uint8_t rcode;
+
46  UsbDevice *p = NULL;
+
47  EpInfo *oldep_ptr = NULL;
+
48  uint16_t PID;
+
49  uint16_t VID;
+
50 
+
51  // get memory address of USB device address pool
+
52  AddressPool &addrPool = pUsb->GetAddressPool();
+
53 #ifdef EXTRADEBUG
+
54  Notify(PSTR("\r\nXBOXONE Init"), 0x80);
+
55 #endif
+
56  // check if address has already been assigned to an instance
+
57  if(bAddress) {
+
58 #ifdef DEBUG_USB_HOST
+
59  Notify(PSTR("\r\nAddress in use"), 0x80);
+
60 #endif
+ +
62  }
+
63 
+
64  // Get pointer to pseudo device with address 0 assigned
+
65  p = addrPool.GetUsbDevicePtr(0);
+
66 
+
67  if(!p) {
+
68 #ifdef DEBUG_USB_HOST
+
69  Notify(PSTR("\r\nAddress not found"), 0x80);
+
70 #endif
+ +
72  }
+
73 
+
74  if(!p->epinfo) {
+
75 #ifdef DEBUG_USB_HOST
+
76  Notify(PSTR("\r\nepinfo is null"), 0x80);
+
77 #endif
+ +
79  }
+
80 
+
81  // Save old pointer to EP_RECORD of address 0
+
82  oldep_ptr = p->epinfo;
+
83 
+
84  // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence
+
85  p->epinfo = epInfo;
+
86 
+
87  p->lowspeed = lowspeed;
+
88 
+
89  // Get device descriptor
+
90  rcode = pUsb->getDevDescr(0, 0, sizeof (USB_DEVICE_DESCRIPTOR), (uint8_t*)buf); // Get device descriptor - addr, ep, nbytes, data
+
91  // Restore p->epinfo
+
92  p->epinfo = oldep_ptr;
+
93 
+
94  if(rcode)
+
95  goto FailGetDevDescr;
+
96 
+
97  VID = udd->idVendor;
+
98  PID = udd->idProduct;
+
99 
+
100  if(!VIDPIDOK(VID, PID)) // Check VID
+
101  goto FailUnknownDevice;
+
102 
+
103  // Allocate new address according to device class
+
104  bAddress = addrPool.AllocAddress(parent, false, port);
+
105 
+
106  if(!bAddress)
+ +
108 
+
109  // Extract Max Packet Size from device descriptor
+
110  epInfo[0].maxPktSize = udd->bMaxPacketSize0;
+
111 
+
112  // Assign new address to the device
+
113  rcode = pUsb->setAddr(0, 0, bAddress);
+
114  if(rcode) {
+
115  p->lowspeed = false;
+
116  addrPool.FreeAddress(bAddress);
+
117  bAddress = 0;
+
118 #ifdef DEBUG_USB_HOST
+
119  Notify(PSTR("\r\nsetAddr: "), 0x80);
+
120  D_PrintHex<uint8_t > (rcode, 0x80);
+
121 #endif
+
122  return rcode;
+
123  }
+
124 #ifdef EXTRADEBUG
+
125  Notify(PSTR("\r\nAddr: "), 0x80);
+
126  D_PrintHex<uint8_t > (bAddress, 0x80);
+
127 #endif
+
128  //delay(300); // Spec says you should wait at least 200ms
+
129 
+
130  p->lowspeed = false;
+
131 
+
132  //get pointer to assigned address record
+
133  p = addrPool.GetUsbDevicePtr(bAddress);
+
134  if(!p)
+ +
136 
+
137  p->lowspeed = lowspeed;
+
138 
+
139  // Assign epInfo to epinfo pointer - only EP0 is known
+
140  rcode = pUsb->setEpInfoEntry(bAddress, 1, epInfo);
+
141  if(rcode)
+
142  goto FailSetDevTblEntry;
+
143 
+
144  /* The application will work in reduced host mode, so we can save program and data
+
145  memory space. After verifying the VID we will use known values for the
+
146  configuration values for device, interface, endpoints and HID for the XBOXONE Controllers */
+
147 
+
148  /* Initialize data structures for endpoints of device */
+
149  epInfo[ XBOX_OUTPUT_PIPE ].epAddr = 0x01; // XBOX one output endpoint
+ +
151  epInfo[ XBOX_OUTPUT_PIPE ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
+ + + +
155  epInfo[ XBOX_INPUT_PIPE ].epAddr = 0x01; // XBOX one input endpoint
+ +
157  epInfo[ XBOX_INPUT_PIPE ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
+ + + +
161 
+
162  rcode = pUsb->setEpInfoEntry(bAddress, 3, epInfo);
+
163  if(rcode)
+
164  goto FailSetDevTblEntry;
+
165 
+
166  delay(200); // Give time for address change
+
167 
+
168  rcode = pUsb->setConf(bAddress, epInfo[ XBOX_CONTROL_PIPE ].epAddr, 1);
+
169  if(rcode)
+
170  goto FailSetConfDescr;
+
171 
+
172 #ifdef DEBUG_USB_HOST
+
173  Notify(PSTR("\r\nXbox One Controller Connected\r\n"), 0x80);
+
174 #endif
+
175 
+
176  delay(200); // let things settle
+
177 
+
178  // initialize the controller for input
+
179  writeBuf[0] = 0x05;
+
180  writeBuf[1] = 0x20;
+
181  rcode = XboxCommand(writeBuf, 2);
+
182  if (rcode)
+
183  goto Fail;
+
184 
+
185  onInit();
+
186  XboxOneConnected = true;
+
187  bPollEnable = true;
+
188  return 0; // Successful configuration
+
189 
+
190  /* Diagnostic messages */
+
191 FailGetDevDescr:
+
192 #ifdef DEBUG_USB_HOST
+ +
194  goto Fail;
+
195 #endif
+
196 
+
197 FailSetDevTblEntry:
+
198 #ifdef DEBUG_USB_HOST
+ +
200  goto Fail;
+
201 #endif
+
202 
+
203 FailSetConfDescr:
+
204 #ifdef DEBUG_USB_HOST
+ +
206 #endif
+
207  goto Fail;
+
208 
+
209 FailUnknownDevice:
+
210 #ifdef DEBUG_USB_HOST
+
211  NotifyFailUnknownDevice(VID, PID);
+
212 #endif
+ +
214 
+
215 Fail:
+
216 #ifdef DEBUG_USB_HOST
+
217  Notify(PSTR("\r\nXbox One Init Failed, error code: "), 0x80);
+
218  NotifyFail(rcode);
+
219 #endif
+
220  Release();
+
221  return rcode;
+
222 }
+
223 
+
224 /* Performs a cleanup after failed Init() attempt */
+
225 uint8_t XBOXONE::Release() {
+
226  XboxOneConnected = false;
+ +
228  bAddress = 0;
+
229  bPollEnable = false;
+
230 #ifdef DEBUG_USB_HOST
+
231  Notify(PSTR("\r\nXbox One Controller Disconnected\r\n"), 0x80);
+
232 #endif
+
233  return 0;
+
234 }
+
235 
+
236 uint8_t XBOXONE::Poll() {
+
237  if(!bPollEnable)
+
238  return 0;
+
239  uint16_t BUFFER_SIZE = EP_MAXPKTSIZE;
+
240  uint8_t rcode = pUsb->inTransfer(bAddress, epInfo[ XBOX_INPUT_PIPE ].epAddr, &BUFFER_SIZE, readBuf);
+
241  if (!rcode) {
+
242  readReport();
+
243 #ifdef PRINTREPORT
+
244  printReport(); // Uncomment "#define PRINTREPORT" to print the report send by the Xbox ONE Controller
+
245 #endif
+
246  }
+
247 #ifdef DEBUG_USB_HOST
+
248  else if (rcode != 0x04) { // not a matter of no update to send
+
249  Notify(PSTR("\r\nXbox One Poll Failed, error code: "), 0x80);
+
250  NotifyFail(rcode);
+
251  }
+
252 #endif
+
253  return rcode;
+
254 }
+
255 
+
256 void XBOXONE::readReport() {
+
257  if(readBuf == NULL)
+
258  return;
+
259  if(readBuf[0] == 0x07) {
+
260  // The XBOX button has a separate message
+
261  if(readBuf[4] == 1)
+
262  ButtonState |= XBOX_BUTTONS[XBOX];
+
263  else
+
264  ButtonState &= ~XBOX_BUTTONS[XBOX];
+
265  }
+
266  if(readBuf[0] != 0x20) { // Check if it's the correct report, otherwise return - the controller also sends different status reports
+
267 #ifdef EXTRADEBUG
+
268  Notify(PSTR("\r\nXbox Poll: "), 0x80);
+
269  D_PrintHex<uint8_t > (readBuf[0], 0x80); // 0x03 is a heart beat report!
+
270 #endif
+
271  return;
+
272  }
+
273 
+
274  uint16_t xbox = ButtonState & XBOX_BUTTONS[XBOX]; // Since the XBOX button is separate, save it and add it back in
+
275  // xbox button from before, dpad, abxy, start/back, sync, stick click, shoulder buttons
+
276  ButtonState = xbox | (((uint16_t)readBuf[5] & 0xF) << 8) | (readBuf[4] & 0xF0) | (((uint16_t)readBuf[4] & 0x0C) << 10) | ((readBuf[4] & 0x01) << 3) | (((uint16_t)readBuf[5] & 0xC0) << 8) | ((readBuf[5] & 0x30) >> 4);
+
277 
+
278  triggerValue[0] = (uint16_t)(((uint16_t)readBuf[7] << 8) | readBuf[6]);
+
279  triggerValue[1] = (uint16_t)(((uint16_t)readBuf[9] << 8) | readBuf[8]);
+
280 
+
281  hatValue[LeftHatX] = (int16_t)(((uint16_t)readBuf[11] << 8) | readBuf[10]);
+
282  hatValue[LeftHatY] = (int16_t)(((uint16_t)readBuf[13] << 8) | readBuf[12]);
+
283  hatValue[RightHatX] = (int16_t)(((uint16_t)readBuf[15] << 8) | readBuf[14]);
+
284  hatValue[RightHatY] = (int16_t)(((uint16_t)readBuf[17] << 8) | readBuf[16]);
+
285 
+
286  //Notify(PSTR("\r\nButtonState"), 0x80);
+
287  //PrintHex<uint16_t>(ButtonState, 0x80);
+
288 
+
289  if(ButtonState != OldButtonState) {
+
290  ButtonClickState = ButtonState & ~OldButtonState; // Update click state variable
+
291  OldButtonState = ButtonState;
+
292  }
+
293 
+
294  // Handle click detection for triggers
+
295  if(triggerValue[0] != 0 && triggerValueOld[0] == 0)
+
296  L2Clicked = true;
+
297  triggerValueOld[0] = triggerValue[0];
+
298  if(triggerValue[1] != 0 && triggerValueOld[1] == 0)
+
299  R2Clicked = true;
+
300  triggerValueOld[1] = triggerValue[1];
+
301 }
+
302 
+
303 void XBOXONE::printReport() { //Uncomment "#define PRINTREPORT" to print the report send by the Xbox ONE Controller
+
304 #ifdef PRINTREPORT
+
305  if(readBuf == NULL)
+
306  return;
+
307  for(uint8_t i = 0; i < XBOX_REPORT_BUFFER_SIZE; i++) {
+
308  D_PrintHex<uint8_t > (readBuf[i], 0x80);
+
309  Notify(PSTR(" "), 0x80);
+
310  }
+
311  Notify(PSTR("\r\n"), 0x80);
+
312 #endif
+
313 }
+
314 
+ +
316  if(b == L2) // These are analog buttons
+
317  return triggerValue[0];
+
318  else if(b == R2)
+
319  return triggerValue[1];
+
320  return (bool)(ButtonState & ((uint16_t)pgm_read_word(&XBOX_BUTTONS[(uint8_t)b])));
+
321 }
+
322 
+ +
324  if(b == L2) {
+
325  if(L2Clicked) {
+
326  L2Clicked = false;
+
327  return true;
+
328  }
+
329  return false;
+
330  } else if(b == R2) {
+
331  if(R2Clicked) {
+
332  R2Clicked = false;
+
333  return true;
+
334  }
+
335  return false;
+
336  }
+
337  uint16_t button = pgm_read_word(&XBOX_BUTTONS[(uint8_t)b]);
+
338  bool click = (ButtonClickState & button);
+
339  ButtonClickState &= ~button; // clear "click" event
+
340  return click;
+
341 }
+
342 
+ +
344  return hatValue[a];
+
345 }
+
346 
+
347 /* Xbox Controller commands */
+
348 uint8_t XBOXONE::XboxCommand(uint8_t* data, uint16_t nbytes) {
+
349  uint8_t rcode = pUsb->outTransfer(bAddress, epInfo[ XBOX_OUTPUT_PIPE ].epAddr, nbytes, data);
+
350 #ifdef DEBUG_USB_HOST
+
351  Notify(PSTR("\r\nXboxCommand, Return: "), 0x80);
+
352  D_PrintHex<uint8_t > (rcode, 0x80);
+
353 #endif
+
354  return rcode;
+
355 }
+
356 
+
357 void XBOXONE::onInit() {
+
358  // a short buzz to show the controller is active
+
359  writeBuf[0] = 0x09;
+
360  writeBuf[1] = 0x08;
+
361  writeBuf[2] = 0x00;
+
362  writeBuf[3] = 0x09;
+
363  writeBuf[4] = 0x00;
+
364  writeBuf[5] = 0x0f;
+
365  writeBuf[6] = 0x04;
+
366  writeBuf[7] = 0x04;
+
367  writeBuf[8] = 0x20;
+
368  writeBuf[9] = 0x20;
+
369  writeBuf[10] = 0x80;
+
370  XboxCommand(writeBuf, 11);
+
371 
+
372  if(pFuncOnInit)
+
373  pFuncOnInit(); // Call the user function
+
374 }
+
uint8_t bmRcvToggle
Definition: address.h:41
+ + +
EpInfo * epinfo
Definition: address.h:76
+
bool lowspeed
Definition: address.h:79
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
+
uint8_t bmNakPower
Definition: address.h:42
+ +
#define pgm_read_word(addr)
+
USB * pUsb
Definition: XBOXONE.h:136
+
#define NotifyFail(...)
Definition: message.h:55
+
AnalogHatEnum
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
+
uint8_t bAddress
Definition: XBOXONE.h:138
+
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXONE.h:140
+
XBOXONE(USB *pUsb)
Definition: XBOXONE.cpp:27
+
#define USB_TRANSFER_TYPE_INTERRUPT
Definition: usb_ch9.h:86
+
#define NotifyFailGetDevDescr(...)
Definition: message.h:50
+
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
+
#define EP_MAXPKTSIZE
Definition: PS3USB.h:26
+
virtual void FreeAddress(uint8_t addr)=0
+
uint8_t epAttribs
Definition: address.h:37
+
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
+
#define Notify(...)
Definition: message.h:44
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
+
uint8_t epAddr
Definition: address.h:33
+
bool XboxOneConnected
Definition: XBOXONE.h:128
+
#define NotifyFailUnknownDevice(...)
Definition: message.h:54
+
#define USB_NAK_MAX_POWER
Definition: address.h:27
+
virtual uint8_t Release()
Definition: XBOXONE.cpp:225
+
#define XBOX_INPUT_PIPE
Definition: XBOXOLD.h:30
+ +
Definition: address.h:32
+
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
Definition: Usb.cpp:292
+
ButtonEnum
+
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: XBOXONE.h:96
+ +
uint16_t getButtonPress(ButtonEnum b)
Definition: XBOXONE.cpp:315
+
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
+
uint8_t bmSndToggle
Definition: address.h:40
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
+
#define PSTR(str)
+ +
bool getButtonClick(ButtonEnum b)
Definition: XBOXONE.cpp:323
+
virtual uint8_t Poll()
Definition: XBOXONE.cpp:236
+
#define XBOX_OUTPUT_PIPE
Definition: XBOXOLD.h:31
+
#define USB_NAK_NOWAIT
Definition: address.h:29
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
+
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
Definition: Usb.cpp:206
+
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:77
+
#define XBOX_MAX_ENDPOINTS
Definition: XBOXOLD.h:43
+
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXONE.cpp:42
+
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:80
+
uint8_t maxPktSize
Definition: address.h:34
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
Definition: UsbCore.h:197
+
#define XBOX_CONTROL_PIPE
Definition: XBOXOLD.h:29
+ +
int16_t getAnalogHat(AnalogHatEnum a)
Definition: XBOXONE.cpp:343
+ + +
const uint16_t XBOX_BUTTONS[]
Definition: xboxEnums.h:41
+
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:217
+
#define NotifyFailSetConfDescr(...)
Definition: message.h:53
+
#define XBOX_REPORT_BUFFER_SIZE
Definition: XBOXONE.h:41
+ +
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
+
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:51
+ +
+ + + + diff --git a/_x_b_o_x_o_n_e_8h.html b/_x_b_o_x_o_n_e_8h.html new file mode 100644 index 00000000..902621b7 --- /dev/null +++ b/_x_b_o_x_o_n_e_8h.html @@ -0,0 +1,260 @@ + + + + + + +USB Host Shield 2.0: XBOXONE.h File Reference + + + + + + + + + + + +
+
+ + + + + + +
+
USB Host Shield 2.0 +
+
+
+ + + + + + +
+
+ + +
+ +
+ + +
+
+
+Classes | +Macros
+
+
XBOXONE.h File Reference
+
+
+
#include "Usb.h"
+#include "xboxEnums.h"
+
+Include dependency graph for XBOXONE.h:
+
+
+ + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + +
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  XBOXONE
 
+ + + + + + + + + + + + + + + + + +

+Macros

#define EP_MAXPKTSIZE   32
 
#define XBOX_CONTROL_PIPE   0
 
#define XBOX_OUTPUT_PIPE   1
 
#define XBOX_INPUT_PIPE   2
 
#define XBOX_VID   0x045E
 
#define XBOX_ONE_PID   0x02D1
 
#define XBOX_REPORT_BUFFER_SIZE   14
 
#define XBOX_MAX_ENDPOINTS   3
 
+

Macro Definition Documentation

+ +
+
+ + + + +
#define EP_MAXPKTSIZE   32
+
+ +

Definition at line 30 of file XBOXONE.h.

+ +
+
+ +
+
+ + + + +
#define XBOX_CONTROL_PIPE   0
+
+ +

Definition at line 33 of file XBOXONE.h.

+ +
+
+ +
+
+ + + + +
#define XBOX_OUTPUT_PIPE   1
+
+ +

Definition at line 34 of file XBOXONE.h.

+ +
+
+ +
+
+ + + + +
#define XBOX_INPUT_PIPE   2
+
+ +

Definition at line 35 of file XBOXONE.h.

+ +
+
+ +
+
+ + + + +
#define XBOX_VID   0x045E
+
+ +

Definition at line 38 of file XBOXONE.h.

+ +
+
+ +
+
+ + + + +
#define XBOX_ONE_PID   0x02D1
+
+ +

Definition at line 39 of file XBOXONE.h.

+ +
+
+ +
+
+ + + + +
#define XBOX_REPORT_BUFFER_SIZE   14
+
+ +

Definition at line 41 of file XBOXONE.h.

+ +
+
+ +
+
+ + + + +
#define XBOX_MAX_ENDPOINTS   3
+
+ +

Definition at line 43 of file XBOXONE.h.

+ +
+
+
+ + + + diff --git a/_x_b_o_x_o_n_e_8h__dep__incl.map b/_x_b_o_x_o_n_e_8h__dep__incl.map new file mode 100644 index 00000000..ece7b3d2 --- /dev/null +++ b/_x_b_o_x_o_n_e_8h__dep__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/_x_b_o_x_o_n_e_8h__dep__incl.md5 b/_x_b_o_x_o_n_e_8h__dep__incl.md5 new file mode 100644 index 00000000..c13f788f --- /dev/null +++ b/_x_b_o_x_o_n_e_8h__dep__incl.md5 @@ -0,0 +1 @@ +fd61d6c8f3280fcb7695abf658ecef71 \ No newline at end of file diff --git a/_x_b_o_x_o_n_e_8h__dep__incl.png b/_x_b_o_x_o_n_e_8h__dep__incl.png new file mode 100644 index 00000000..9ddbb2a6 Binary files /dev/null and b/_x_b_o_x_o_n_e_8h__dep__incl.png differ diff --git a/_x_b_o_x_o_n_e_8h__incl.map b/_x_b_o_x_o_n_e_8h__incl.map new file mode 100644 index 00000000..f75f1482 --- /dev/null +++ b/_x_b_o_x_o_n_e_8h__incl.map @@ -0,0 +1,5 @@ + + + + + diff --git a/_x_b_o_x_o_n_e_8h__incl.md5 b/_x_b_o_x_o_n_e_8h__incl.md5 new file mode 100644 index 00000000..14781353 --- /dev/null +++ b/_x_b_o_x_o_n_e_8h__incl.md5 @@ -0,0 +1 @@ +0dde0ce6aa02e651aff1df3147ecf48a \ No newline at end of file diff --git a/_x_b_o_x_o_n_e_8h__incl.png b/_x_b_o_x_o_n_e_8h__incl.png new file mode 100644 index 00000000..5b9e6491 Binary files /dev/null and b/_x_b_o_x_o_n_e_8h__incl.png differ diff --git a/_x_b_o_x_o_n_e_8h_source.html b/_x_b_o_x_o_n_e_8h_source.html new file mode 100644 index 00000000..0129a6dc --- /dev/null +++ b/_x_b_o_x_o_n_e_8h_source.html @@ -0,0 +1,233 @@ + + + + + + +USB Host Shield 2.0: XBOXONE.h Source File + + + + + + + + + + + +
+
+ + + + + + +
+
USB Host Shield 2.0 +
+
+
+ + + + + + +
+
+ + +
+ +
+ + +
+
+
+
XBOXONE.h
+
+
+Go to the documentation of this file.
1 /* Copyright (C) 2012 Kristian Lauszus, TKJ Electronics. All rights reserved.
+
2  Copyright (C) 2015 guruthree
+
3 
+
4  This software may be distributed and modified under the terms of the GNU
+
5  General Public License version 2 (GPL2) as published by the Free Software
+
6  Foundation and appearing in the file GPL2.TXT included in the packaging of
+
7  this file. Please note that GPL2 Section 2[b] requires that all works based
+
8  on this software must also be made publicly available under the terms of
+
9  the GPL2 ("Copyleft").
+
10 
+
11  Contact information
+
12  -------------------
+
13 
+
14  Kristian Lauszus, TKJ Electronics
+
15  Web : http://www.tkjelectronics.com
+
16  e-mail : kristianl@tkjelectronics.com
+
17 
+
18  guruthree
+
19  Web : https://github.com/guruthree/
+
20  */
+
21 
+
22 
+
23 #ifndef _xboxone_h_
+
24 #define _xboxone_h_
+
25 
+
26 #include "Usb.h"
+
27 #include "xboxEnums.h"
+
28 
+
29 /* Data Xbox ONE taken from descriptors */
+
30 #define EP_MAXPKTSIZE 32 // max size for data via USB
+
31 
+
32 /* Names we give to the 3 XboxONE pipes */
+
33 #define XBOX_CONTROL_PIPE 0
+
34 #define XBOX_OUTPUT_PIPE 1
+
35 #define XBOX_INPUT_PIPE 2
+
36 
+
37 // PID and VID of the different devices
+
38 #define XBOX_VID 0x045E // Microsoft Corporation
+
39 #define XBOX_ONE_PID 0x02D1 // Microsoft One Wired controller
+
40 
+
41 #define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer
+
42 
+
43 #define XBOX_MAX_ENDPOINTS 3
+
44 
+
46 class XBOXONE : public USBDeviceConfig {
+
47 public:
+
52  XBOXONE(USB *pUsb);
+
53 
+
62  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
+
67  virtual uint8_t Release();
+
72  virtual uint8_t Poll();
+
73 
+
78  virtual uint8_t GetAddress() {
+
79  return bAddress;
+
80  };
+
81 
+
86  virtual bool isReady() {
+
87  return bPollEnable;
+
88  };
+
89 
+
96  virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
+
97  return (vid == XBOX_VID && pid == XBOX_ONE_PID);
+
98  };
+
112  uint16_t getButtonPress(ButtonEnum b);
+
113  bool getButtonClick(ButtonEnum b);
+
114 
+
120  int16_t getAnalogHat(AnalogHatEnum a);
+
121 
+
126  void attachOnInit(void (*funcOnInit)(void)) {
+
127  pFuncOnInit = funcOnInit;
+
128  };
+
132  bool XboxOneConnected;
+
133 
+
134 protected:
+ +
138  uint8_t bAddress;
+ +
141 
+
142 private:
+
147  void onInit();
+
148  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
+
149 
+
150  bool bPollEnable;
+
151 
+
152  /* Variables to store the buttons */
+
153  uint16_t ButtonState;
+
154  uint16_t OldButtonState;
+
155  uint16_t ButtonClickState;
+
156  int16_t hatValue[4];
+
157  uint16_t triggerValue[2];
+
158  uint16_t triggerValueOld[2];
+
159 
+
160  bool L2Clicked; // These buttons are analog, so we use we use these bools to check if they where clicked or not
+
161  bool R2Clicked;
+
162 
+
163  uint8_t readBuf[EP_MAXPKTSIZE]; // General purpose buffer for input data
+
164  uint8_t writeBuf[12]; // General purpose buffer for output data
+
165 
+
166  void readReport(); // read incoming data
+
167  void printReport(); // print incoming date - Uncomment for debugging
+
168 
+
169  /* Private commands */
+
170  uint8_t XboxCommand(uint8_t* data, uint16_t nbytes);
+
171 };
+
172 #endif
+ +
virtual bool isReady()
Definition: XBOXONE.h:86
+
#define XBOX_VID
Definition: XBOXONE.h:38
+
USB * pUsb
Definition: XBOXONE.h:136
+
void attachOnInit(void(*funcOnInit)(void))
Definition: XBOXONE.h:126
+
AnalogHatEnum
+
uint8_t bAddress
Definition: XBOXONE.h:138
+
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXONE.h:140
+
XBOXONE(USB *pUsb)
Definition: XBOXONE.cpp:27
+ + +
#define XBOX_MAX_ENDPOINTS
Definition: XBOXONE.h:43
+
bool XboxOneConnected
Definition: XBOXONE.h:128
+
virtual uint8_t Release()
Definition: XBOXONE.cpp:225
+
Definition: address.h:32
+
ButtonEnum
+
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: XBOXONE.h:96
+
uint16_t getButtonPress(ButtonEnum b)
Definition: XBOXONE.cpp:315
+
virtual uint8_t GetAddress()
Definition: XBOXONE.h:78
+
#define EP_MAXPKTSIZE
Definition: XBOXONE.h:30
+
bool getButtonClick(ButtonEnum b)
Definition: XBOXONE.cpp:323
+
virtual uint8_t Poll()
Definition: XBOXONE.cpp:236
+
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXONE.cpp:42
+
Definition: UsbCore.h:197
+
int16_t getAnalogHat(AnalogHatEnum a)
Definition: XBOXONE.cpp:343
+
#define XBOX_ONE_PID
Definition: XBOXONE.h:39
+ +
+ + + + diff --git a/_x_b_o_x_r_e_c_v_8cpp.html b/_x_b_o_x_r_e_c_v_8cpp.html index d7d69cbe..b5299107 100644 --- a/_x_b_o_x_r_e_c_v_8cpp.html +++ b/_x_b_o_x_r_e_c_v_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXRECV.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -104,7 +105,7 @@ Include dependency graph for XBOXRECV.cpp:
diff --git a/_x_b_o_x_r_e_c_v_8cpp__incl.md5 b/_x_b_o_x_r_e_c_v_8cpp__incl.md5 index 1c1fdc93..b0488834 100644 --- a/_x_b_o_x_r_e_c_v_8cpp__incl.md5 +++ b/_x_b_o_x_r_e_c_v_8cpp__incl.md5 @@ -1 +1 @@ -bfbd5b9c880d6b279e7fd3a120aaed59 \ No newline at end of file +afd0356fb2e414737dbcea38c7c8282b \ No newline at end of file diff --git a/_x_b_o_x_r_e_c_v_8cpp_source.html b/_x_b_o_x_r_e_c_v_8cpp_source.html index c97739c6..a55260fb 100644 --- a/_x_b_o_x_r_e_c_v_8cpp_source.html +++ b/_x_b_o_x_r_e_c_v_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXRECV.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -139,12 +140,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
48 
49  AddressPool &addrPool = pUsb->GetAddressPool(); // Get memory address of USB device address pool
50 #ifdef EXTRADEBUG
-
51  Notify(PSTR("\r\nXBOXRECV Init"), 0x80);
+
51  Notify(PSTR("\r\nXBOXRECV Init"), 0x80);
52 #endif
53 
54  if(bAddress) { // Check if address has already been assigned to an instance
55 #ifdef DEBUG_USB_HOST
-
56  Notify(PSTR("\r\nAddress in use"), 0x80);
+
56  Notify(PSTR("\r\nAddress in use"), 0x80);
57 #endif
58  return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE;
59  }
@@ -153,14 +154,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
62 
63  if(!p) {
64 #ifdef DEBUG_USB_HOST
-
65  Notify(PSTR("\r\nAddress not found"), 0x80);
+
65  Notify(PSTR("\r\nAddress not found"), 0x80);
66 #endif
67  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
68  }
69 
70  if(!p->epinfo) {
71 #ifdef DEBUG_USB_HOST
-
72  Notify(PSTR("\r\nepinfo is null"), 0x80);
+
72  Notify(PSTR("\r\nepinfo is null"), 0x80);
73 #endif
74  return USB_ERROR_EPINFO_IS_NULL;
75  }
@@ -181,7 +182,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
90 
91  if((VID != XBOX_VID && VID != MADCATZ_VID && VID != JOYTECH_VID) || (PID != XBOX_WIRELESS_RECEIVER_PID && PID != XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID)) { // Check if it's a Xbox receiver using the Vendor ID and Product ID
92 #ifdef DEBUG_USB_HOST
-
93  Notify(PSTR("\r\nYou'll need a wireless receiver for this libary to work"), 0x80);
+
93  Notify(PSTR("\r\nYou'll need a wireless receiver for this libary to work"), 0x80);
94 #endif
95  goto FailUnknownDevice;
96  }
@@ -190,7 +191,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
99 
100  if(!bAddress) {
101 #ifdef DEBUG_USB_HOST
-
102  Notify(PSTR("\r\nOut of address space"), 0x80);
+
102  Notify(PSTR("\r\nOut of address space"), 0x80);
103 #endif
104  return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL;
105  }
@@ -218,7 +219,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
127 
128 Fail:
129 #ifdef DEBUG_USB_HOST
-
130  Notify(PSTR("\r\nXbox 360 Init Failed, error code: "), 0x80);
+
130  Notify(PSTR("\r\nXbox 360 Init Failed, error code: "), 0x80);
131  NotifyFail(rcode);
132 #endif
133  Release();
@@ -230,13 +231,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
139 
140  AddressPool &addrPool = pUsb->GetAddressPool();
141 #ifdef EXTRADEBUG
-
142  Notify(PSTR("\r\nBTD Init"), 0x80);
+
142  Notify(PSTR("\r\nBTD Init"), 0x80);
143 #endif
144  UsbDevice *p = addrPool.GetUsbDevicePtr(bAddress); // Get pointer to assigned address record
145 
146  if(!p) {
147 #ifdef DEBUG_USB_HOST
-
148  Notify(PSTR("\r\nAddress not found"), 0x80);
+
148  Notify(PSTR("\r\nAddress not found"), 0x80);
149 #endif
150  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
151  }
@@ -246,14 +247,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
155  rcode = pUsb->setAddr(0, 0, bAddress); // Assign new address to the device
156  if(rcode) {
157 #ifdef DEBUG_USB_HOST
-
158  Notify(PSTR("\r\nsetAddr: "), 0x80);
+
158  Notify(PSTR("\r\nsetAddr: "), 0x80);
159  D_PrintHex<uint8_t > (rcode, 0x80);
160 #endif
161  p->lowspeed = false;
162  goto Fail;
163  }
164 #ifdef EXTRADEBUG
-
165  Notify(PSTR("\r\nAddr: "), 0x80);
+
165  Notify(PSTR("\r\nAddr: "), 0x80);
166  D_PrintHex<uint8_t > (bAddress, 0x80);
167 #endif
168 
@@ -262,7 +263,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
171  p = addrPool.GetUsbDevicePtr(bAddress); // Get pointer to assigned address record
172  if(!p) {
173 #ifdef DEBUG_USB_HOST
-
174  Notify(PSTR("\r\nAddress not found"), 0x80);
+
174  Notify(PSTR("\r\nAddress not found"), 0x80);
175 #endif
176  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
177  }
@@ -279,52 +280,52 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
188 
189  /* Initialize data structures for endpoints of device */
190  epInfo[ XBOX_INPUT_PIPE_1 ].epAddr = 0x01; // XBOX 360 report endpoint - poll interval 1ms
-
191  epInfo[ XBOX_INPUT_PIPE_1 ].epAttribs = EP_INTERRUPT;
+
191  epInfo[ XBOX_INPUT_PIPE_1 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
192  epInfo[ XBOX_INPUT_PIPE_1 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
193  epInfo[ XBOX_INPUT_PIPE_1 ].maxPktSize = EP_MAXPKTSIZE;
194  epInfo[ XBOX_INPUT_PIPE_1 ].bmSndToggle = 0;
195  epInfo[ XBOX_INPUT_PIPE_1 ].bmRcvToggle = 0;
196  epInfo[ XBOX_OUTPUT_PIPE_1 ].epAddr = 0x01; // XBOX 360 output endpoint - poll interval 8ms
-
197  epInfo[ XBOX_OUTPUT_PIPE_1 ].epAttribs = EP_INTERRUPT;
+
197  epInfo[ XBOX_OUTPUT_PIPE_1 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
198  epInfo[ XBOX_OUTPUT_PIPE_1 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
199  epInfo[ XBOX_OUTPUT_PIPE_1 ].maxPktSize = EP_MAXPKTSIZE;
200  epInfo[ XBOX_OUTPUT_PIPE_1 ].bmSndToggle = 0;
201  epInfo[ XBOX_OUTPUT_PIPE_1 ].bmRcvToggle = 0;
202 
203  epInfo[ XBOX_INPUT_PIPE_2 ].epAddr = 0x03; // XBOX 360 report endpoint - poll interval 1ms
-
204  epInfo[ XBOX_INPUT_PIPE_2 ].epAttribs = EP_INTERRUPT;
+
204  epInfo[ XBOX_INPUT_PIPE_2 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
205  epInfo[ XBOX_INPUT_PIPE_2 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
206  epInfo[ XBOX_INPUT_PIPE_2 ].maxPktSize = EP_MAXPKTSIZE;
207  epInfo[ XBOX_INPUT_PIPE_2 ].bmSndToggle = 0;
208  epInfo[ XBOX_INPUT_PIPE_2 ].bmRcvToggle = 0;
209  epInfo[ XBOX_OUTPUT_PIPE_2 ].epAddr = 0x03; // XBOX 360 output endpoint - poll interval 8ms
-
210  epInfo[ XBOX_OUTPUT_PIPE_2 ].epAttribs = EP_INTERRUPT;
+
210  epInfo[ XBOX_OUTPUT_PIPE_2 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
211  epInfo[ XBOX_OUTPUT_PIPE_2 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
212  epInfo[ XBOX_OUTPUT_PIPE_2 ].maxPktSize = EP_MAXPKTSIZE;
213  epInfo[ XBOX_OUTPUT_PIPE_2 ].bmSndToggle = 0;
214  epInfo[ XBOX_OUTPUT_PIPE_2 ].bmRcvToggle = 0;
215 
216  epInfo[ XBOX_INPUT_PIPE_3 ].epAddr = 0x05; // XBOX 360 report endpoint - poll interval 1ms
-
217  epInfo[ XBOX_INPUT_PIPE_3 ].epAttribs = EP_INTERRUPT;
+
217  epInfo[ XBOX_INPUT_PIPE_3 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
218  epInfo[ XBOX_INPUT_PIPE_3 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
219  epInfo[ XBOX_INPUT_PIPE_3 ].maxPktSize = EP_MAXPKTSIZE;
220  epInfo[ XBOX_INPUT_PIPE_3 ].bmSndToggle = 0;
221  epInfo[ XBOX_INPUT_PIPE_3 ].bmRcvToggle = 0;
222  epInfo[ XBOX_OUTPUT_PIPE_3 ].epAddr = 0x05; // XBOX 360 output endpoint - poll interval 8ms
-
223  epInfo[ XBOX_OUTPUT_PIPE_3 ].epAttribs = EP_INTERRUPT;
+
223  epInfo[ XBOX_OUTPUT_PIPE_3 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
224  epInfo[ XBOX_OUTPUT_PIPE_3 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
225  epInfo[ XBOX_OUTPUT_PIPE_3 ].maxPktSize = EP_MAXPKTSIZE;
226  epInfo[ XBOX_OUTPUT_PIPE_3 ].bmSndToggle = 0;
227  epInfo[ XBOX_OUTPUT_PIPE_3 ].bmRcvToggle = 0;
228 
229  epInfo[ XBOX_INPUT_PIPE_4 ].epAddr = 0x07; // XBOX 360 report endpoint - poll interval 1ms
-
230  epInfo[ XBOX_INPUT_PIPE_4 ].epAttribs = EP_INTERRUPT;
+
230  epInfo[ XBOX_INPUT_PIPE_4 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
231  epInfo[ XBOX_INPUT_PIPE_4 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
232  epInfo[ XBOX_INPUT_PIPE_4 ].maxPktSize = EP_MAXPKTSIZE;
233  epInfo[ XBOX_INPUT_PIPE_4 ].bmSndToggle = 0;
234  epInfo[ XBOX_INPUT_PIPE_4 ].bmRcvToggle = 0;
235  epInfo[ XBOX_OUTPUT_PIPE_4 ].epAddr = 0x07; // XBOX 360 output endpoint - poll interval 8ms
-
236  epInfo[ XBOX_OUTPUT_PIPE_4 ].epAttribs = EP_INTERRUPT;
+
236  epInfo[ XBOX_OUTPUT_PIPE_4 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
237  epInfo[ XBOX_OUTPUT_PIPE_4 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
238  epInfo[ XBOX_OUTPUT_PIPE_4 ].maxPktSize = EP_MAXPKTSIZE;
239  epInfo[ XBOX_OUTPUT_PIPE_4 ].bmSndToggle = 0;
@@ -341,7 +342,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
250  goto FailSetConfDescr;
251 
252 #ifdef DEBUG_USB_HOST
-
253  Notify(PSTR("\r\nXbox Wireless Receiver Connected\r\n"), 0x80);
+
253  Notify(PSTR("\r\nXbox Wireless Receiver Connected\r\n"), 0x80);
254 #endif
255  XboxReceiverConnected = true;
256  bPollEnable = true;
@@ -362,7 +363,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
271 
272 Fail:
273 #ifdef DEBUG_USB_HOST
-
274  Notify(PSTR("\r\nXbox 360 Init Failed, error code: "), 0x80);
+
274  Notify(PSTR("\r\nXbox 360 Init Failed, error code: "), 0x80);
275  NotifyFail(rcode);
276 #endif
277  Release();
@@ -404,9 +405,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
313  pUsb->inTransfer(bAddress, epInfo[ inputPipe ].epAddr, &bufferSize, readBuf);
314  if(bufferSize > 0) { // The number of received bytes
315 #ifdef EXTRADEBUG
-
316  Notify(PSTR("Bytes Received: "), 0x80);
+
316  Notify(PSTR("Bytes Received: "), 0x80);
317  D_PrintHex<uint16_t > (bufferSize, 0x80);
-
318  Notify(PSTR("\r\n"), 0x80);
+
318  Notify(PSTR("\r\n"), 0x80);
319 #endif
320  readReport(i);
321 #ifdef PRINTREPORT
@@ -424,28 +425,28 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
333  if(readBuf[0] == 0x08 && readBuf[1] != Xbox360Connected[controller]) {
334  Xbox360Connected[controller] = readBuf[1];
335 #ifdef DEBUG_USB_HOST
-
336  Notify(PSTR("Controller "), 0x80);
+
336  Notify(PSTR("Controller "), 0x80);
337  Notify(controller, 0x80);
338 #endif
339  if(Xbox360Connected[controller]) {
340 #ifdef DEBUG_USB_HOST
341  const char* str = 0;
342  switch(readBuf[1]) {
-
343  case 0x80: str = PSTR(" as controller\r\n");
+
343  case 0x80: str = PSTR(" as controller\r\n");
344  break;
-
345  case 0x40: str = PSTR(" as headset\r\n");
+
345  case 0x40: str = PSTR(" as headset\r\n");
346  break;
-
347  case 0xC0: str = PSTR(" as controller+headset\r\n");
+
347  case 0xC0: str = PSTR(" as controller+headset\r\n");
348  break;
349  }
-
350  Notify(PSTR(": connected"), 0x80);
+
350  Notify(PSTR(": connected"), 0x80);
351  Notify(str, 0x80);
352 #endif
353  onInit(controller);
354  }
355 #ifdef DEBUG_USB_HOST
356  else
-
357  Notify(PSTR(": disconnected\r\n"), 0x80);
+
357  Notify(PSTR(": disconnected\r\n"), 0x80);
358 #endif
359  return;
360  }
@@ -486,14 +487,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
395 #ifdef PRINTREPORT
396  if(readBuf == NULL)
397  return;
-
398  Notify(PSTR("Controller "), 0x80);
+
398  Notify(PSTR("Controller "), 0x80);
399  Notify(controller, 0x80);
-
400  Notify(PSTR(": "), 0x80);
+
400  Notify(PSTR(": "), 0x80);
401  for(uint8_t i = 0; i < nBytes; i++) {
402  D_PrintHex<uint8_t > (readBuf[i], 0x80);
-
403  Notify(PSTR(" "), 0x80);
+
403  Notify(PSTR(" "), 0x80);
404  }
-
405  Notify(PSTR("\r\n"), 0x80);
+
405  Notify(PSTR("\r\n"), 0x80);
406 #endif
407 }
408 
@@ -502,7 +503,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
411  return (uint8_t)(ButtonState[controller] >> 8);
412  else if(b == R2)
413  return (uint8_t)ButtonState[controller];
-
414  return (bool)(ButtonState[controller] & ((uint32_t)pgm_read_word(&XBOX_BUTTONS[(uint8_t)b]) << 16));
+
414  return (bool)(ButtonState[controller] & ((uint32_t)pgm_read_word(&XBOX_BUTTONS[(uint8_t)b]) << 16));
415 }
416 
417 bool XBOXRECV::getButtonClick(ButtonEnum b, uint8_t controller) {
@@ -519,7 +520,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
428  }
429  return false;
430  }
-
431  uint16_t button = pgm_read_word(&XBOX_BUTTONS[(uint8_t)b]);
+
431  uint16_t button = pgm_read_word(&XBOX_BUTTONS[(uint8_t)b]);
432  bool click = (ButtonClickState[controller] & button);
433  ButtonClickState[controller] &= ~button; // clear "click" event
434  return click;
@@ -581,7 +582,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
490  pUsb->outTransfer(bAddress, epInfo[ outputPipe ].epAddr, nbytes, data);
491 #ifdef EXTRADEBUG
492  if(rcode)
-
493  Notify(PSTR("Error sending Xbox message\r\n"), 0x80);
+
493  Notify(PSTR("Error sending Xbox message\r\n"), 0x80);
494 #endif
495 }
496 
@@ -607,11 +608,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
516  if(led == OFF)
517  setLedRaw(0, controller);
518  else if(led != ALL) // All LEDs can't be on a the same time
-
519  setLedRaw(pgm_read_byte(&XBOX_LEDS[(uint8_t)led]) + 4, controller);
+
519  setLedRaw(pgm_read_byte(&XBOX_LEDS[(uint8_t)led]) + 4, controller);
520 }
521 
522 void XBOXRECV::setLedBlink(LEDEnum led, uint8_t controller) {
-
523  setLedRaw(pgm_read_byte(&XBOX_LEDS[(uint8_t)led]), controller);
+
523  setLedRaw(pgm_read_byte(&XBOX_LEDS[(uint8_t)led]), controller);
524 }
525 
526 void XBOXRECV::setLedMode(LEDModeEnum ledMode, uint8_t controller) { // This function is used to do some speciel LED stuff the controller supports
@@ -674,110 +675,113 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
583 }
uint8_t bmRcvToggle
Definition: address.h:41
Definition: address.h:83
-
#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID
Definition: XBOXRECV.h:49
+
#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID
Definition: XBOXRECV.h:46
LEDModeEnum
Definition: xboxEnums.h:24
EpInfo * epinfo
Definition: address.h:76
bool lowspeed
Definition: address.h:79
-
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:81
-
virtual uint8_t Poll()
Definition: XBOXRECV.cpp:292
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
+
uint8_t Poll()
Definition: XBOXRECV.cpp:292
void setRumbleOn(uint8_t lValue, uint8_t rValue, uint8_t controller=0)
Definition: XBOXRECV.cpp:556
uint8_t bmNakPower
Definition: address.h:42
-
#define XBOX_WIRELESS_RECEIVER_PID
Definition: XBOXRECV.h:48
+
#define XBOX_WIRELESS_RECEIVER_PID
Definition: XBOXRECV.h:45
-
uint8_t bAddress
Definition: XBOXRECV.h:240
+
uint8_t bAddress
Definition: XBOXRECV.h:237
Definition: address.h:75
uint16_t idVendor
Definition: usb_ch9.h:106
+
#define pgm_read_word(addr)
uint8_t bMaxPacketSize0
Definition: usb_ch9.h:105
#define NotifyFail(...)
Definition: message.h:55
-
uint8_t Xbox360Connected[4]
Definition: XBOXRECV.h:234
+
uint8_t Xbox360Connected[4]
Definition: XBOXRECV.h:231
void setLedMode(LEDModeEnum lm, uint8_t controller=0)
Definition: XBOXRECV.cpp:526
AnalogHatEnum
-
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:805
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
bool buttonChanged(uint8_t controller=0)
Definition: XBOXRECV.cpp:441
-
#define XBOX_OUTPUT_PIPE_3
Definition: XBOXRECV.h:39
-
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXRECV.cpp:40
-
#define USB_ERROR_FailGetDevDescr
Definition: UsbCore.h:87
+
#define XBOX_OUTPUT_PIPE_3
Definition: XBOXRECV.h:36
+
uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXRECV.cpp:40
+
#define USB_TRANSFER_TYPE_INTERRUPT
Definition: usb_ch9.h:86
+
#define USB_ERROR_FailGetDevDescr
Definition: UsbCore.h:89
+
#define pgm_read_byte(addr)
#define NotifyFailGetDevDescr(...)
Definition: message.h:50
-
#define hrJERR
Definition: max3421e.h:225
+
#define hrJERR
Definition: max3421e.h:220
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
-
#define EP_MAXPKTSIZE
Definition: PS3USB.h:25
+
#define EP_MAXPKTSIZE
Definition: PS3USB.h:26
virtual void FreeAddress(uint8_t addr)=0
LEDEnum
uint8_t epAttribs
Definition: address.h:37
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
#define Notify(...)
Definition: message.h:44
-
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:796
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
uint8_t epAddr
Definition: address.h:33
-
#define XBOX_INPUT_PIPE_2
Definition: XBOXRECV.h:36
+
#define XBOX_INPUT_PIPE_2
Definition: XBOXRECV.h:33
#define NotifyFailUnknownDevice(...)
Definition: message.h:54
#define USB_NAK_MAX_POWER
Definition: address.h:27
-
#define XBOX_VID
Definition: XBOXOLD.h:36
+
#define XBOX_VID
Definition: XBOXOLD.h:34
-
virtual uint8_t Release()
Definition: XBOXRECV.cpp:282
-
#define EP_INTERRUPT
Definition: PS3USB.h:28
+
uint8_t Release()
Definition: XBOXRECV.cpp:282
Definition: address.h:32
bool getButtonClick(ButtonEnum b, uint8_t controller=0)
Definition: XBOXRECV.cpp:417
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
Definition: Usb.cpp:292
void setLedOn(LEDEnum l, uint8_t controller=0)
Definition: XBOXRECV.cpp:515
ButtonEnum
uint8_t getButtonPress(ButtonEnum b, uint8_t controller=0)
Definition: XBOXRECV.cpp:409
-
bool XboxReceiverConnected
Definition: XBOXRECV.h:228
+
bool XboxReceiverConnected
Definition: XBOXRECV.h:225
-
#define JOYTECH_VID
Definition: XBOXOLD.h:38
+
#define JOYTECH_VID
Definition: XBOXOLD.h:36
uint8_t getBatteryLevel(uint8_t controller=0)
Definition: XBOXRECV.cpp:466
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
-
#define XBOX_OUTPUT_PIPE_1
Definition: XBOXRECV.h:35
+
#define XBOX_OUTPUT_PIPE_1
Definition: XBOXRECV.h:32
uint8_t bmSndToggle
Definition: address.h:40
int16_t getAnalogHat(AnalogHatEnum a, uint8_t controller=0)
Definition: XBOXRECV.cpp:437
-
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:83
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
+
#define PSTR(str)
XBOXRECV(USB *pUsb)
Definition: XBOXRECV.cpp:25
-
#define MADCATZ_VID
Definition: XBOXOLD.h:37
-
#define XBOX_INPUT_PIPE_1
Definition: XBOXRECV.h:34
+
#define MADCATZ_VID
Definition: XBOXOLD.h:35
+
#define XBOX_INPUT_PIPE_1
Definition: XBOXRECV.h:31
void setLedBlink(LEDEnum l, uint8_t controller=0)
Definition: XBOXRECV.cpp:522
#define USB_NAK_NOWAIT
Definition: address.h:29
-
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:80
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXRECV.cpp:137
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXRECV.cpp:137
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
Definition: Usb.cpp:206
-
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:75
+
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:77
void setLedRaw(uint8_t value, uint8_t controller=0)
Definition: XBOXRECV.cpp:506
const uint8_t XBOX_LEDS[]
Definition: xboxEnums.h:32
uint16_t idProduct
Definition: usb_ch9.h:107
-
#define XBOX_MAX_ENDPOINTS
Definition: XBOXOLD.h:49
-
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:78
+
#define XBOX_MAX_ENDPOINTS
Definition: XBOXOLD.h:43
+
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:80
uint8_t maxPktSize
Definition: address.h:34
-
AddressPool & GetAddressPool()
Definition: UsbCore.h:206
-
Definition: UsbCore.h:190
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
Definition: UsbCore.h:197
-
#define XBOX_INPUT_PIPE_3
Definition: XBOXRECV.h:38
-
#define XBOX_CONTROL_PIPE
Definition: XBOXOLD.h:31
+
#define XBOX_INPUT_PIPE_3
Definition: XBOXRECV.h:35
+
#define XBOX_CONTROL_PIPE
Definition: XBOXOLD.h:29
-
#define XBOX_INPUT_PIPE_4
Definition: XBOXRECV.h:40
+
#define XBOX_INPUT_PIPE_4
Definition: XBOXRECV.h:37
const uint16_t XBOX_BUTTONS[]
Definition: xboxEnums.h:41
-
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:210
+
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:217
#define NotifyFailSetConfDescr(...)
Definition: message.h:53
void disconnect(uint8_t controller=0)
Definition: XBOXRECV.cpp:497
-
#define XBOX_OUTPUT_PIPE_4
Definition: XBOXRECV.h:41
-
USB * pUsb
Definition: XBOXRECV.h:238
-
#define XBOX_OUTPUT_PIPE_2
Definition: XBOXRECV.h:37
-
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:761
-
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXRECV.h:242
+
#define XBOX_OUTPUT_PIPE_4
Definition: XBOXRECV.h:38
+
USB * pUsb
Definition: XBOXRECV.h:235
+
#define XBOX_OUTPUT_PIPE_2
Definition: XBOXRECV.h:34
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
+
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXRECV.h:239
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:51
-
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
Definition: UsbCore.h:86
+
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
Definition: UsbCore.h:88
Definition: usb_ch9.h:98
diff --git a/_x_b_o_x_r_e_c_v_8h.html b/_x_b_o_x_r_e_c_v_8h.html index 9a6bfaf4..ae665f14 100644 --- a/_x_b_o_x_r_e_c_v_8h.html +++ b/_x_b_o_x_r_e_c_v_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXRECV.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -120,8 +121,6 @@ Classes Macros #define EP_MAXPKTSIZE   32   -#define EP_INTERRUPT   0x03 -  #define XBOX_CONTROL_PIPE   0   #define XBOX_INPUT_PIPE_1   1 @@ -166,20 +165,6 @@ Macros

Definition at line 27 of file XBOXRECV.h.

-
- - -
-
- - - - -
#define EP_INTERRUPT   0x03
-
- -

Definition at line 30 of file XBOXRECV.h.

-
@@ -192,7 +177,7 @@ Macros
-

Definition at line 33 of file XBOXRECV.h.

+

Definition at line 30 of file XBOXRECV.h.

@@ -206,7 +191,7 @@ Macros
-

Definition at line 34 of file XBOXRECV.h.

+

Definition at line 31 of file XBOXRECV.h.

@@ -220,7 +205,7 @@ Macros
-

Definition at line 35 of file XBOXRECV.h.

+

Definition at line 32 of file XBOXRECV.h.

@@ -234,7 +219,7 @@ Macros
-

Definition at line 36 of file XBOXRECV.h.

+

Definition at line 33 of file XBOXRECV.h.

@@ -248,7 +233,7 @@ Macros
-

Definition at line 37 of file XBOXRECV.h.

+

Definition at line 34 of file XBOXRECV.h.

@@ -262,7 +247,7 @@ Macros
-

Definition at line 38 of file XBOXRECV.h.

+

Definition at line 35 of file XBOXRECV.h.

@@ -276,7 +261,7 @@ Macros
-

Definition at line 39 of file XBOXRECV.h.

+

Definition at line 36 of file XBOXRECV.h.

@@ -290,7 +275,7 @@ Macros
-

Definition at line 40 of file XBOXRECV.h.

+

Definition at line 37 of file XBOXRECV.h.

@@ -304,7 +289,7 @@ Macros
-

Definition at line 41 of file XBOXRECV.h.

+

Definition at line 38 of file XBOXRECV.h.

@@ -318,7 +303,7 @@ Macros
-

Definition at line 44 of file XBOXRECV.h.

+

Definition at line 41 of file XBOXRECV.h.

@@ -332,7 +317,7 @@ Macros
-

Definition at line 45 of file XBOXRECV.h.

+

Definition at line 42 of file XBOXRECV.h.

@@ -346,7 +331,7 @@ Macros
-

Definition at line 46 of file XBOXRECV.h.

+

Definition at line 43 of file XBOXRECV.h.

@@ -360,7 +345,7 @@ Macros
-

Definition at line 48 of file XBOXRECV.h.

+

Definition at line 45 of file XBOXRECV.h.

@@ -374,7 +359,7 @@ Macros
-

Definition at line 49 of file XBOXRECV.h.

+

Definition at line 46 of file XBOXRECV.h.

@@ -388,7 +373,7 @@ Macros
-

Definition at line 51 of file XBOXRECV.h.

+

Definition at line 48 of file XBOXRECV.h.

@@ -397,7 +382,7 @@ Macros diff --git a/_x_b_o_x_r_e_c_v_8h__dep__incl.md5 b/_x_b_o_x_r_e_c_v_8h__dep__incl.md5 index 4ca65192..10cd6192 100644 --- a/_x_b_o_x_r_e_c_v_8h__dep__incl.md5 +++ b/_x_b_o_x_r_e_c_v_8h__dep__incl.md5 @@ -1 +1 @@ -74b9b88b9a5da90f0879a3aae3ebebb6 \ No newline at end of file +1b17ab2dd30a29c1f644e03c41d46777 \ No newline at end of file diff --git a/_x_b_o_x_r_e_c_v_8h__incl.md5 b/_x_b_o_x_r_e_c_v_8h__incl.md5 index 59a0ccbc..e4e3f6bf 100644 --- a/_x_b_o_x_r_e_c_v_8h__incl.md5 +++ b/_x_b_o_x_r_e_c_v_8h__incl.md5 @@ -1 +1 @@ -ce5138122fc59e139125ea0dd172d247 \ No newline at end of file +b243ba8a771536bf11d1fde69b3f7cff \ No newline at end of file diff --git a/_x_b_o_x_r_e_c_v_8h_source.html b/_x_b_o_x_r_e_c_v_8h_source.html index 45506d5c..e65f9e09 100644 --- a/_x_b_o_x_r_e_c_v_8h_source.html +++ b/_x_b_o_x_r_e_c_v_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXRECV.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -117,168 +118,165 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
26 /* Data Xbox 360 taken from descriptors */
27 #define EP_MAXPKTSIZE 32 // max size for data via USB
28 
-
29 /* Endpoint types */
-
30 #define EP_INTERRUPT 0x03
-
31 
-
32 /* Names we give to the 9 Xbox360 pipes */
-
33 #define XBOX_CONTROL_PIPE 0
-
34 #define XBOX_INPUT_PIPE_1 1
-
35 #define XBOX_OUTPUT_PIPE_1 2
-
36 #define XBOX_INPUT_PIPE_2 3
-
37 #define XBOX_OUTPUT_PIPE_2 4
-
38 #define XBOX_INPUT_PIPE_3 5
-
39 #define XBOX_OUTPUT_PIPE_3 6
-
40 #define XBOX_INPUT_PIPE_4 7
-
41 #define XBOX_OUTPUT_PIPE_4 8
-
42 
-
43 // PID and VID of the different devices
-
44 #define XBOX_VID 0x045E // Microsoft Corporation
-
45 #define MADCATZ_VID 0x1BAD // For unofficial Mad Catz receivers
-
46 #define JOYTECH_VID 0x162E // For unofficial Joytech controllers
+
29 /* Names we give to the 9 Xbox360 pipes */
+
30 #define XBOX_CONTROL_PIPE 0
+
31 #define XBOX_INPUT_PIPE_1 1
+
32 #define XBOX_OUTPUT_PIPE_1 2
+
33 #define XBOX_INPUT_PIPE_2 3
+
34 #define XBOX_OUTPUT_PIPE_2 4
+
35 #define XBOX_INPUT_PIPE_3 5
+
36 #define XBOX_OUTPUT_PIPE_3 6
+
37 #define XBOX_INPUT_PIPE_4 7
+
38 #define XBOX_OUTPUT_PIPE_4 8
+
39 
+
40 // PID and VID of the different devices
+
41 #define XBOX_VID 0x045E // Microsoft Corporation
+
42 #define MADCATZ_VID 0x1BAD // For unofficial Mad Catz receivers
+
43 #define JOYTECH_VID 0x162E // For unofficial Joytech controllers
+
44 
+
45 #define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver
+
46 #define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver
47 
-
48 #define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver
-
49 #define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver
-
50 
-
51 #define XBOX_MAX_ENDPOINTS 9
-
52 
-
58 class XBOXRECV : public USBDeviceConfig {
-
59 public:
-
64  XBOXRECV(USB *pUsb);
-
65 
-
74  virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed);
-
82  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
-
87  virtual uint8_t Release();
-
92  virtual uint8_t Poll();
-
93 
-
98  virtual uint8_t GetAddress() {
-
99  return bAddress;
-
100  };
-
101 
-
106  virtual bool isReady() {
-
107  return bPollEnable;
-
108  };
-
109 
-
116  virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
-
117  return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID) && (pid == XBOX_WIRELESS_RECEIVER_PID || pid == XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID));
-
118  };
-
133  uint8_t getButtonPress(ButtonEnum b, uint8_t controller = 0);
-
134  bool getButtonClick(ButtonEnum b, uint8_t controller = 0);
-
144  int16_t getAnalogHat(AnalogHatEnum a, uint8_t controller = 0);
-
145 
-
150  void disconnect(uint8_t controller = 0);
-
151 
-
156  void setAllOff(uint8_t controller = 0) {
-
157  setRumbleOn(0, 0, controller);
-
158  setLedOff(controller);
-
159  };
-
160 
-
165  void setRumbleOff(uint8_t controller = 0) {
-
166  setRumbleOn(0, 0, controller);
-
167  };
-
174  void setRumbleOn(uint8_t lValue, uint8_t rValue, uint8_t controller = 0);
-
182  void setLedRaw(uint8_t value, uint8_t controller = 0);
-
183 
-
188  void setLedOff(uint8_t controller = 0) {
-
189  setLedRaw(0, controller);
-
190  };
-
196  void setLedOn(LEDEnum l, uint8_t controller = 0);
-
202  void setLedBlink(LEDEnum l, uint8_t controller = 0);
-
208  void setLedMode(LEDModeEnum lm, uint8_t controller = 0);
-
214  uint8_t getBatteryLevel(uint8_t controller = 0);
-
220  bool buttonChanged(uint8_t controller = 0);
-
221 
-
226  void attachOnInit(void (*funcOnInit)(void)) {
-
227  pFuncOnInit = funcOnInit;
-
228  };
-
232  bool XboxReceiverConnected;
-
234  uint8_t Xbox360Connected[4];
-
235 
-
236 protected:
-
238  USB *pUsb;
-
240  uint8_t bAddress;
-
242  EpInfo epInfo[XBOX_MAX_ENDPOINTS];
-
243 
-
244 private:
-
251  void onInit(uint8_t controller);
-
252  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
-
253 
-
254  bool bPollEnable;
-
255 
-
256  /* Variables to store the buttons */
-
257  uint32_t ButtonState[4];
-
258  uint32_t OldButtonState[4];
-
259  uint16_t ButtonClickState[4];
-
260  int16_t hatValue[4][4];
-
261  uint16_t controllerStatus[4];
-
262  bool buttonStateChanged[4]; // True if a button has changed
+
48 #define XBOX_MAX_ENDPOINTS 9
+
49 
+
55 class XBOXRECV : public USBDeviceConfig {
+
56 public:
+
61  XBOXRECV(USB *pUsb);
+
62 
+
71  uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed);
+
79  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
+
84  uint8_t Release();
+
89  uint8_t Poll();
+
90 
+
95  virtual uint8_t GetAddress() {
+
96  return bAddress;
+
97  };
+
98 
+
103  virtual bool isReady() {
+
104  return bPollEnable;
+
105  };
+
106 
+
113  virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
+
114  return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID) && (pid == XBOX_WIRELESS_RECEIVER_PID || pid == XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID));
+
115  };
+
130  uint8_t getButtonPress(ButtonEnum b, uint8_t controller = 0);
+
131  bool getButtonClick(ButtonEnum b, uint8_t controller = 0);
+
141  int16_t getAnalogHat(AnalogHatEnum a, uint8_t controller = 0);
+
142 
+
147  void disconnect(uint8_t controller = 0);
+
148 
+
153  void setAllOff(uint8_t controller = 0) {
+
154  setRumbleOn(0, 0, controller);
+
155  setLedOff(controller);
+
156  };
+
157 
+
162  void setRumbleOff(uint8_t controller = 0) {
+
163  setRumbleOn(0, 0, controller);
+
164  };
+
171  void setRumbleOn(uint8_t lValue, uint8_t rValue, uint8_t controller = 0);
+
179  void setLedRaw(uint8_t value, uint8_t controller = 0);
+
180 
+
185  void setLedOff(uint8_t controller = 0) {
+
186  setLedRaw(0, controller);
+
187  };
+
193  void setLedOn(LEDEnum l, uint8_t controller = 0);
+
199  void setLedBlink(LEDEnum l, uint8_t controller = 0);
+
205  void setLedMode(LEDModeEnum lm, uint8_t controller = 0);
+
211  uint8_t getBatteryLevel(uint8_t controller = 0);
+
217  bool buttonChanged(uint8_t controller = 0);
+
218 
+
223  void attachOnInit(void (*funcOnInit)(void)) {
+
224  pFuncOnInit = funcOnInit;
+
225  };
+
229  bool XboxReceiverConnected;
+
231  uint8_t Xbox360Connected[4];
+
232 
+
233 protected:
+
235  USB *pUsb;
+
237  uint8_t bAddress;
+
239  EpInfo epInfo[XBOX_MAX_ENDPOINTS];
+
240 
+
241 private:
+
248  void onInit(uint8_t controller);
+
249  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
+
250 
+
251  bool bPollEnable;
+
252 
+
253  /* Variables to store the buttons */
+
254  uint32_t ButtonState[4];
+
255  uint32_t OldButtonState[4];
+
256  uint16_t ButtonClickState[4];
+
257  int16_t hatValue[4][4];
+
258  uint16_t controllerStatus[4];
+
259  bool buttonStateChanged[4]; // True if a button has changed
+
260 
+
261  bool L2Clicked[4]; // These buttons are analog, so we use we use these bools to check if they where clicked or not
+
262  bool R2Clicked[4];
263 
-
264  bool L2Clicked[4]; // These buttons are analog, so we use we use these bools to check if they where clicked or not
-
265  bool R2Clicked[4];
-
266 
-
267  uint32_t checkStatusTimer; // Timing for checkStatus() signals
+
264  uint32_t checkStatusTimer; // Timing for checkStatus() signals
+
265 
+
266  uint8_t readBuf[EP_MAXPKTSIZE]; // General purpose buffer for input data
+
267  uint8_t writeBuf[7]; // General purpose buffer for output data
268 
-
269  uint8_t readBuf[EP_MAXPKTSIZE]; // General purpose buffer for input data
-
270  uint8_t writeBuf[7]; // General purpose buffer for output data
+
269  void readReport(uint8_t controller); // read incoming data
+
270  void printReport(uint8_t controller, uint8_t nBytes); // print incoming date - Uncomment for debugging
271 
-
272  void readReport(uint8_t controller); // read incoming data
-
273  void printReport(uint8_t controller, uint8_t nBytes); // print incoming date - Uncomment for debugging
-
274 
-
275  /* Private commands */
-
276  void XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes);
-
277  void checkStatus();
-
278 };
-
279 #endif
-
#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID
Definition: XBOXRECV.h:49
+
272  /* Private commands */
+
273  void XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes);
+
274  void checkStatus();
+
275 };
+
276 #endif
+
#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID
Definition: XBOXRECV.h:46
LEDModeEnum
Definition: xboxEnums.h:24
-
virtual uint8_t Poll()
Definition: XBOXRECV.cpp:292
+
uint8_t Poll()
Definition: XBOXRECV.cpp:292
void setRumbleOn(uint8_t lValue, uint8_t rValue, uint8_t controller=0)
Definition: XBOXRECV.cpp:556
-
#define XBOX_WIRELESS_RECEIVER_PID
Definition: XBOXRECV.h:48
-
uint8_t bAddress
Definition: XBOXRECV.h:240
-
void setLedOff(uint8_t controller=0)
Definition: XBOXRECV.h:188
+
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: XBOXRECV.h:113
+
#define XBOX_WIRELESS_RECEIVER_PID
Definition: XBOXRECV.h:45
+
uint8_t bAddress
Definition: XBOXRECV.h:237
+
void setLedOff(uint8_t controller=0)
Definition: XBOXRECV.h:185
#define EP_MAXPKTSIZE
Definition: XBOXRECV.h:27
-
virtual uint8_t GetAddress()
Definition: XBOXRECV.h:98
-
uint8_t Xbox360Connected[4]
Definition: XBOXRECV.h:234
+
virtual uint8_t GetAddress()
Definition: XBOXRECV.h:95
+
uint8_t Xbox360Connected[4]
Definition: XBOXRECV.h:231
void setLedMode(LEDModeEnum lm, uint8_t controller=0)
Definition: XBOXRECV.cpp:526
AnalogHatEnum
bool buttonChanged(uint8_t controller=0)
Definition: XBOXRECV.cpp:441
-
void setRumbleOff(uint8_t controller=0)
Definition: XBOXRECV.h:165
-
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXRECV.cpp:40
-
Definition: UsbCore.h:119
+
void setRumbleOff(uint8_t controller=0)
Definition: XBOXRECV.h:162
+
uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXRECV.cpp:40
+
Definition: UsbCore.h:121
-
virtual bool isReady()
Definition: XBOXRECV.h:106
+
virtual bool isReady()
Definition: XBOXRECV.h:103
LEDEnum
-
#define XBOX_VID
Definition: XBOXRECV.h:44
-
void setAllOff(uint8_t controller=0)
Definition: XBOXRECV.h:156
-
virtual uint8_t Release()
Definition: XBOXRECV.cpp:282
+
#define XBOX_VID
Definition: XBOXRECV.h:41
+
void setAllOff(uint8_t controller=0)
Definition: XBOXRECV.h:153
+
uint8_t Release()
Definition: XBOXRECV.cpp:282
Definition: address.h:32
bool getButtonClick(ButtonEnum b, uint8_t controller=0)
Definition: XBOXRECV.cpp:417
void setLedOn(LEDEnum l, uint8_t controller=0)
Definition: XBOXRECV.cpp:515
ButtonEnum
uint8_t getButtonPress(ButtonEnum b, uint8_t controller=0)
Definition: XBOXRECV.cpp:409
-
bool XboxReceiverConnected
Definition: XBOXRECV.h:228
+
bool XboxReceiverConnected
Definition: XBOXRECV.h:225
uint8_t getBatteryLevel(uint8_t controller=0)
Definition: XBOXRECV.cpp:466
int16_t getAnalogHat(AnalogHatEnum a, uint8_t controller=0)
Definition: XBOXRECV.cpp:437
XBOXRECV(USB *pUsb)
Definition: XBOXRECV.cpp:25
-
#define JOYTECH_VID
Definition: XBOXRECV.h:46
+
#define JOYTECH_VID
Definition: XBOXRECV.h:43
void setLedBlink(LEDEnum l, uint8_t controller=0)
Definition: XBOXRECV.cpp:522
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXRECV.cpp:137
-
#define MADCATZ_VID
Definition: XBOXRECV.h:45
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXRECV.cpp:137
+
#define MADCATZ_VID
Definition: XBOXRECV.h:42
void setLedRaw(uint8_t value, uint8_t controller=0)
Definition: XBOXRECV.cpp:506
-
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: XBOXRECV.h:116
-
Definition: UsbCore.h:190
-
void attachOnInit(void(*funcOnInit)(void))
Definition: XBOXRECV.h:226
+
Definition: UsbCore.h:197
+
void attachOnInit(void(*funcOnInit)(void))
Definition: XBOXRECV.h:223
void disconnect(uint8_t controller=0)
Definition: XBOXRECV.cpp:497
-
Definition: XBOXRECV.h:58
-
USB * pUsb
Definition: XBOXRECV.h:238
-
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXRECV.h:242
-
#define XBOX_MAX_ENDPOINTS
Definition: XBOXRECV.h:51
+
Definition: XBOXRECV.h:55
+
USB * pUsb
Definition: XBOXRECV.h:235
+
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXRECV.h:239
+
#define XBOX_MAX_ENDPOINTS
Definition: XBOXRECV.h:48
diff --git a/_x_b_o_x_u_s_b_8cpp.html b/_x_b_o_x_u_s_b_8cpp.html index b5632af2..79a065f3 100644 --- a/_x_b_o_x_u_s_b_8cpp.html +++ b/_x_b_o_x_u_s_b_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXUSB.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -95,7 +96,7 @@ Include dependency graph for XBOXUSB.cpp:
- +

Go to the source code of this file.

@@ -104,7 +105,7 @@ Include dependency graph for XBOXUSB.cpp: diff --git a/_x_b_o_x_u_s_b_8cpp__incl.map b/_x_b_o_x_u_s_b_8cpp__incl.map index f13c1f25..b078f7d8 100644 --- a/_x_b_o_x_u_s_b_8cpp__incl.map +++ b/_x_b_o_x_u_s_b_8cpp__incl.map @@ -1,6 +1,8 @@ - - - - + + + + + + diff --git a/_x_b_o_x_u_s_b_8cpp__incl.md5 b/_x_b_o_x_u_s_b_8cpp__incl.md5 index b8265da5..2356cea0 100644 --- a/_x_b_o_x_u_s_b_8cpp__incl.md5 +++ b/_x_b_o_x_u_s_b_8cpp__incl.md5 @@ -1 +1 @@ -bf6f13928de61e73244f2efd80b18c87 \ No newline at end of file +c0a331b895b98f54285abbe4728f1391 \ No newline at end of file diff --git a/_x_b_o_x_u_s_b_8cpp__incl.png b/_x_b_o_x_u_s_b_8cpp__incl.png index fa533e2f..56430db6 100644 Binary files a/_x_b_o_x_u_s_b_8cpp__incl.png and b/_x_b_o_x_u_s_b_8cpp__incl.png differ diff --git a/_x_b_o_x_u_s_b_8cpp_source.html b/_x_b_o_x_u_s_b_8cpp_source.html index da57e35e..3430f852 100644 --- a/_x_b_o_x_u_s_b_8cpp_source.html +++ b/_x_b_o_x_u_s_b_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXUSB.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -138,12 +139,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
47  // get memory address of USB device address pool
48  AddressPool &addrPool = pUsb->GetAddressPool();
49 #ifdef EXTRADEBUG
-
50  Notify(PSTR("\r\nXBOXUSB Init"), 0x80);
+
50  Notify(PSTR("\r\nXBOXUSB Init"), 0x80);
51 #endif
52  // check if address has already been assigned to an instance
53  if(bAddress) {
54 #ifdef DEBUG_USB_HOST
-
55  Notify(PSTR("\r\nAddress in use"), 0x80);
+
55  Notify(PSTR("\r\nAddress in use"), 0x80);
56 #endif
57  return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE;
58  }
@@ -153,14 +154,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
62 
63  if(!p) {
64 #ifdef DEBUG_USB_HOST
-
65  Notify(PSTR("\r\nAddress not found"), 0x80);
+
65  Notify(PSTR("\r\nAddress not found"), 0x80);
66 #endif
67  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
68  }
69 
70  if(!p->epinfo) {
71 #ifdef DEBUG_USB_HOST
-
72  Notify(PSTR("\r\nepinfo is null"), 0x80);
+
72  Notify(PSTR("\r\nepinfo is null"), 0x80);
73 #endif
74  return USB_ERROR_EPINFO_IS_NULL;
75  }
@@ -188,15 +189,15 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
97  goto FailUnknownDevice;
98  if(PID == XBOX_WIRELESS_PID) {
99 #ifdef DEBUG_USB_HOST
-
100  Notify(PSTR("\r\nYou have plugged in a wireless Xbox 360 controller - it doesn't support USB communication"), 0x80);
+
100  Notify(PSTR("\r\nYou have plugged in a wireless Xbox 360 controller - it doesn't support USB communication"), 0x80);
101 #endif
102  goto FailUnknownDevice;
103  } else if(PID == XBOX_WIRELESS_RECEIVER_PID || PID == XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID) {
104 #ifdef DEBUG_USB_HOST
-
105  Notify(PSTR("\r\nThis library only supports Xbox 360 controllers via USB"), 0x80);
+
105  Notify(PSTR("\r\nThis library only supports Xbox 360 controllers via USB"), 0x80);
106 #endif
107  goto FailUnknownDevice;
-
108  } else if(PID != XBOX_WIRED_PID && PID != MADCATZ_WIRED_PID && PID != GAMESTOP_WIRED_PID && PID != AFTERGLOW_WIRED_PID) // Check PID
+
108  } else if(PID != XBOX_WIRED_PID && PID != MADCATZ_WIRED_PID && PID != GAMESTOP_WIRED_PID && PID != AFTERGLOW_WIRED_PID && PID != JOYTECH_WIRED_PID) // Check PID
109  goto FailUnknownDevice;
110 
111  // Allocate new address according to device class
@@ -215,13 +216,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
124  addrPool.FreeAddress(bAddress);
125  bAddress = 0;
126 #ifdef DEBUG_USB_HOST
-
127  Notify(PSTR("\r\nsetAddr: "), 0x80);
+
127  Notify(PSTR("\r\nsetAddr: "), 0x80);
128  D_PrintHex<uint8_t > (rcode, 0x80);
129 #endif
130  return rcode;
131  }
132 #ifdef EXTRADEBUG
-
133  Notify(PSTR("\r\nAddr: "), 0x80);
+
133  Notify(PSTR("\r\nAddr: "), 0x80);
134  D_PrintHex<uint8_t > (bAddress, 0x80);
135 #endif
136  //delay(300); // Spec says you should wait at least 200ms
@@ -246,13 +247,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
155 
156  /* Initialize data structures for endpoints of device */
157  epInfo[ XBOX_INPUT_PIPE ].epAddr = 0x01; // XBOX 360 report endpoint
-
158  epInfo[ XBOX_INPUT_PIPE ].epAttribs = EP_INTERRUPT;
+
158  epInfo[ XBOX_INPUT_PIPE ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
159  epInfo[ XBOX_INPUT_PIPE ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
160  epInfo[ XBOX_INPUT_PIPE ].maxPktSize = EP_MAXPKTSIZE;
161  epInfo[ XBOX_INPUT_PIPE ].bmSndToggle = 0;
162  epInfo[ XBOX_INPUT_PIPE ].bmRcvToggle = 0;
163  epInfo[ XBOX_OUTPUT_PIPE ].epAddr = 0x02; // XBOX 360 output endpoint
-
164  epInfo[ XBOX_OUTPUT_PIPE ].epAttribs = EP_INTERRUPT;
+
164  epInfo[ XBOX_OUTPUT_PIPE ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT;
165  epInfo[ XBOX_OUTPUT_PIPE ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints
166  epInfo[ XBOX_OUTPUT_PIPE ].maxPktSize = EP_MAXPKTSIZE;
167  epInfo[ XBOX_OUTPUT_PIPE ].bmSndToggle = 0;
@@ -269,7 +270,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
178  goto FailSetConfDescr;
179 
180 #ifdef DEBUG_USB_HOST
-
181  Notify(PSTR("\r\nXbox 360 Controller Connected\r\n"), 0x80);
+
181  Notify(PSTR("\r\nXbox 360 Controller Connected\r\n"), 0x80);
182 #endif
183  onInit();
184  Xbox360Connected = true;
@@ -303,7 +304,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
212 
213 Fail:
214 #ifdef DEBUG_USB_HOST
-
215  Notify(PSTR("\r\nXbox 360 Init Failed, error code: "), 0x80);
+
215  Notify(PSTR("\r\nXbox 360 Init Failed, error code: "), 0x80);
216  NotifyFail(rcode);
217 #endif
218  Release();
@@ -362,11 +363,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
271 #ifdef PRINTREPORT
272  if(readBuf == NULL)
273  return;
-
274  for(uint8_t i = 0; i < XBOX_REPORT_BUFFER_SIZE; i++) {
+
274  for(uint8_t i = 0; i < XBOX_REPORT_BUFFER_SIZE; i++) {
275  D_PrintHex<uint8_t > (readBuf[i], 0x80);
-
276  Notify(PSTR(" "), 0x80);
+
276  Notify(PSTR(" "), 0x80);
277  }
-
278  Notify(PSTR("\r\n"), 0x80);
+
278  Notify(PSTR("\r\n"), 0x80);
279 #endif
280 }
281 
@@ -375,7 +376,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
284  return (uint8_t)(ButtonState >> 8);
285  else if(b == R2)
286  return (uint8_t)ButtonState;
-
287  return (bool)(ButtonState & ((uint32_t)pgm_read_word(&XBOX_BUTTONS[(uint8_t)b]) << 16));
+
287  return (bool)(ButtonState & ((uint32_t)pgm_read_word(&XBOX_BUTTONS[(uint8_t)b]) << 16));
288 }
289 
290 bool XBOXUSB::getButtonClick(ButtonEnum b) {
@@ -392,7 +393,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
301  }
302  return false;
303  }
-
304  uint16_t button = pgm_read_word(&XBOX_BUTTONS[(uint8_t)b]);
+
304  uint16_t button = pgm_read_word(&XBOX_BUTTONS[(uint8_t)b]);
305  bool click = (ButtonClickState & button);
306  ButtonClickState &= ~button; // clear "click" event
307  return click;
@@ -405,7 +406,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
314 /* Xbox Controller commands */
315 void XBOXUSB::XboxCommand(uint8_t* data, uint16_t nbytes) {
316  //bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x00), Report Type (Output 0x02), interface (0x00), datalength, datalength, data)
-
317  pUsb->ctrlReq(bAddress, epInfo[XBOX_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x00, 0x02, 0x00, nbytes, nbytes, data, NULL);
+
317  pUsb->ctrlReq(bAddress, epInfo[XBOX_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x00, 0x02, 0x00, nbytes, nbytes, data, NULL);
318 }
319 
320 void XBOXUSB::setLedRaw(uint8_t value) {
@@ -420,11 +421,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
329  if(led == OFF)
330  setLedRaw(0);
331  else if(led != ALL) // All LEDs can't be on a the same time
-
332  setLedRaw(pgm_read_byte(&XBOX_LEDS[(uint8_t)led]) + 4);
+
332  setLedRaw(pgm_read_byte(&XBOX_LEDS[(uint8_t)led]) + 4);
333 }
334 
335 void XBOXUSB::setLedBlink(LEDEnum led) {
-
336  setLedRaw(pgm_read_byte(&XBOX_LEDS[(uint8_t)led]));
+
336  setLedRaw(pgm_read_byte(&XBOX_LEDS[(uint8_t)led]));
337 }
338 
339 void XBOXUSB::setLedMode(LEDModeEnum ledMode) { // This function is used to do some special LED stuff the controller supports
@@ -450,101 +451,105 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
359  else
360  setLedOn(LED1);
361 }
-
#define XBOX_WIRED_PID
Definition: XBOXUSB.h:41
+
#define XBOX_WIRED_PID
Definition: XBOXUSB.h:39
uint8_t bmRcvToggle
Definition: address.h:41
Definition: address.h:83
-
#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID
Definition: XBOXRECV.h:49
+
#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID
Definition: XBOXRECV.h:46
LEDModeEnum
Definition: xboxEnums.h:24
EpInfo * epinfo
Definition: address.h:76
bool lowspeed
Definition: address.h:79
-
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:81
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
uint8_t bmNakPower
Definition: address.h:42
-
#define XBOX_WIRELESS_RECEIVER_PID
Definition: XBOXRECV.h:48
+
#define XBOX_WIRELESS_RECEIVER_PID
Definition: XBOXRECV.h:45
void setLedOn(LEDEnum l)
Definition: XBOXUSB.cpp:328
Definition: address.h:75
+
#define pgm_read_word(addr)
+
#define HID_REQUEST_SET_REPORT
Definition: hid.h:72
+
#define JOYTECH_WIRED_PID
Definition: XBOXUSB.h:44
#define NotifyFail(...)
Definition: message.h:55
AnalogHatEnum
-
USB * pUsb
Definition: XBOXUSB.h:194
-
#define XBOX_REPORT_BUFFER_SIZE
Definition: XBOXUSB.h:49
-
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:805
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXUSB.cpp:38
+
USB * pUsb
Definition: XBOXUSB.h:189
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXUSB.cpp:38
+
#define bmREQ_HID_OUT
Definition: hid.h:63
+
#define USB_TRANSFER_TYPE_INTERRUPT
Definition: usb_ch9.h:86
int16_t getAnalogHat(AnalogHatEnum a)
Definition: XBOXUSB.cpp:310
void setLedBlink(LEDEnum l)
Definition: XBOXUSB.cpp:335
+
#define pgm_read_byte(addr)
#define NotifyFailGetDevDescr(...)
Definition: message.h:50
-
#define AFTERGLOW_WIRED_PID
Definition: XBOXUSB.h:47
+
#define AFTERGLOW_WIRED_PID
Definition: XBOXUSB.h:46
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
-
#define EP_MAXPKTSIZE
Definition: PS3USB.h:25
+
#define EP_MAXPKTSIZE
Definition: PS3USB.h:26
virtual void FreeAddress(uint8_t addr)=0
LEDEnum
uint8_t epAttribs
Definition: address.h:37
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
Definition: Usb.cpp:126
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
#define Notify(...)
Definition: message.h:44
-
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:796
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
uint8_t epAddr
Definition: address.h:33
#define NotifyFailUnknownDevice(...)
Definition: message.h:54
#define USB_NAK_MAX_POWER
Definition: address.h:27
-
#define XBOX_VID
Definition: XBOXOLD.h:36
-
#define XBOX_INPUT_PIPE
Definition: XBOXOLD.h:32
+
#define XBOX_VID
Definition: XBOXOLD.h:34
+
#define XBOX_INPUT_PIPE
Definition: XBOXOLD.h:30
-
uint8_t bAddress
Definition: XBOXUSB.h:196
+
uint8_t bAddress
Definition: XBOXUSB.h:191
uint8_t getButtonPress(ButtonEnum b)
Definition: XBOXUSB.cpp:282
-
#define EP_INTERRUPT
Definition: PS3USB.h:28
Definition: address.h:32
-
#define XBOX_WIRELESS_PID
Definition: XBOXUSB.h:42
+
#define XBOX_WIRELESS_PID
Definition: XBOXUSB.h:40
ButtonEnum
-
bool Xbox360Connected
Definition: XBOXUSB.h:186
+
bool Xbox360Connected
Definition: XBOXUSB.h:181
-
#define HID_REQUEST_SET_REPORT
Definition: BTD.h:39
-
#define JOYTECH_VID
Definition: XBOXOLD.h:38
+
#define JOYTECH_VID
Definition: XBOXOLD.h:36
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
uint8_t bmSndToggle
Definition: address.h:40
-
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:83
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
+
#define PSTR(str)
void setRumbleOn(uint8_t lValue, uint8_t rValue)
Definition: XBOXUSB.cpp:343
XBOXUSB(USB *pUsb)
Definition: XBOXUSB.cpp:23
-
#define MADCATZ_VID
Definition: XBOXOLD.h:37
+
#define MADCATZ_VID
Definition: XBOXOLD.h:35
-
#define XBOX_OUTPUT_PIPE
Definition: XBOXOLD.h:33
+
#define XBOX_OUTPUT_PIPE
Definition: XBOXOLD.h:31
#define USB_NAK_NOWAIT
Definition: address.h:29
-
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:80
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
Definition: Usb.cpp:206
-
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:75
-
#define GAMESTOP_VID
Definition: XBOXUSB.h:39
+
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:77
+
#define GAMESTOP_VID
Definition: XBOXUSB.h:37
const uint8_t XBOX_LEDS[]
Definition: xboxEnums.h:32
bool getButtonClick(ButtonEnum b)
Definition: XBOXUSB.cpp:290
-
#define XBOX_MAX_ENDPOINTS
Definition: XBOXOLD.h:49
-
#define bmREQ_HID_OUT
Definition: BTD.h:38
+
#define XBOX_MAX_ENDPOINTS
Definition: XBOXOLD.h:43
void setLedRaw(uint8_t value)
Definition: XBOXUSB.cpp:320
-
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:78
+
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:80
void setLedMode(LEDModeEnum lm)
Definition: XBOXUSB.cpp:339
-
#define MADCATZ_WIRED_PID
Definition: XBOXUSB.h:45
+
#define MADCATZ_WIRED_PID
Definition: XBOXUSB.h:43
uint8_t maxPktSize
Definition: address.h:34
-
AddressPool & GetAddressPool()
Definition: UsbCore.h:206
-
Definition: UsbCore.h:190
-
#define XBOX_CONTROL_PIPE
Definition: XBOXOLD.h:31
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
Definition: UsbCore.h:197
+
#define XBOX_CONTROL_PIPE
Definition: XBOXOLD.h:29
-
virtual uint8_t Release()
Definition: XBOXUSB.cpp:223
+
uint8_t Release()
Definition: XBOXUSB.cpp:223
const uint16_t XBOX_BUTTONS[]
Definition: xboxEnums.h:41
-
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:210
+
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:217
#define NotifyFailSetConfDescr(...)
Definition: message.h:53
-
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:761
-
virtual uint8_t Poll()
Definition: XBOXUSB.cpp:231
+
#define XBOX_REPORT_BUFFER_SIZE
Definition: XBOXONE.h:41
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
+
uint8_t Poll()
Definition: XBOXUSB.cpp:231
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:51
-
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXUSB.h:198
-
#define GAMESTOP_WIRED_PID
Definition: XBOXUSB.h:46
+
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXUSB.h:193
+
#define GAMESTOP_WIRED_PID
Definition: XBOXUSB.h:45
Definition: usb_ch9.h:98
diff --git a/_x_b_o_x_u_s_b_8h.html b/_x_b_o_x_u_s_b_8h.html index 19be58ad..fd8b4e94 100644 --- a/_x_b_o_x_u_s_b_8h.html +++ b/_x_b_o_x_u_s_b_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXUSB.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -93,13 +94,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
#include "Usb.h"
+#include "hid.h"
#include "xboxEnums.h"
Include dependency graph for XBOXUSB.h:
- +
This graph shows which files directly or indirectly include this file:
@@ -120,8 +122,6 @@ Classes Macros #define EP_MAXPKTSIZE   32   -#define EP_INTERRUPT   0x03 -  #define XBOX_CONTROL_PIPE   0   #define XBOX_INPUT_PIPE   1 @@ -146,16 +146,14 @@ Macros   #define MADCATZ_WIRED_PID   0xF016   +#define JOYTECH_WIRED_PID   0xBEEF +  #define GAMESTOP_WIRED_PID   0x0401   #define AFTERGLOW_WIRED_PID   0x0213   #define XBOX_REPORT_BUFFER_SIZE   14   -#define bmREQ_HID_OUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE -  -#define HID_REQUEST_SET_REPORT   0x09 -  #define XBOX_MAX_ENDPOINTS   3   @@ -170,21 +168,7 @@ Macros
-

Definition at line 25 of file XBOXUSB.h.

- -
-
- -
-
- - - - -
#define EP_INTERRUPT   0x03
-
- -

Definition at line 28 of file XBOXUSB.h.

+

Definition at line 26 of file XBOXUSB.h.

@@ -198,7 +182,7 @@ Macros
-

Definition at line 31 of file XBOXUSB.h.

+

Definition at line 29 of file XBOXUSB.h.

@@ -212,7 +196,7 @@ Macros
-

Definition at line 32 of file XBOXUSB.h.

+

Definition at line 30 of file XBOXUSB.h.

@@ -226,7 +210,7 @@ Macros
-

Definition at line 33 of file XBOXUSB.h.

+

Definition at line 31 of file XBOXUSB.h.

@@ -240,7 +224,7 @@ Macros
-

Definition at line 36 of file XBOXUSB.h.

+

Definition at line 34 of file XBOXUSB.h.

@@ -254,7 +238,7 @@ Macros
-

Definition at line 37 of file XBOXUSB.h.

+

Definition at line 35 of file XBOXUSB.h.

@@ -268,7 +252,7 @@ Macros
-

Definition at line 38 of file XBOXUSB.h.

+

Definition at line 36 of file XBOXUSB.h.

@@ -282,7 +266,7 @@ Macros
-

Definition at line 39 of file XBOXUSB.h.

+

Definition at line 37 of file XBOXUSB.h.

@@ -296,7 +280,7 @@ Macros
-

Definition at line 41 of file XBOXUSB.h.

+

Definition at line 39 of file XBOXUSB.h.

@@ -310,7 +294,7 @@ Macros
-

Definition at line 42 of file XBOXUSB.h.

+

Definition at line 40 of file XBOXUSB.h.

@@ -324,7 +308,7 @@ Macros
-

Definition at line 43 of file XBOXUSB.h.

+

Definition at line 41 of file XBOXUSB.h.

@@ -338,7 +322,7 @@ Macros
-

Definition at line 44 of file XBOXUSB.h.

+

Definition at line 42 of file XBOXUSB.h.

@@ -352,7 +336,21 @@ Macros
-

Definition at line 45 of file XBOXUSB.h.

+

Definition at line 43 of file XBOXUSB.h.

+ +
+ + +
+
+ + + + +
#define JOYTECH_WIRED_PID   0xBEEF
+
+ +

Definition at line 44 of file XBOXUSB.h.

@@ -366,7 +364,7 @@ Macros
-

Definition at line 46 of file XBOXUSB.h.

+

Definition at line 45 of file XBOXUSB.h.

@@ -380,7 +378,7 @@ Macros
-

Definition at line 47 of file XBOXUSB.h.

+

Definition at line 46 of file XBOXUSB.h.

@@ -394,35 +392,7 @@ Macros
-

Definition at line 49 of file XBOXUSB.h.

- -
- - -
-
- - - - -
#define bmREQ_HID_OUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
-
- -

Definition at line 52 of file XBOXUSB.h.

- -
-
- -
-
- - - - -
#define HID_REQUEST_SET_REPORT   0x09
-
- -

Definition at line 53 of file XBOXUSB.h.

+

Definition at line 48 of file XBOXUSB.h.

@@ -436,7 +406,7 @@ Macros
-

Definition at line 55 of file XBOXUSB.h.

+

Definition at line 50 of file XBOXUSB.h.

@@ -445,7 +415,7 @@ Macros diff --git a/_x_b_o_x_u_s_b_8h__dep__incl.md5 b/_x_b_o_x_u_s_b_8h__dep__incl.md5 index 03f735e5..ffb0405c 100644 --- a/_x_b_o_x_u_s_b_8h__dep__incl.md5 +++ b/_x_b_o_x_u_s_b_8h__dep__incl.md5 @@ -1 +1 @@ -aef1e874621fe82e06208994ca6c31c1 \ No newline at end of file +18da52fa9e2758f5b169a34307b52822 \ No newline at end of file diff --git a/_x_b_o_x_u_s_b_8h__incl.map b/_x_b_o_x_u_s_b_8h__incl.map index 749333bf..c72dc833 100644 --- a/_x_b_o_x_u_s_b_8h__incl.map +++ b/_x_b_o_x_u_s_b_8h__incl.map @@ -1,5 +1,7 @@ - - - + + + + + diff --git a/_x_b_o_x_u_s_b_8h__incl.md5 b/_x_b_o_x_u_s_b_8h__incl.md5 index f6913543..996076e6 100644 --- a/_x_b_o_x_u_s_b_8h__incl.md5 +++ b/_x_b_o_x_u_s_b_8h__incl.md5 @@ -1 +1 @@ -fbb46adf1eb28c436edfb4eb5f8dd91c \ No newline at end of file +ade2f495e451981906f6ba85da0903b4 \ No newline at end of file diff --git a/_x_b_o_x_u_s_b_8h__incl.png b/_x_b_o_x_u_s_b_8h__incl.png index eb88ee73..138ad26c 100644 Binary files a/_x_b_o_x_u_s_b_8h__incl.png and b/_x_b_o_x_u_s_b_8h__incl.png differ diff --git a/_x_b_o_x_u_s_b_8h_source.html b/_x_b_o_x_u_s_b_8h_source.html index 8f53719e..576ffd6d 100644 --- a/_x_b_o_x_u_s_b_8h_source.html +++ b/_x_b_o_x_u_s_b_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: XBOXUSB.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -110,167 +111,164 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
19 #define _xboxusb_h_
20 
21 #include "Usb.h"
-
22 #include "xboxEnums.h"
-
23 
-
24 /* Data Xbox 360 taken from descriptors */
-
25 #define EP_MAXPKTSIZE 32 // max size for data via USB
-
26 
-
27 /* Endpoint types */
-
28 #define EP_INTERRUPT 0x03
-
29 
-
30 /* Names we give to the 3 Xbox360 pipes */
-
31 #define XBOX_CONTROL_PIPE 0
-
32 #define XBOX_INPUT_PIPE 1
-
33 #define XBOX_OUTPUT_PIPE 2
-
34 
-
35 // PID and VID of the different devices
-
36 #define XBOX_VID 0x045E // Microsoft Corporation
-
37 #define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers
-
38 #define JOYTECH_VID 0x162E // For unofficial Joytech controllers
-
39 #define GAMESTOP_VID 0x0E6F // Gamestop controller
-
40 
-
41 #define XBOX_WIRED_PID 0x028E // Microsoft 360 Wired controller
-
42 #define XBOX_WIRELESS_PID 0x028F // Wireless controller only support charging
-
43 #define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver
-
44 #define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver
-
45 #define MADCATZ_WIRED_PID 0xF016 // Mad Catz wired controller
-
46 #define GAMESTOP_WIRED_PID 0x0401 // Gamestop wired controller
-
47 #define AFTERGLOW_WIRED_PID 0x0213 // Afterglow wired controller - it uses the same VID as a Gamestop controller
-
48 
-
49 #define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer
-
50 
-
51 // Used in control endpoint header for HID Commands
-
52 #define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
-
53 #define HID_REQUEST_SET_REPORT 0x09
-
54 
-
55 #define XBOX_MAX_ENDPOINTS 3
-
56 
-
58 class XBOXUSB : public USBDeviceConfig {
-
59 public:
-
64  XBOXUSB(USB *pUsb);
-
65 
-
74  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
-
79  virtual uint8_t Release();
-
84  virtual uint8_t Poll();
-
85 
-
90  virtual uint8_t GetAddress() {
-
91  return bAddress;
-
92  };
-
93 
-
98  virtual bool isReady() {
-
99  return bPollEnable;
-
100  };
-
101 
-
108  virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
-
109  return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID || vid == GAMESTOP_VID) && (pid == XBOX_WIRED_PID || pid == MADCATZ_WIRED_PID || pid == GAMESTOP_WIRED_PID || pid == AFTERGLOW_WIRED_PID));
-
110  };
-
124  uint8_t getButtonPress(ButtonEnum b);
-
125  bool getButtonClick(ButtonEnum b);
-
134  int16_t getAnalogHat(AnalogHatEnum a);
-
135 
-
137  void setAllOff() {
-
138  setRumbleOn(0, 0);
-
139  setLedRaw(0);
+
22 #include "hid.h"
+
23 #include "xboxEnums.h"
+
24 
+
25 /* Data Xbox 360 taken from descriptors */
+
26 #define EP_MAXPKTSIZE 32 // max size for data via USB
+
27 
+
28 /* Names we give to the 3 Xbox360 pipes */
+
29 #define XBOX_CONTROL_PIPE 0
+
30 #define XBOX_INPUT_PIPE 1
+
31 #define XBOX_OUTPUT_PIPE 2
+
32 
+
33 // PID and VID of the different devices
+
34 #define XBOX_VID 0x045E // Microsoft Corporation
+
35 #define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers
+
36 #define JOYTECH_VID 0x162E // For unofficial Joytech controllers
+
37 #define GAMESTOP_VID 0x0E6F // Gamestop controller
+
38 
+
39 #define XBOX_WIRED_PID 0x028E // Microsoft 360 Wired controller
+
40 #define XBOX_WIRELESS_PID 0x028F // Wireless controller only support charging
+
41 #define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver
+
42 #define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver
+
43 #define MADCATZ_WIRED_PID 0xF016 // Mad Catz wired controller
+
44 #define JOYTECH_WIRED_PID 0xBEEF // For Joytech wired controller
+
45 #define GAMESTOP_WIRED_PID 0x0401 // Gamestop wired controller
+
46 #define AFTERGLOW_WIRED_PID 0x0213 // Afterglow wired controller - it uses the same VID as a Gamestop controller
+
47 
+
48 #define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer
+
49 
+
50 #define XBOX_MAX_ENDPOINTS 3
+
51 
+
53 class XBOXUSB : public USBDeviceConfig {
+
54 public:
+
59  XBOXUSB(USB *pUsb);
+
60 
+
69  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
+
74  uint8_t Release();
+
79  uint8_t Poll();
+
80 
+
85  virtual uint8_t GetAddress() {
+
86  return bAddress;
+
87  };
+
88 
+
93  virtual bool isReady() {
+
94  return bPollEnable;
+
95  };
+
96 
+
103  virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
+
104  return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID || vid == GAMESTOP_VID) && (pid == XBOX_WIRED_PID || pid == MADCATZ_WIRED_PID || pid == GAMESTOP_WIRED_PID || pid == AFTERGLOW_WIRED_PID || pid == JOYTECH_WIRED_PID));
+
105  };
+
119  uint8_t getButtonPress(ButtonEnum b);
+
120  bool getButtonClick(ButtonEnum b);
+
129  int16_t getAnalogHat(AnalogHatEnum a);
+
130 
+
132  void setAllOff() {
+
133  setRumbleOn(0, 0);
+
134  setLedRaw(0);
+
135  };
+
136 
+
138  void setRumbleOff() {
+
139  setRumbleOn(0, 0);
140  };
-
141 
-
143  void setRumbleOff() {
-
144  setRumbleOn(0, 0);
-
145  };
-
151  void setRumbleOn(uint8_t lValue, uint8_t rValue);
-
158  void setLedRaw(uint8_t value);
-
159 
-
161  void setLedOff() {
-
162  setLedRaw(0);
-
163  };
-
168  void setLedOn(LEDEnum l);
-
173  void setLedBlink(LEDEnum l);
-
178  void setLedMode(LEDModeEnum lm);
-
179 
-
184  void attachOnInit(void (*funcOnInit)(void)) {
-
185  pFuncOnInit = funcOnInit;
-
186  };
-
190  bool Xbox360Connected;
-
191 
-
192 protected:
-
194  USB *pUsb;
-
196  uint8_t bAddress;
-
198  EpInfo epInfo[XBOX_MAX_ENDPOINTS];
-
199 
-
200 private:
-
206  void onInit();
-
207  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
-
208 
-
209  bool bPollEnable;
-
210 
-
211  /* Variables to store the buttons */
-
212  uint32_t ButtonState;
-
213  uint32_t OldButtonState;
-
214  uint16_t ButtonClickState;
-
215  int16_t hatValue[4];
-
216  uint16_t controllerStatus;
-
217 
-
218  bool L2Clicked; // These buttons are analog, so we use we use these bools to check if they where clicked or not
-
219  bool R2Clicked;
-
220 
-
221  uint8_t readBuf[EP_MAXPKTSIZE]; // General purpose buffer for input data
-
222  uint8_t writeBuf[8]; // General purpose buffer for output data
-
223 
-
224  void readReport(); // read incoming data
-
225  void printReport(); // print incoming date - Uncomment for debugging
-
226 
-
227  /* Private commands */
-
228  void XboxCommand(uint8_t* data, uint16_t nbytes);
-
229 };
-
230 #endif
-
#define XBOX_WIRED_PID
Definition: XBOXUSB.h:41
+
146  void setRumbleOn(uint8_t lValue, uint8_t rValue);
+
153  void setLedRaw(uint8_t value);
+
154 
+
156  void setLedOff() {
+
157  setLedRaw(0);
+
158  };
+
163  void setLedOn(LEDEnum l);
+
168  void setLedBlink(LEDEnum l);
+
173  void setLedMode(LEDModeEnum lm);
+
174 
+
179  void attachOnInit(void (*funcOnInit)(void)) {
+
180  pFuncOnInit = funcOnInit;
+
181  };
+
185  bool Xbox360Connected;
+
186 
+
187 protected:
+
189  USB *pUsb;
+
191  uint8_t bAddress;
+
193  EpInfo epInfo[XBOX_MAX_ENDPOINTS];
+
194 
+
195 private:
+
201  void onInit();
+
202  void (*pFuncOnInit)(void); // Pointer to function called in onInit()
+
203 
+
204  bool bPollEnable;
+
205 
+
206  /* Variables to store the buttons */
+
207  uint32_t ButtonState;
+
208  uint32_t OldButtonState;
+
209  uint16_t ButtonClickState;
+
210  int16_t hatValue[4];
+
211  uint16_t controllerStatus;
+
212 
+
213  bool L2Clicked; // These buttons are analog, so we use we use these bools to check if they where clicked or not
+
214  bool R2Clicked;
+
215 
+
216  uint8_t readBuf[EP_MAXPKTSIZE]; // General purpose buffer for input data
+
217  uint8_t writeBuf[8]; // General purpose buffer for output data
+
218 
+
219  void readReport(); // read incoming data
+
220  void printReport(); // print incoming date - Uncomment for debugging
+
221 
+
222  /* Private commands */
+
223  void XboxCommand(uint8_t* data, uint16_t nbytes);
+
224 };
+
225 #endif
+
#define XBOX_WIRED_PID
Definition: XBOXUSB.h:39
LEDModeEnum
Definition: xboxEnums.h:24
void setLedOn(LEDEnum l)
Definition: XBOXUSB.cpp:328
-
#define MADCATZ_VID
Definition: XBOXUSB.h:37
-
#define XBOX_MAX_ENDPOINTS
Definition: XBOXUSB.h:55
-
#define JOYTECH_VID
Definition: XBOXUSB.h:38
+
#define MADCATZ_VID
Definition: XBOXUSB.h:35
+
#define XBOX_MAX_ENDPOINTS
Definition: XBOXUSB.h:50
+
#define JOYTECH_VID
Definition: XBOXUSB.h:36
+
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: XBOXUSB.h:103
+
+
#define JOYTECH_WIRED_PID
Definition: XBOXUSB.h:44
AnalogHatEnum
-
USB * pUsb
Definition: XBOXUSB.h:194
-
void setLedOff()
Definition: XBOXUSB.h:161
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXUSB.cpp:38
-
Definition: UsbCore.h:119
+
USB * pUsb
Definition: XBOXUSB.h:189
+
void setLedOff()
Definition: XBOXUSB.h:156
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: XBOXUSB.cpp:38
+
Definition: UsbCore.h:121
int16_t getAnalogHat(AnalogHatEnum a)
Definition: XBOXUSB.cpp:310
void setLedBlink(LEDEnum l)
Definition: XBOXUSB.cpp:335
-
virtual bool isReady()
Definition: XBOXUSB.h:98
-
#define AFTERGLOW_WIRED_PID
Definition: XBOXUSB.h:47
+
virtual bool isReady()
Definition: XBOXUSB.h:93
+
#define AFTERGLOW_WIRED_PID
Definition: XBOXUSB.h:46
LEDEnum
-
void attachOnInit(void(*funcOnInit)(void))
Definition: XBOXUSB.h:184
-
uint8_t bAddress
Definition: XBOXUSB.h:196
+
void attachOnInit(void(*funcOnInit)(void))
Definition: XBOXUSB.h:179
+
uint8_t bAddress
Definition: XBOXUSB.h:191
uint8_t getButtonPress(ButtonEnum b)
Definition: XBOXUSB.cpp:282
Definition: address.h:32
ButtonEnum
-
bool Xbox360Connected
Definition: XBOXUSB.h:186
-
#define XBOX_VID
Definition: XBOXUSB.h:36
+
bool Xbox360Connected
Definition: XBOXUSB.h:181
+
#define XBOX_VID
Definition: XBOXUSB.h:34
void setRumbleOn(uint8_t lValue, uint8_t rValue)
Definition: XBOXUSB.cpp:343
XBOXUSB(USB *pUsb)
Definition: XBOXUSB.cpp:23
-
virtual uint8_t GetAddress()
Definition: XBOXUSB.h:90
-
#define GAMESTOP_VID
Definition: XBOXUSB.h:39
+
virtual uint8_t GetAddress()
Definition: XBOXUSB.h:85
+
#define GAMESTOP_VID
Definition: XBOXUSB.h:37
bool getButtonClick(ButtonEnum b)
Definition: XBOXUSB.cpp:290
-
#define EP_MAXPKTSIZE
Definition: XBOXUSB.h:25
-
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: XBOXUSB.h:108
-
void setRumbleOff()
Definition: XBOXUSB.h:143
+
#define EP_MAXPKTSIZE
Definition: XBOXUSB.h:26
+
void setRumbleOff()
Definition: XBOXUSB.h:138
void setLedRaw(uint8_t value)
Definition: XBOXUSB.cpp:320
void setLedMode(LEDModeEnum lm)
Definition: XBOXUSB.cpp:339
-
#define MADCATZ_WIRED_PID
Definition: XBOXUSB.h:45
-
Definition: XBOXUSB.h:58
-
Definition: UsbCore.h:190
-
void setAllOff()
Definition: XBOXUSB.h:137
-
virtual uint8_t Release()
Definition: XBOXUSB.cpp:223
-
virtual uint8_t Poll()
Definition: XBOXUSB.cpp:231
-
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXUSB.h:198
-
#define GAMESTOP_WIRED_PID
Definition: XBOXUSB.h:46
+
#define MADCATZ_WIRED_PID
Definition: XBOXUSB.h:43
+
Definition: XBOXUSB.h:53
+
Definition: UsbCore.h:197
+
void setAllOff()
Definition: XBOXUSB.h:132
+
uint8_t Release()
Definition: XBOXUSB.cpp:223
+
uint8_t Poll()
Definition: XBOXUSB.cpp:231
+
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
Definition: XBOXUSB.h:193
+
#define GAMESTOP_WIRED_PID
Definition: XBOXUSB.h:45
diff --git a/address_8h.html b/address_8h.html index 1a11ff89..8611f30e 100644 --- a/address_8h.html +++ b/address_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: address.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -132,8 +133,8 @@ Macros - - + +

Typedefs

typedef void(* UsbDeviceHandleFunc )(UsbDevice *pdev)
 
typedef void(* UsbDeviceHandleFunc) (UsbDevice *pdev)
 

Macro Definition Documentation

@@ -263,12 +264,12 @@ Typedefs

Typedef Documentation

- +
- +
typedef void(* UsbDeviceHandleFunc)(UsbDevice *pdev)typedef void(* UsbDeviceHandleFunc) (UsbDevice *pdev)
@@ -282,7 +283,7 @@ Typedefs diff --git a/address_8h_source.html b/address_8h_source.html index f6c8299c..4da712d1 100644 --- a/address_8h_source.html +++ b/address_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: address.h Source File + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
+
@@ -115,10 +116,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
24 
25 /* NAK powers. To save space in endpoint data structure, amount of retries before giving up and returning 0x4 is stored in */
26 /* bmNakPower as a power of 2. The actual nak_limit is then calculated as nak_limit = ( 2^bmNakPower - 1) */
-
27 #define USB_NAK_MAX_POWER 15 //NAK binary order maximum value
-
28 #define USB_NAK_DEFAULT 14 //default 32K-1 NAKs before giving up
-
29 #define USB_NAK_NOWAIT 1 //Single NAK stops transfer
-
30 #define USB_NAK_NONAK 0 //Do not count NAKs, stop retrying after USB Timeout
+
27 #define USB_NAK_MAX_POWER 15 //NAK binary order maximum value
+
28 #define USB_NAK_DEFAULT 14 //default 32K-1 NAKs before giving up
+
29 #define USB_NAK_NOWAIT 1 //Single NAK stops transfer
+
30 #define USB_NAK_NONAK 0 //Do not count NAKs, stop retrying after USB Timeout
31 
32 struct EpInfo {
33  uint8_t epAddr; // Endpoint address
@@ -135,7 +136,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
44  };
45 } __attribute__((packed));
46 
-
47 // 7 6 5 4 3 2 1 0
+
47 // 7 6 5 4 3 2 1 0
48 // ---------------------------------
49 // | | H | P | P | P | A | A | A |
50 // ---------------------------------
@@ -159,16 +160,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
68  };
69 } __attribute__((packed));
70 
-
71 #define bmUSB_DEV_ADDR_ADDRESS 0x07
-
72 #define bmUSB_DEV_ADDR_PARENT 0x38
-
73 #define bmUSB_DEV_ADDR_HUB 0x40
+
71 #define bmUSB_DEV_ADDR_ADDRESS 0x07
+
72 #define bmUSB_DEV_ADDR_PARENT 0x38
+
73 #define bmUSB_DEV_ADDR_HUB 0x40
74 
75 struct UsbDevice {
76  EpInfo *epinfo; // endpoint info pointer
77  UsbDeviceAddress address;
78  uint8_t epcount; // number of endpoints
79  bool lowspeed; // indicates if a device is the low speed one
-
80  // uint8_t devclass; // device class
+
80  // uint8_t devclass; // device class
81 } __attribute__((packed));
82 
83 class AddressPool {
@@ -178,10 +179,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
87  virtual void FreeAddress(uint8_t addr) = 0;
88 };
89 
-
90 typedef void (*UsbDeviceHandleFunc)(UsbDevice *pdev);
+
90 typedef void (*UsbDeviceHandleFunc)(UsbDevice *pdev);
91 
-
92 #define ADDR_ERROR_INVALID_INDEX 0xFF
-
93 #define ADDR_ERROR_INVALID_ADDRESS 0xFF
+
92 #define ADDR_ERROR_INVALID_INDEX 0xFF
+
93 #define ADDR_ERROR_INVALID_ADDRESS 0xFF
94 
95 template <const uint8_t MAX_DEVICES_ALLOWED>
96 class AddressPoolImpl : public AddressPool {
@@ -279,7 +280,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
188 
189  // Performs an operation specified by pfunc for each addressed device
190 
-
191  void ForEachUsbDevice(UsbDeviceHandleFunc pfunc) {
+
191  void ForEachUsbDevice(UsbDeviceHandleFunc pfunc) {
192  if(!pfunc)
193  return;
194 
@@ -356,17 +357,17 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
265  // It can be rather helpfull to find out if there are hubs attached than getting the exact number of hubs.
266  //uint8_t GetNumHubs()
267  //{
-
268  // return hubCounter;
+
268  // return hubCounter;
269  //};
270  //uint8_t GetNumDevices()
271  //{
-
272  // uint8_t counter = 0;
+
272  // uint8_t counter = 0;
273 
-
274  // for (uint8_t i=1; i<MAX_DEVICES_ALLOWED; i++)
-
275  // if (thePool[i].address != 0);
-
276  // counter ++;
+
274  // for (uint8_t i=1; i<MAX_DEVICES_ALLOWED; i++)
+
275  // if (thePool[i].address != 0);
+
276  // counter ++;
277 
-
278  // return counter;
+
278  // return counter;
279  //};
280 };
281 
@@ -385,7 +386,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
uint8_t epAddr
Definition: address.h:33
#define USB_NAK_MAX_POWER
Definition: address.h:27
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)
Definition: address.h:180
-
void(* UsbDeviceHandleFunc)(UsbDevice *pdev)
Definition: address.h:90
Definition: address.h:32
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
uint8_t bmSndToggle
Definition: address.h:40
@@ -401,12 +401,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)
Definition: address.h:202
UsbDeviceAddress address
Definition: address.h:77
uint8_t bmHub
Definition: address.h:64
+
void(* UsbDeviceHandleFunc)(UsbDevice *pdev)
Definition: address.h:90
diff --git a/adk_8cpp.html b/adk_8cpp.html index 432c50a5..c551d280 100644 --- a/adk_8cpp.html +++ b/adk_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: adk.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -104,7 +105,7 @@ Include dependency graph for adk.cpp:
diff --git a/adk_8cpp__incl.md5 b/adk_8cpp__incl.md5 index a794ca89..aeb01f6d 100644 --- a/adk_8cpp__incl.md5 +++ b/adk_8cpp__incl.md5 @@ -1 +1 @@ -d6ef7cc264e9225e78397a4cf8f08152 \ No newline at end of file +44064901c7f950ea3e40c91d455ee2ad \ No newline at end of file diff --git a/adk_8cpp_source.html b/adk_8cpp_source.html index dbbff754..99cb8af4 100644 --- a/adk_8cpp_source.html +++ b/adk_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: adk.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -384,8 +385,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
293 #endif
294 
295  //FailOnInit:
-
296  // USBTRACE("OnInit:");
-
297  // goto Fail;
+
296  // USBTRACE("OnInit:");
+
297  // goto Fail;
298  //
299 SwAttempt:
300 #ifdef DEBUG_USB_HOST
@@ -445,22 +446,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
354 }
355 
356 void ADK::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) {
-
357  Notify(PSTR("Endpoint descriptor:"), 0x80);
-
358  Notify(PSTR("\r\nLength:\t\t"), 0x80);
-
359  PrintHex<uint8_t > (ep_ptr->bLength, 0x80);
-
360  Notify(PSTR("\r\nType:\t\t"), 0x80);
-
361  PrintHex<uint8_t > (ep_ptr->bDescriptorType, 0x80);
-
362  Notify(PSTR("\r\nAddress:\t"), 0x80);
-
363  PrintHex<uint8_t > (ep_ptr->bEndpointAddress, 0x80);
-
364  Notify(PSTR("\r\nAttributes:\t"), 0x80);
-
365  PrintHex<uint8_t > (ep_ptr->bmAttributes, 0x80);
-
366  Notify(PSTR("\r\nMaxPktSize:\t"), 0x80);
-
367  PrintHex<uint16_t > (ep_ptr->wMaxPacketSize, 0x80);
-
368  Notify(PSTR("\r\nPoll Intrv:\t"), 0x80);
-
369  PrintHex<uint8_t > (ep_ptr->bInterval, 0x80);
-
370  Notify(PSTR("\r\n"), 0x80);
+
357  Notify(PSTR("Endpoint descriptor:"), 0x80);
+
358  Notify(PSTR("\r\nLength:\t\t"), 0x80);
+
359  D_PrintHex<uint8_t > (ep_ptr->bLength, 0x80);
+
360  Notify(PSTR("\r\nType:\t\t"), 0x80);
+
361  D_PrintHex<uint8_t > (ep_ptr->bDescriptorType, 0x80);
+
362  Notify(PSTR("\r\nAddress:\t"), 0x80);
+
363  D_PrintHex<uint8_t > (ep_ptr->bEndpointAddress, 0x80);
+
364  Notify(PSTR("\r\nAttributes:\t"), 0x80);
+
365  D_PrintHex<uint8_t > (ep_ptr->bmAttributes, 0x80);
+
366  Notify(PSTR("\r\nMaxPktSize:\t"), 0x80);
+
367  D_PrintHex<uint16_t > (ep_ptr->wMaxPacketSize, 0x80);
+
368  Notify(PSTR("\r\nPoll Intrv:\t"), 0x80);
+
369  D_PrintHex<uint8_t > (ep_ptr->bInterval, 0x80);
+
370  Notify(PSTR("\r\n"), 0x80);
371 }
-
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:766
+
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:769
Definition: address.h:83
#define ADB_PID
Definition: adk.h:27
#define ACCESSORY_STRING_MODEL
Definition: adk.h:43
@@ -468,10 +469,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr)
Definition: adk.cpp:346
EpInfo * epinfo
Definition: address.h:76
bool lowspeed
Definition: address.h:79
-
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:81
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
uint8_t bmNakPower
Definition: address.h:42
Definition: address.h:75
-
virtual uint8_t Release()
Definition: adk.cpp:336
+
uint8_t Release()
Definition: adk.cpp:336
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
Definition: adk.cpp:352
Definition: usb_ch9.h:141
@@ -479,10 +480,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
uint8_t bLength
Definition: usb_ch9.h:142
#define ACCESSORY_STRING_URI
Definition: adk.h:46
#define ACCESSORY_STRING_MANUFACTURER
Definition: adk.h:42
-
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: adk.cpp:311
+
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: adk.cpp:311
USB * pUsb
Definition: adk.h:73
-
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:805
-
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: adk.cpp:58
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
+
uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: adk.cpp:58
#define NotifyFailGetDevDescr(...)
Definition: message.h:50
static const uint8_t epDataOutIndex
Definition: adk.h:70
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
@@ -492,9 +493,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
#define Notify(...)
Definition: message.h:44
uint8_t bmAttributes
Definition: usb_ch9.h:145
-
+
#define USBTRACE2(s, r)
Definition: macros.h:77
-
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:796
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
#define NotifyFailGetConfDescr(...)
Definition: message.h:52
uint8_t epAddr
Definition: address.h:33
#define USB_NAK_MAX_POWER
Definition: address.h:27
@@ -508,35 +509,36 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
EpInfo epInfo[ADK_MAX_ENDPOINTS]
Definition: adk.h:81
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
uint8_t bEndpointAddress
Definition: usb_ch9.h:144
-
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:83
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
+
#define PSTR(str)
#define ADK_MAX_ENDPOINTS
Definition: adk.h:49
uint8_t bDescriptorType
Definition: usb_ch9.h:143
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
Definition: adk.cpp:356
#define USB_NAK_NOWAIT
Definition: address.h:29
-
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:80
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
Definition: Usb.cpp:206
uint8_t maxPktSize
Definition: address.h:34
-
AddressPool & GetAddressPool()
Definition: UsbCore.h:206
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: adk.cpp:63
-
Definition: UsbCore.h:190
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: adk.cpp:63
+
Definition: UsbCore.h:197
#define ACCESSORY_STRING_DESCRIPTION
Definition: adk.h:44
uint8_t bNumEP
Definition: adk.h:77
#define ADK_VID
Definition: adk.h:25
-
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:210
+
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:217
#define NotifyFailSetConfDescr(...)
Definition: message.h:53
uint8_t bConfNum
Definition: adk.h:75
#define USBTRACE(s)
Definition: macros.h:75
-
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:761
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:51
uint8_t bAddress
Definition: adk.h:74
-
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
Definition: UsbCore.h:86
+
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
Definition: UsbCore.h:88
Definition: usb_ch9.h:98
diff --git a/adk_8h.html b/adk_8h.html index d26f844d..c8ca1a91 100644 --- a/adk_8h.html +++ b/adk_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: adk.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -380,7 +381,7 @@ Macros diff --git a/adk_8h__dep__incl.md5 b/adk_8h__dep__incl.md5 index ddb1727d..721031bf 100644 --- a/adk_8h__dep__incl.md5 +++ b/adk_8h__dep__incl.md5 @@ -1 +1 @@ -c99e1b47b64e7d137c66cdf8662c2d34 \ No newline at end of file +e6d0d56c52d3fb6e81b76806cae456b2 \ No newline at end of file diff --git a/adk_8h__incl.md5 b/adk_8h__incl.md5 index 12b6b5d1..78ab8688 100644 --- a/adk_8h__incl.md5 +++ b/adk_8h__incl.md5 @@ -1 +1 @@ -60a0d9759961c77b6c4712add13727e1 \ No newline at end of file +6316d3a392a1c1e1b044b310cd053323 \ No newline at end of file diff --git a/adk_8h_source.html b/adk_8h_source.html index 4248c570..49bbe11c 100644 --- a/adk_8h_source.html +++ b/adk_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: adk.h Source File + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -174,7 +175,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
83  void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr);
84 
85 public:
-
86  ADK(USB *pUsb, const char* manufacturer,
+
86  ADK(USB *pUsb, const char* manufacturer,
87  const char* model,
88  const char* description,
89  const char* version,
@@ -187,9 +188,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
96 
97 
98  // USBDeviceConfig implementation
-
99  virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed);
-
100  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
-
101  virtual uint8_t Release();
+
99  uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed);
+
100  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
+
101  uint8_t Release();
102 
103  virtual uint8_t Poll() {
104  return 0;
@@ -203,12 +204,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
112  return ready;
113  };
114 
-
115  virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
+
115  virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
116  return (vid == ADK_VID && (pid == ADK_PID || pid == ADB_PID));
117  };
118 
119  //UsbConfigXtracter implementation
-
120  virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
+
120  void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
121 }; //class ADK : public USBDeviceConfig ...
122 
123 /* get ADK protocol version */
@@ -232,14 +233,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
#define ADB_PID
Definition: adk.h:27
static const uint8_t epDataInIndex
Definition: adk.h:69
uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr)
Definition: adk.cpp:346
-
virtual uint8_t Release()
Definition: adk.cpp:336
+
uint8_t Release()
Definition: adk.cpp:336
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
Definition: adk.cpp:352
Definition: usb_ch9.h:141
-
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: adk.cpp:311
+
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: adk.cpp:311
USB * pUsb
Definition: adk.h:73
-
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: adk.cpp:58
+
uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
Definition: adk.cpp:58
#define ADK_GETPROTO
Definition: adk.h:35
-
Definition: UsbCore.h:119
+
Definition: UsbCore.h:121
virtual bool isReady()
Definition: adk.h:111
static const uint8_t epDataOutIndex
Definition: adk.h:70
@@ -253,15 +254,15 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
bool ready
Definition: adk.h:78
virtual uint8_t GetAddress()
Definition: adk.h:107
Definition: address.h:32
-
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: adk.h:115
ADK(USB *pUsb, const char *manufacturer, const char *model, const char *description, const char *version, const char *uri, const char *serial)
Definition: adk.cpp:25
EpInfo epInfo[ADK_MAX_ENDPOINTS]
Definition: adk.h:81
#define bmREQ_ADK_SEND
Definition: adk.h:40
#define ADK_MAX_ENDPOINTS
Definition: adk.h:49
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
Definition: adk.cpp:356
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: adk.cpp:63
-
Definition: UsbCore.h:190
+
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: adk.h:115
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: adk.cpp:63
+
Definition: UsbCore.h:197
uint8_t bNumEP
Definition: adk.h:77
#define ADK_VID
Definition: adk.h:25
uint8_t bConfNum
Definition: adk.h:75
@@ -271,7 +272,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/annotated.html b/annotated.html index 3c6a9048..4dec11f0 100644 --- a/annotated.html +++ b/annotated.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class List + @@ -31,7 +32,7 @@
- + @@ -73,7 +74,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -161,23 +162,26 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');  CSPP  CTEL_RINGER_FUNC_DESCR  CtouchpadXY - CUniversalReportParser - CUSB - CUSB_CONFIGURATION_DESCRIPTOR - CUSB_DEVICE_DESCRIPTOR - CUSB_ENDPOINT_DESCRIPTOR - CUSB_HID_DESCRIPTOR - CUSB_INTERFACE_DESCRIPTOR - CUsbConfigXtracter - CUsbDevice - CUsbDeviceAddress - CUSBDeviceConfig - CUSBHub - CUSBReadParser - CWII - CXBOXOLD - CXBOXRECV - CXBOXUSB + Ctty_features + CUniversalReportParser + CUSB + CUSB_CONFIGURATION_DESCRIPTOR + CUSB_DEVICE_DESCRIPTOR + CUSB_ENDPOINT_DESCRIPTOR + CUSB_HID_DESCRIPTOR + CUSB_INTERFACE_DESCRIPTOR + CUsbConfigXtracter + CUsbDevice + CUsbDeviceAddress + CUSBDeviceConfig + CUSBHub + CUSBReadParser + CWII + CXBOXOLD + CXBOXONE + CXBOXRECV + CXBOXUSB + CXR21B1411
@@ -185,7 +189,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/arrowdown.png b/arrowdown.png new file mode 100644 index 00000000..0b63f6d3 Binary files /dev/null and b/arrowdown.png differ diff --git a/arrowright.png b/arrowright.png new file mode 100644 index 00000000..c6ee22f9 Binary files /dev/null and b/arrowright.png differ diff --git a/avrpins_8h.html b/avrpins_8h.html index a2912514..e2f35248 100644 --- a/avrpins_8h.html +++ b/avrpins_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: avrpins.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -96,7 +97,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/avrpins_8h_source.html b/avrpins_8h_source.html index 062716c9..a8921eb0 100644 --- a/avrpins_8h_source.html +++ b/avrpins_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: avrpins.h Source File + @@ -31,7 +32,7 @@
- + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -763,217 +764,468 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
672 // http://balanduino.net/
673 #define P0 Pd0 /* 0 - PD0 */
674 #define P1 Pd1 /* 1 - PD1 */
-
675 #define P2 Pb2 /* 2 - PB2 */
-
676 #define P3 Pd6 /* 3 - PD6 */
-
677 #define P4 Pd7 /* 4 - PD7 */
-
678 #define P5 Pb3 /* 5 - PB3 */
-
679 #define P6 Pb4 /* 6 - PB4 */
-
680 #define P7 Pa0 /* 7 - PA0 */
-
681 #define P8 Pa1 /* 8 - PA1 */
-
682 #define P9 Pa2 /* 9 - PA2 */
-
683 #define P10 Pa3 /* 10 - PA3 */
-
684 #define P11 Pa4 /* 11 - PA4 */
-
685 #define P12 Pa5 /* 12 - PA5 */
-
686 #define P13 Pc1 /* 13 - PC1 */
-
687 #define P14 Pc0 /* 14 - PC0 */
-
688 #define P15 Pd2 /* 15 - PD2 */
-
689 #define P16 Pd3 /* 16 - PD3 */
-
690 #define P17 Pd4 /* 17 - PD4 */
-
691 #define P18 Pd5 /* 18 - PD5 */
-
692 #define P19 Pc2 /* 19 - PC2 */
-
693 #define P20 Pc3 /* 20 - PC3 */
-
694 #define P21 Pc4 /* 21 - PC4 */
-
695 #define P22 Pc5 /* 22 - PC5 */
-
696 #define P23 Pc6 /* 23 - PC6 */
-
697 #define P24 Pc7 /* 24 - PC7 */
-
698 #define P25 Pb0 /* 25 - PB0 */
-
699 #define P26 Pb1 /* 26 - PB1 */
-
700 #define P27 Pb5 /* 27 - PB5 */
-
701 #define P28 Pb6 /* 28 - PB6 */
-
702 #define P29 Pb7 /* 29 - PB7 */
-
703 #define P30 Pa6 /* 30 - PA6 */
-
704 #define P31 Pa7 /* 31 - PA7 */
-
705 // Balanduino
-
706 
-
707 #elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)
-
708 // Sanguino pin numbers
-
709 // Homepage: http://sanguino.cc/hardware
-
710 // Hardware add-on: https://github.com/Lauszus/Sanguino
-
711 #define P0 Pb0
-
712 #define P1 Pb1
-
713 #define P2 Pb2
-
714 #define P3 Pb3
-
715 #define P4 Pb4
-
716 #define P5 Pb5
-
717 #define P6 Pb6
-
718 #define P7 Pb7
-
719 #define P8 Pd0
-
720 #define P9 Pd1
-
721 #define P10 Pd2
-
722 #define P11 Pd3
-
723 #define P12 Pd4
-
724 #define P13 Pd5
-
725 #define P14 Pd6
-
726 #define P15 Pd7
-
727 #define P16 Pc0
-
728 #define P17 Pc1
-
729 #define P18 Pc2
-
730 #define P19 Pc3
-
731 #define P20 Pc4
-
732 #define P21 Pc5
-
733 #define P22 Pc6
-
734 #define P23 Pc7
-
735 #define P24 Pa0
-
736 #define P25 Pa1
-
737 #define P26 Pa2
-
738 #define P27 Pa3
-
739 #define P28 Pa4
-
740 #define P29 Pa5
-
741 #define P30 Pa6
-
742 #define P31 Pa7
-
743 // Sanguino
-
744 
-
745 #else
-
746 #error "Please define board in avrpins.h"
-
747 
-
748 #endif // Arduino pin definitions
-
749 
-
750 #endif // __AVR__
-
751 
-
752 #if defined(__arm__)
-
753 
-
754 // pointers are 32 bits on ARM
-
755 #define pgm_read_pointer(p) pgm_read_dword(p)
-
756 
-
757 #if defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__))
-
758 
-
759 #include "core_pins.h"
-
760 #include "avr_emulation.h"
-
761 
-
762 #define GPIO_BITBAND_ADDR(reg, bit) (((uint32_t)&(reg) - 0x40000000) * 32 + (bit) * 4 + 0x42000000)
-
763 #define GPIO_BITBAND_PTR(reg, bit) ((uint8_t *)GPIO_BITBAND_ADDR((reg), (bit)))
-
764 
-
765 #define MAKE_PIN(className, baseReg, pinNum, configReg) \
-
766 class className { \
-
767 public: \
-
768  static void Set() { \
-
769  *GPIO_BITBAND_PTR(baseReg, pinNum) = 1; \
-
770  } \
-
771  static void Clear() { \
-
772  *GPIO_BITBAND_PTR(baseReg, pinNum) = 0; \
-
773  } \
-
774  static void SetDirRead() { \
-
775  configReg = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1); \
-
776  *(GPIO_BITBAND_PTR(baseReg, pinNum) + 640) = 0; \
-
777  } \
-
778  static void SetDirWrite() { \
-
779  configReg = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1); \
-
780  *(GPIO_BITBAND_PTR(baseReg, pinNum) + 640) = 1; \
-
781  } \
-
782  static uint8_t IsSet() { \
-
783  return *(GPIO_BITBAND_PTR(baseReg, pinNum) + 512); \
+
675 
+
676 #if BALANDUINO_REVISION < 13
+
677  #define P2 Pb2 /* 2 - PB2 */
+
678  #define P3 Pd6 /* 3 - PD6 */
+
679  #define P4 Pd7 /* 4 - PD7 */
+
680  #define P5 Pb3 /* 5 - PB3 */
+
681 #else
+
682  #define P2 Pd2 /* 2 - PD2 */
+
683  #define P3 Pd3 /* 3 - PD3 */
+
684  #define P4 Pd6 /* 4 - PD6 */
+
685  #define P5 Pd7 /* 5 - PD7 */
+
686 #endif
+
687 
+
688 #define P6 Pb4 /* 6 - PB4 */
+
689 #define P7 Pa0 /* 7 - PA0 */
+
690 #define P8 Pa1 /* 8 - PA1 */
+
691 #define P9 Pa2 /* 9 - PA2 */
+
692 #define P10 Pa3 /* 10 - PA3 */
+
693 #define P11 Pa4 /* 11 - PA4 */
+
694 #define P12 Pa5 /* 12 - PA5 */
+
695 #define P13 Pc1 /* 13 - PC1 */
+
696 #define P14 Pc0 /* 14 - PC0 */
+
697 
+
698 #if BALANDUINO_REVISION < 13
+
699  #define P15 Pd2 /* 15 - PD2 */
+
700  #define P16 Pd3 /* 16 - PD3 */
+
701 #else
+
702  #define P15 Pb2 /* 15 - PB2 */
+
703  #define P16 Pb3 /* 16 - PB2 */
+
704 #endif
+
705 
+
706 #define P17 Pd4 /* 17 - PD4 */
+
707 #define P18 Pd5 /* 18 - PD5 */
+
708 #define P19 Pc2 /* 19 - PC2 */
+
709 #define P20 Pc3 /* 20 - PC3 */
+
710 #define P21 Pc4 /* 21 - PC4 */
+
711 #define P22 Pc5 /* 22 - PC5 */
+
712 #define P23 Pc6 /* 23 - PC6 */
+
713 #define P24 Pc7 /* 24 - PC7 */
+
714 #define P25 Pb0 /* 25 - PB0 */
+
715 #define P26 Pb1 /* 26 - PB1 */
+
716 #define P27 Pb5 /* 27 - PB5 */
+
717 #define P28 Pb6 /* 28 - PB6 */
+
718 #define P29 Pb7 /* 29 - PB7 */
+
719 #define P30 Pa6 /* 30 - PA6 */
+
720 #define P31 Pa7 /* 31 - PA7 */
+
721 // Balanduino
+
722 
+
723 #elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)
+
724 // Sanguino pin numbers
+
725 // Homepage: http://sanguino.cc/hardware
+
726 // Hardware add-on: https://github.com/Lauszus/Sanguino
+
727 #define P0 Pb0
+
728 #define P1 Pb1
+
729 #define P2 Pb2
+
730 #define P3 Pb3
+
731 #define P4 Pb4
+
732 #define P5 Pb5
+
733 #define P6 Pb6
+
734 #define P7 Pb7
+
735 #define P8 Pd0
+
736 #define P9 Pd1
+
737 #define P10 Pd2
+
738 #define P11 Pd3
+
739 #define P12 Pd4
+
740 #define P13 Pd5
+
741 #define P14 Pd6
+
742 #define P15 Pd7
+
743 #define P16 Pc0
+
744 #define P17 Pc1
+
745 #define P18 Pc2
+
746 #define P19 Pc3
+
747 #define P20 Pc4
+
748 #define P21 Pc5
+
749 #define P22 Pc6
+
750 #define P23 Pc7
+
751 #define P24 Pa0
+
752 #define P25 Pa1
+
753 #define P26 Pa2
+
754 #define P27 Pa3
+
755 #define P28 Pa4
+
756 #define P29 Pa5
+
757 #define P30 Pa6
+
758 #define P31 Pa7
+
759 // Sanguino
+
760 
+
761 #else
+
762 #error "Please define board in avrpins.h"
+
763 
+
764 #endif // Arduino pin definitions
+
765 
+
766 #elif defined(__arm__)
+
767 
+
768 // pointers are 32 bits on ARM
+
769 #define pgm_read_pointer(p) pgm_read_dword(p)
+
770 
+
771 #if defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__))
+
772 
+
773 #include "core_pins.h"
+
774 #include "avr_emulation.h"
+
775 
+
776 #define GPIO_BITBAND_ADDR(reg, bit) (((uint32_t)&(reg) - 0x40000000) * 32 + (bit) * 4 + 0x42000000)
+
777 #define GPIO_BITBAND_PTR(reg, bit) ((uint8_t *)GPIO_BITBAND_ADDR((reg), (bit)))
+
778 
+
779 #define MAKE_PIN(className, baseReg, pinNum, configReg) \
+
780 class className { \
+
781 public: \
+
782  static void Set() { \
+
783  *GPIO_BITBAND_PTR(baseReg, pinNum) = 1; \
784  } \
-
785 };
-
786 
-
787 MAKE_PIN(P0, CORE_PIN0_PORTREG, CORE_PIN0_BIT, CORE_PIN0_CONFIG);
-
788 MAKE_PIN(P1, CORE_PIN1_PORTREG, CORE_PIN1_BIT, CORE_PIN1_CONFIG);
-
789 MAKE_PIN(P2, CORE_PIN2_PORTREG, CORE_PIN2_BIT, CORE_PIN2_CONFIG);
-
790 MAKE_PIN(P3, CORE_PIN3_PORTREG, CORE_PIN3_BIT, CORE_PIN3_CONFIG);
-
791 MAKE_PIN(P4, CORE_PIN4_PORTREG, CORE_PIN4_BIT, CORE_PIN4_CONFIG);
-
792 MAKE_PIN(P5, CORE_PIN5_PORTREG, CORE_PIN5_BIT, CORE_PIN5_CONFIG);
-
793 MAKE_PIN(P6, CORE_PIN6_PORTREG, CORE_PIN6_BIT, CORE_PIN6_CONFIG);
-
794 MAKE_PIN(P7, CORE_PIN7_PORTREG, CORE_PIN7_BIT, CORE_PIN7_CONFIG);
-
795 MAKE_PIN(P8, CORE_PIN8_PORTREG, CORE_PIN8_BIT, CORE_PIN8_CONFIG);
-
796 MAKE_PIN(P9, CORE_PIN9_PORTREG, CORE_PIN9_BIT, CORE_PIN9_CONFIG);
-
797 MAKE_PIN(P10, CORE_PIN10_PORTREG, CORE_PIN10_BIT, CORE_PIN10_CONFIG);
-
798 MAKE_PIN(P11, CORE_PIN11_PORTREG, CORE_PIN11_BIT, CORE_PIN11_CONFIG);
-
799 MAKE_PIN(P12, CORE_PIN12_PORTREG, CORE_PIN12_BIT, CORE_PIN12_CONFIG);
-
800 MAKE_PIN(P13, CORE_PIN13_PORTREG, CORE_PIN13_BIT, CORE_PIN13_CONFIG);
-
801 MAKE_PIN(P14, CORE_PIN14_PORTREG, CORE_PIN14_BIT, CORE_PIN14_CONFIG);
-
802 MAKE_PIN(P15, CORE_PIN15_PORTREG, CORE_PIN15_BIT, CORE_PIN15_CONFIG);
-
803 MAKE_PIN(P16, CORE_PIN16_PORTREG, CORE_PIN16_BIT, CORE_PIN16_CONFIG);
-
804 MAKE_PIN(P17, CORE_PIN17_PORTREG, CORE_PIN17_BIT, CORE_PIN17_CONFIG);
-
805 MAKE_PIN(P18, CORE_PIN18_PORTREG, CORE_PIN18_BIT, CORE_PIN18_CONFIG);
-
806 MAKE_PIN(P19, CORE_PIN19_PORTREG, CORE_PIN19_BIT, CORE_PIN19_CONFIG);
-
807 MAKE_PIN(P20, CORE_PIN20_PORTREG, CORE_PIN20_BIT, CORE_PIN20_CONFIG);
-
808 MAKE_PIN(P21, CORE_PIN21_PORTREG, CORE_PIN21_BIT, CORE_PIN21_CONFIG);
-
809 MAKE_PIN(P22, CORE_PIN22_PORTREG, CORE_PIN22_BIT, CORE_PIN22_CONFIG);
-
810 MAKE_PIN(P23, CORE_PIN23_PORTREG, CORE_PIN23_BIT, CORE_PIN23_CONFIG);
-
811 MAKE_PIN(P24, CORE_PIN24_PORTREG, CORE_PIN24_BIT, CORE_PIN24_CONFIG);
-
812 MAKE_PIN(P25, CORE_PIN25_PORTREG, CORE_PIN25_BIT, CORE_PIN25_CONFIG);
-
813 MAKE_PIN(P26, CORE_PIN26_PORTREG, CORE_PIN26_BIT, CORE_PIN26_CONFIG);
-
814 MAKE_PIN(P27, CORE_PIN27_PORTREG, CORE_PIN27_BIT, CORE_PIN27_CONFIG);
-
815 MAKE_PIN(P28, CORE_PIN28_PORTREG, CORE_PIN28_BIT, CORE_PIN28_CONFIG);
-
816 MAKE_PIN(P29, CORE_PIN29_PORTREG, CORE_PIN29_BIT, CORE_PIN29_CONFIG);
-
817 MAKE_PIN(P30, CORE_PIN30_PORTREG, CORE_PIN30_BIT, CORE_PIN30_CONFIG);
-
818 MAKE_PIN(P31, CORE_PIN31_PORTREG, CORE_PIN31_BIT, CORE_PIN31_CONFIG);
-
819 MAKE_PIN(P32, CORE_PIN32_PORTREG, CORE_PIN32_BIT, CORE_PIN32_CONFIG);
-
820 MAKE_PIN(P33, CORE_PIN33_PORTREG, CORE_PIN33_BIT, CORE_PIN33_CONFIG);
-
821 
-
822 #undef MAKE_PIN
-
823 
-
824 #elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)
-
825 
-
826 // SetDirRead:
-
827 // Disable interrupts
-
828 // Disable the pull up resistor
-
829 // Set to INPUT
-
830 // Enable PIO
-
831 
-
832 // SetDirWrite:
-
833 // Disable interrupts
-
834 // Disable the pull up resistor
-
835 // Set to OUTPUT
-
836 // Enable PIO
+
785  static void Clear() { \
+
786  *GPIO_BITBAND_PTR(baseReg, pinNum) = 0; \
+
787  } \
+
788  static void SetDirRead() { \
+
789  configReg = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1); \
+
790  *(GPIO_BITBAND_PTR(baseReg, pinNum) + 640) = 0; \
+
791  } \
+
792  static void SetDirWrite() { \
+
793  configReg = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1); \
+
794  *(GPIO_BITBAND_PTR(baseReg, pinNum) + 640) = 1; \
+
795  } \
+
796  static uint8_t IsSet() { \
+
797  return *(GPIO_BITBAND_PTR(baseReg, pinNum) + 512); \
+
798  } \
+
799 };
+
800 
+
801 MAKE_PIN(P0, CORE_PIN0_PORTREG, CORE_PIN0_BIT, CORE_PIN0_CONFIG);
+
802 MAKE_PIN(P1, CORE_PIN1_PORTREG, CORE_PIN1_BIT, CORE_PIN1_CONFIG);
+
803 MAKE_PIN(P2, CORE_PIN2_PORTREG, CORE_PIN2_BIT, CORE_PIN2_CONFIG);
+
804 MAKE_PIN(P3, CORE_PIN3_PORTREG, CORE_PIN3_BIT, CORE_PIN3_CONFIG);
+
805 MAKE_PIN(P4, CORE_PIN4_PORTREG, CORE_PIN4_BIT, CORE_PIN4_CONFIG);
+
806 MAKE_PIN(P5, CORE_PIN5_PORTREG, CORE_PIN5_BIT, CORE_PIN5_CONFIG);
+
807 MAKE_PIN(P6, CORE_PIN6_PORTREG, CORE_PIN6_BIT, CORE_PIN6_CONFIG);
+
808 MAKE_PIN(P7, CORE_PIN7_PORTREG, CORE_PIN7_BIT, CORE_PIN7_CONFIG);
+
809 MAKE_PIN(P8, CORE_PIN8_PORTREG, CORE_PIN8_BIT, CORE_PIN8_CONFIG);
+
810 MAKE_PIN(P9, CORE_PIN9_PORTREG, CORE_PIN9_BIT, CORE_PIN9_CONFIG);
+
811 MAKE_PIN(P10, CORE_PIN10_PORTREG, CORE_PIN10_BIT, CORE_PIN10_CONFIG);
+
812 MAKE_PIN(P11, CORE_PIN11_PORTREG, CORE_PIN11_BIT, CORE_PIN11_CONFIG);
+
813 MAKE_PIN(P12, CORE_PIN12_PORTREG, CORE_PIN12_BIT, CORE_PIN12_CONFIG);
+
814 MAKE_PIN(P13, CORE_PIN13_PORTREG, CORE_PIN13_BIT, CORE_PIN13_CONFIG);
+
815 MAKE_PIN(P14, CORE_PIN14_PORTREG, CORE_PIN14_BIT, CORE_PIN14_CONFIG);
+
816 MAKE_PIN(P15, CORE_PIN15_PORTREG, CORE_PIN15_BIT, CORE_PIN15_CONFIG);
+
817 MAKE_PIN(P16, CORE_PIN16_PORTREG, CORE_PIN16_BIT, CORE_PIN16_CONFIG);
+
818 MAKE_PIN(P17, CORE_PIN17_PORTREG, CORE_PIN17_BIT, CORE_PIN17_CONFIG);
+
819 MAKE_PIN(P18, CORE_PIN18_PORTREG, CORE_PIN18_BIT, CORE_PIN18_CONFIG);
+
820 MAKE_PIN(P19, CORE_PIN19_PORTREG, CORE_PIN19_BIT, CORE_PIN19_CONFIG);
+
821 MAKE_PIN(P20, CORE_PIN20_PORTREG, CORE_PIN20_BIT, CORE_PIN20_CONFIG);
+
822 MAKE_PIN(P21, CORE_PIN21_PORTREG, CORE_PIN21_BIT, CORE_PIN21_CONFIG);
+
823 MAKE_PIN(P22, CORE_PIN22_PORTREG, CORE_PIN22_BIT, CORE_PIN22_CONFIG);
+
824 MAKE_PIN(P23, CORE_PIN23_PORTREG, CORE_PIN23_BIT, CORE_PIN23_CONFIG);
+
825 MAKE_PIN(P24, CORE_PIN24_PORTREG, CORE_PIN24_BIT, CORE_PIN24_CONFIG);
+
826 MAKE_PIN(P25, CORE_PIN25_PORTREG, CORE_PIN25_BIT, CORE_PIN25_CONFIG);
+
827 MAKE_PIN(P26, CORE_PIN26_PORTREG, CORE_PIN26_BIT, CORE_PIN26_CONFIG);
+
828 MAKE_PIN(P27, CORE_PIN27_PORTREG, CORE_PIN27_BIT, CORE_PIN27_CONFIG);
+
829 MAKE_PIN(P28, CORE_PIN28_PORTREG, CORE_PIN28_BIT, CORE_PIN28_CONFIG);
+
830 MAKE_PIN(P29, CORE_PIN29_PORTREG, CORE_PIN29_BIT, CORE_PIN29_CONFIG);
+
831 MAKE_PIN(P30, CORE_PIN30_PORTREG, CORE_PIN30_BIT, CORE_PIN30_CONFIG);
+
832 MAKE_PIN(P31, CORE_PIN31_PORTREG, CORE_PIN31_BIT, CORE_PIN31_CONFIG);
+
833 MAKE_PIN(P32, CORE_PIN32_PORTREG, CORE_PIN32_BIT, CORE_PIN32_CONFIG);
+
834 MAKE_PIN(P33, CORE_PIN33_PORTREG, CORE_PIN33_BIT, CORE_PIN33_CONFIG);
+
835 
+
836 #undef MAKE_PIN
837 
-
838 #define MAKE_PIN(className, pio, pinMask) \
-
839 class className { \
-
840 public: \
-
841  static void Set() { \
-
842  pio->PIO_SODR = pinMask; \
-
843  } \
-
844  static void Clear() { \
-
845  pio->PIO_CODR = pinMask; \
-
846  } \
-
847  static void SetDirRead() { \
-
848  pio->PIO_IDR = pinMask ; \
-
849  pio->PIO_PUDR = pinMask; \
-
850  pio->PIO_ODR = pinMask; \
-
851  pio->PIO_PER = pinMask; \
-
852  } \
-
853  static void SetDirWrite() { \
-
854  pio->PIO_IDR = pinMask ; \
-
855  pio->PIO_PUDR = pinMask; \
-
856  pio->PIO_OER = pinMask; \
-
857  pio->PIO_PER = pinMask; \
-
858  } \
-
859  static uint8_t IsSet() { \
-
860  return pio->PIO_PDSR & pinMask; \
-
861  } \
-
862 };
-
863 
-
864 MAKE_PIN(P9, PIOC, PIO_PC21); // INT
-
865 MAKE_PIN(P10, PIOC, PIO_PC29); // SS
-
866 MAKE_PIN(P74, PIOA, PIO_PA25); // MISO
-
867 MAKE_PIN(P75, PIOA, PIO_PA26); // MOSI
-
868 MAKE_PIN(P76, PIOA, PIO_PA27); // CLK
-
869 
-
870 #undef MAKE_PIN
-
871 
-
872 #else
-
873 #error "Please define board in avrpins.h"
-
874 
-
875 #endif
-
876 
-
877 #endif // __arm__
-
878 
-
879 #endif //_avrpins_h_
+
838 #elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)
+
839 
+
840 // SetDirRead:
+
841 // Disable interrupts
+
842 // Disable the pull up resistor
+
843 // Set to INPUT
+
844 // Enable PIO
+
845 
+
846 // SetDirWrite:
+
847 // Disable interrupts
+
848 // Disable the pull up resistor
+
849 // Set to OUTPUT
+
850 // Enable PIO
+
851 
+
852 #define MAKE_PIN(className, pio, pinMask) \
+
853 class className { \
+
854 public: \
+
855  static void Set() { \
+
856  pio->PIO_SODR = pinMask; \
+
857  } \
+
858  static void Clear() { \
+
859  pio->PIO_CODR = pinMask; \
+
860  } \
+
861  static void SetDirRead() { \
+
862  pio->PIO_IDR = pinMask ; \
+
863  pio->PIO_PUDR = pinMask; \
+
864  pio->PIO_ODR = pinMask; \
+
865  pio->PIO_PER = pinMask; \
+
866  } \
+
867  static void SetDirWrite() { \
+
868  pio->PIO_IDR = pinMask ; \
+
869  pio->PIO_PUDR = pinMask; \
+
870  pio->PIO_OER = pinMask; \
+
871  pio->PIO_PER = pinMask; \
+
872  } \
+
873  static uint8_t IsSet() { \
+
874  return pio->PIO_PDSR & pinMask; \
+
875  } \
+
876 };
+
877 
+
878 // See: http://arduino.cc/en/Hacking/PinMappingSAM3X and variant.cpp
+
879 
+
880 MAKE_PIN(P0, PIOA, PIO_PA8);
+
881 MAKE_PIN(P1, PIOA, PIO_PA9);
+
882 MAKE_PIN(P2, PIOB, PIO_PB25);
+
883 MAKE_PIN(P3, PIOC, PIO_PC28);
+
884 MAKE_PIN(P4, PIOC, PIO_PC26);
+
885 MAKE_PIN(P5, PIOC, PIO_PC25);
+
886 MAKE_PIN(P6, PIOC, PIO_PC24);
+
887 MAKE_PIN(P7, PIOC, PIO_PC23);
+
888 MAKE_PIN(P8, PIOC, PIO_PC22);
+
889 MAKE_PIN(P9, PIOC, PIO_PC21);
+
890 MAKE_PIN(P10, PIOC, PIO_PC29);
+
891 MAKE_PIN(P11, PIOD, PIO_PD7);
+
892 MAKE_PIN(P12, PIOD, PIO_PD8);
+
893 MAKE_PIN(P13, PIOB, PIO_PB27);
+
894 MAKE_PIN(P14, PIOD, PIO_PD4);
+
895 MAKE_PIN(P15, PIOD, PIO_PD5);
+
896 MAKE_PIN(P16, PIOA, PIO_PA13);
+
897 MAKE_PIN(P17, PIOA, PIO_PA12);
+
898 MAKE_PIN(P18, PIOA, PIO_PA11);
+
899 MAKE_PIN(P19, PIOA, PIO_PA10);
+
900 MAKE_PIN(P20, PIOB, PIO_PB12);
+
901 MAKE_PIN(P21, PIOB, PIO_PB13);
+
902 MAKE_PIN(P22, PIOB, PIO_PB26);
+
903 MAKE_PIN(P23, PIOA, PIO_PA14);
+
904 MAKE_PIN(P24, PIOA, PIO_PA15);
+
905 MAKE_PIN(P25, PIOD, PIO_PD0);
+
906 MAKE_PIN(P26, PIOD, PIO_PD1);
+
907 MAKE_PIN(P27, PIOD, PIO_PD2);
+
908 MAKE_PIN(P28, PIOD, PIO_PD3);
+
909 MAKE_PIN(P29, PIOD, PIO_PD6);
+
910 MAKE_PIN(P30, PIOD, PIO_PD9);
+
911 MAKE_PIN(P31, PIOA, PIO_PA7);
+
912 MAKE_PIN(P32, PIOD, PIO_PD10);
+
913 MAKE_PIN(P33, PIOC, PIO_PC1);
+
914 MAKE_PIN(P34, PIOC, PIO_PC2);
+
915 MAKE_PIN(P35, PIOC, PIO_PC3);
+
916 MAKE_PIN(P36, PIOC, PIO_PC4);
+
917 MAKE_PIN(P37, PIOC, PIO_PC5);
+
918 MAKE_PIN(P38, PIOC, PIO_PC6);
+
919 MAKE_PIN(P39, PIOC, PIO_PC7);
+
920 MAKE_PIN(P40, PIOC, PIO_PC8);
+
921 MAKE_PIN(P41, PIOC, PIO_PC9);
+
922 MAKE_PIN(P42, PIOA, PIO_PA19);
+
923 MAKE_PIN(P43, PIOA, PIO_PA20);
+
924 MAKE_PIN(P44, PIOC, PIO_PC19);
+
925 MAKE_PIN(P45, PIOC, PIO_PC18);
+
926 MAKE_PIN(P46, PIOC, PIO_PC17);
+
927 MAKE_PIN(P47, PIOC, PIO_PC16);
+
928 MAKE_PIN(P48, PIOC, PIO_PC15);
+
929 MAKE_PIN(P49, PIOC, PIO_PC14);
+
930 MAKE_PIN(P50, PIOC, PIO_PC13);
+
931 MAKE_PIN(P51, PIOC, PIO_PC12);
+
932 MAKE_PIN(P52, PIOB, PIO_PB21);
+
933 MAKE_PIN(P53, PIOB, PIO_PB14);
+
934 MAKE_PIN(P54, PIOA, PIO_PA16);
+
935 MAKE_PIN(P55, PIOA, PIO_PA24);
+
936 MAKE_PIN(P56, PIOA, PIO_PA23);
+
937 MAKE_PIN(P57, PIOA, PIO_PA22);
+
938 MAKE_PIN(P58, PIOA, PIO_PA6);
+
939 MAKE_PIN(P59, PIOA, PIO_PA4);
+
940 MAKE_PIN(P60, PIOA, PIO_PA3);
+
941 MAKE_PIN(P61, PIOA, PIO_PA2);
+
942 MAKE_PIN(P62, PIOB, PIO_PB17);
+
943 MAKE_PIN(P63, PIOB, PIO_PB18);
+
944 MAKE_PIN(P64, PIOB, PIO_PB19);
+
945 MAKE_PIN(P65, PIOB, PIO_PB20);
+
946 MAKE_PIN(P66, PIOB, PIO_PB15);
+
947 MAKE_PIN(P67, PIOB, PIO_PB16);
+
948 MAKE_PIN(P68, PIOA, PIO_PA1);
+
949 MAKE_PIN(P69, PIOA, PIO_PA0);
+
950 MAKE_PIN(P70, PIOA, PIO_PA17);
+
951 MAKE_PIN(P71, PIOA, PIO_PA18);
+
952 MAKE_PIN(P72, PIOC, PIO_PC30);
+
953 MAKE_PIN(P73, PIOA, PIO_PA21);
+
954 MAKE_PIN(P74, PIOA, PIO_PA25); // MISO
+
955 MAKE_PIN(P75, PIOA, PIO_PA26); // MOSI
+
956 MAKE_PIN(P76, PIOA, PIO_PA27); // CLK
+
957 MAKE_PIN(P77, PIOA, PIO_PA28);
+
958 MAKE_PIN(P78, PIOB, PIO_PB23); // Unconnected
+
959 
+
960 #undef MAKE_PIN
+
961 
+
962 #elif defined(RBL_NRF51822)
+
963 
+
964 #define MAKE_PIN(className, pin) \
+
965 class className { \
+
966 public: \
+
967  static void Set() { \
+
968  nrf_gpio_pin_set(pin); \
+
969  } \
+
970  static void Clear() { \
+
971  nrf_gpio_pin_clear(pin); \
+
972  } \
+
973  static void SetDirRead() { \
+
974  nrf_gpio_cfg_input(pin, NRF_GPIO_PIN_NOPULL); \
+
975  } \
+
976  static void SetDirWrite() { \
+
977  nrf_gpio_cfg_output(pin); \
+
978  } \
+
979  static uint8_t IsSet() { \
+
980  return (uint8_t)nrf_gpio_pin_read(pin); \
+
981  } \
+
982 };
+
983 
+
984 // See: pin_transform.c in RBL nRF51822 SDK
+
985 MAKE_PIN(P0, Pin_nRF51822_to_Arduino(D0));
+
986 MAKE_PIN(P1, Pin_nRF51822_to_Arduino(D1));
+
987 MAKE_PIN(P2, Pin_nRF51822_to_Arduino(D2));
+
988 MAKE_PIN(P3, Pin_nRF51822_to_Arduino(D3));
+
989 MAKE_PIN(P4, Pin_nRF51822_to_Arduino(D4));
+
990 MAKE_PIN(P5, Pin_nRF51822_to_Arduino(D5));
+
991 MAKE_PIN(P6, Pin_nRF51822_to_Arduino(D6));
+
992 MAKE_PIN(P7, Pin_nRF51822_to_Arduino(D7));
+
993 MAKE_PIN(P8, Pin_nRF51822_to_Arduino(D8));
+
994 MAKE_PIN(P9, Pin_nRF51822_to_Arduino(D9)); // INT
+
995 MAKE_PIN(P10, Pin_nRF51822_to_Arduino(D10)); // SS
+
996 MAKE_PIN(P11, Pin_nRF51822_to_Arduino(D11));
+
997 MAKE_PIN(P12, Pin_nRF51822_to_Arduino(D12));
+
998 MAKE_PIN(P13, Pin_nRF51822_to_Arduino(D13));
+
999 MAKE_PIN(P14, Pin_nRF51822_to_Arduino(D14));
+
1000 MAKE_PIN(P15, Pin_nRF51822_to_Arduino(D15));
+
1001 MAKE_PIN(P17, Pin_nRF51822_to_Arduino(D17)); // MISO
+
1002 MAKE_PIN(P18, Pin_nRF51822_to_Arduino(D18)); // MOSI
+
1003 MAKE_PIN(P16, Pin_nRF51822_to_Arduino(D16)); // CLK
+
1004 MAKE_PIN(P19, Pin_nRF51822_to_Arduino(D19));
+
1005 MAKE_PIN(P20, Pin_nRF51822_to_Arduino(D20));
+
1006 MAKE_PIN(P21, Pin_nRF51822_to_Arduino(D21));
+
1007 MAKE_PIN(P22, Pin_nRF51822_to_Arduino(D22));
+
1008 MAKE_PIN(P23, Pin_nRF51822_to_Arduino(D23));
+
1009 MAKE_PIN(P24, Pin_nRF51822_to_Arduino(D24));
+
1010 
+
1011 #undef MAKE_PIN
+
1012 
+
1013 #else
+
1014 #error "Please define board in avrpins.h"
+
1015 
+
1016 #endif
+
1017 
+
1018 #elif defined(__ARDUINO_X86__) // Intel Galileo, Intel Galileo 2 and Intel Edison
+
1019 
+
1020 #include <avr/pgmspace.h>
+
1021 
+
1022 // Pointers are 32 bits on x86
+
1023 #define pgm_read_pointer(p) pgm_read_dword(p)
+
1024 
+
1025 #if PLATFORM_ID == 0xE1 // Edison platform id
+
1026 #define pinToFastPin(pin) 1 // As far as I can tell all pins can be used as fast pins
+
1027 #endif
+
1028 
+
1029 // Pin 2 and 3 on the Intel Galileo supports a higher rate,
+
1030 // so it is recommended to use one of these as the SS pin.
+
1031 
+
1032 #define MAKE_PIN(className, pin) \
+
1033 class className { \
+
1034 public: \
+
1035  static void Set() { \
+
1036  fastDigitalWrite(pin, HIGH); \
+
1037  } \
+
1038  static void Clear() { \
+
1039  fastDigitalWrite(pin, LOW); \
+
1040  } \
+
1041  static void SetDirRead() { \
+
1042  if (pinToFastPin(pin)) \
+
1043  pinMode(pin, INPUT_FAST); \
+
1044  else \
+
1045  pinMode(pin, INPUT); \
+
1046  } \
+
1047  static void SetDirWrite() { \
+
1048  if (pinToFastPin(pin)) \
+
1049  pinMode(pin, OUTPUT_FAST); \
+
1050  else \
+
1051  pinMode(pin, OUTPUT); \
+
1052  } \
+
1053  static uint8_t IsSet() { \
+
1054  return fastDigitalRead(pin); \
+
1055  } \
+
1056 };
+
1057 
+
1058 MAKE_PIN(P0, 0);
+
1059 MAKE_PIN(P1, 1);
+
1060 MAKE_PIN(P2, 2);
+
1061 MAKE_PIN(P3, 3);
+
1062 MAKE_PIN(P4, 4);
+
1063 MAKE_PIN(P5, 5);
+
1064 MAKE_PIN(P6, 6);
+
1065 MAKE_PIN(P7, 7);
+
1066 MAKE_PIN(P8, 8);
+
1067 MAKE_PIN(P9, 9);
+
1068 MAKE_PIN(P10, 10);
+
1069 MAKE_PIN(P11, 11);
+
1070 MAKE_PIN(P12, 12);
+
1071 MAKE_PIN(P13, 13);
+
1072 MAKE_PIN(P14, 14); // A0
+
1073 MAKE_PIN(P15, 15); // A1
+
1074 MAKE_PIN(P16, 16); // A2
+
1075 MAKE_PIN(P17, 17); // A3
+
1076 MAKE_PIN(P18, 18); // A4
+
1077 MAKE_PIN(P19, 19); // A5
+
1078 
+
1079 #undef MAKE_PIN
+
1080 
+
1081 #elif defined(__MIPSEL__)
+
1082 // MIPSEL (MIPS architecture using a little endian byte order)
+
1083 
+
1084 // MIPS size_t = 4
+
1085 #define pgm_read_pointer(p) pgm_read_dword(p)
+
1086 
+
1087 #define MAKE_PIN(className, pin) \
+
1088 class className { \
+
1089 public: \
+
1090  static void Set() { \
+
1091  digitalWrite(pin, HIGH);\
+
1092  } \
+
1093  static void Clear() { \
+
1094  digitalWrite(pin, LOW); \
+
1095  } \
+
1096  static void SetDirRead() { \
+
1097  pinMode(pin, INPUT); \
+
1098  } \
+
1099  static void SetDirWrite() { \
+
1100  pinMode(pin, OUTPUT); \
+
1101  } \
+
1102  static uint8_t IsSet() { \
+
1103  return digitalRead(pin); \
+
1104  } \
+
1105 };
+
1106 
+
1107 // 0 .. 13 - Digital pins
+
1108 MAKE_PIN(P0, 0); // RX
+
1109 MAKE_PIN(P1, 1); // TX
+
1110 MAKE_PIN(P2, 2); //
+
1111 MAKE_PIN(P3, 3); //
+
1112 MAKE_PIN(P4, 4); //
+
1113 MAKE_PIN(P5, 5); //
+
1114 MAKE_PIN(P6, 6); //
+
1115 MAKE_PIN(P7, 7); //
+
1116 MAKE_PIN(P8, 8); //
+
1117 MAKE_PIN(P9, 9); //
+
1118 MAKE_PIN(P10, 10); //
+
1119 MAKE_PIN(P11, 11); //
+
1120 MAKE_PIN(P12, 12); //
+
1121 MAKE_PIN(P13, 13); //
+
1122 
+
1123 #undef MAKE_PIN
+
1124 
+
1125 #else
+
1126 #error "Please define board in avrpins.h"
+
1127 
+
1128 #endif
+
1129 
+
1130 #endif //_avrpins_h_
diff --git a/cdc___x_r21_b1411_8cpp.html b/cdc___x_r21_b1411_8cpp.html new file mode 100644 index 00000000..c04f5bca --- /dev/null +++ b/cdc___x_r21_b1411_8cpp.html @@ -0,0 +1,111 @@ + + + + + + +USB Host Shield 2.0: cdc_XR21B1411.cpp File Reference + + + + + + + + + + + +
+
+ + + + + + +
+
USB Host Shield 2.0 +
+
+
+ + + + + + +
+
+ + +
+ +
+ + +
+
+
+
cdc_XR21B1411.cpp File Reference
+
+
+
#include "cdc_XR21B1411.h"
+
+Include dependency graph for cdc_XR21B1411.cpp:
+
+
+ + +
+
+

Go to the source code of this file.

+
+ + + + diff --git a/cdc___x_r21_b1411_8cpp__incl.map b/cdc___x_r21_b1411_8cpp__incl.map new file mode 100644 index 00000000..4a806b5a --- /dev/null +++ b/cdc___x_r21_b1411_8cpp__incl.map @@ -0,0 +1,5 @@ + + + + + diff --git a/cdc___x_r21_b1411_8cpp__incl.md5 b/cdc___x_r21_b1411_8cpp__incl.md5 new file mode 100644 index 00000000..488365a4 --- /dev/null +++ b/cdc___x_r21_b1411_8cpp__incl.md5 @@ -0,0 +1 @@ +94c1f3e832d30d1e0699ba30de20f4fa \ No newline at end of file diff --git a/cdc___x_r21_b1411_8cpp__incl.png b/cdc___x_r21_b1411_8cpp__incl.png new file mode 100644 index 00000000..fb15fdd7 Binary files /dev/null and b/cdc___x_r21_b1411_8cpp__incl.png differ diff --git a/cdc___x_r21_b1411_8cpp_source.html b/cdc___x_r21_b1411_8cpp_source.html new file mode 100644 index 00000000..fb52973e --- /dev/null +++ b/cdc___x_r21_b1411_8cpp_source.html @@ -0,0 +1,374 @@ + + + + + + +USB Host Shield 2.0: cdc_XR21B1411.cpp Source File + + + + + + + + + + + +
+
+ + + + + + +
+
USB Host Shield 2.0 +
+
+
+ + + + + + +
+
+ + +
+ +
+ + +
+
+
+
cdc_XR21B1411.cpp
+
+
+Go to the documentation of this file.
1 /* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved.
+
2 
+
3 This software may be distributed and modified under the terms of the GNU
+
4 General Public License version 2 (GPL2) as published by the Free Software
+
5 Foundation and appearing in the file GPL2.TXT included in the packaging of
+
6 this file. Please note that GPL2 Section 2[b] requires that all works based
+
7 on this software must also be made publicly available under the terms of
+
8 the GPL2 ("Copyleft").
+
9 
+
10 Contact information
+
11 -------------------
+
12 
+
13 Circuits At Home, LTD
+
14 Web : http://www.circuitsathome.com
+
15 e-mail : support@circuitsathome.com
+
16  */
+
17 #include "cdc_XR21B1411.h"
+
18 
+ +
20 ACM(p, pasync) {
+
21  // Is this needed??
+
22  _enhanced_status = enhanced_features(); // Set up features
+
23 }
+
24 
+
25 uint8_t XR21B1411::Init(uint8_t parent, uint8_t port, bool lowspeed) {
+
26  const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR);
+
27 
+
28  uint8_t buf[constBufSize];
+
29  USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
+
30 
+
31  uint8_t rcode;
+
32  UsbDevice *p = NULL;
+
33  EpInfo *oldep_ptr = NULL;
+
34  uint8_t num_of_conf; // number of configurations
+
35 
+
36  AddressPool &addrPool = pUsb->GetAddressPool();
+
37 
+
38  USBTRACE("XR Init\r\n");
+
39 
+
40  if(bAddress)
+ +
42 
+
43  // Get pointer to pseudo device with address 0 assigned
+
44  p = addrPool.GetUsbDevicePtr(0);
+
45 
+
46  if(!p)
+ +
48 
+
49  if(!p->epinfo) {
+
50  USBTRACE("epinfo\r\n");
+ +
52  }
+
53 
+
54  // Save old pointer to EP_RECORD of address 0
+
55  oldep_ptr = p->epinfo;
+
56 
+
57  // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence
+
58  p->epinfo = epInfo;
+
59 
+
60  p->lowspeed = lowspeed;
+
61 
+
62  // Get device descriptor
+
63  rcode = pUsb->getDevDescr(0, 0, constBufSize, (uint8_t*)buf);
+
64 
+
65  // Restore p->epinfo
+
66  p->epinfo = oldep_ptr;
+
67 
+
68  if(rcode)
+
69  goto FailGetDevDescr;
+
70 
+
71  // Allocate new address according to device class
+
72  bAddress = addrPool.AllocAddress(parent, false, port);
+
73 
+
74  if(!bAddress)
+ +
76 
+
77  // Extract Max Packet Size from the device descriptor
+ +
79 
+
80  // Assign new address to the device
+
81  rcode = pUsb->setAddr(0, 0, bAddress);
+
82 
+
83  if(rcode) {
+
84  p->lowspeed = false;
+
85  addrPool.FreeAddress(bAddress);
+
86  bAddress = 0;
+
87  USBTRACE2("setAddr:", rcode);
+
88  return rcode;
+
89  }
+
90 
+
91  USBTRACE2("Addr:", bAddress);
+
92 
+
93  p->lowspeed = false;
+
94 
+
95  p = addrPool.GetUsbDevicePtr(bAddress);
+
96 
+
97  if(!p)
+ +
99 
+
100  p->lowspeed = lowspeed;
+
101 
+
102  num_of_conf = udd->bNumConfigurations;
+
103 
+
104  if((((udd->idVendor != 0x2890U) || (udd->idProduct != 0x0201U)) && ((udd->idVendor != 0x04e2U) || (udd->idProduct != 0x1411U))))
+ +
106 
+
107  // Assign epInfo to epinfo pointer
+
108  rcode = pUsb->setEpInfoEntry(bAddress, 1, epInfo);
+
109 
+
110  if(rcode)
+
111  goto FailSetDevTblEntry;
+
112 
+
113  USBTRACE2("NC:", num_of_conf);
+
114 
+
115  for(uint8_t i = 0; i < num_of_conf; i++) {
+ + + + + +
121  CP_MASK_COMPARE_PROTOCOL > CdcControlParser(this);
+
122 
+ +
124  CP_MASK_COMPARE_CLASS> CdcDataParser(this);
+
125 
+
126  rcode = pUsb->getConfDescr(bAddress, 0, i, &CdcControlParser);
+
127 
+
128  if(rcode)
+
129  goto FailGetConfDescr;
+
130 
+
131  rcode = pUsb->getConfDescr(bAddress, 0, i, &CdcDataParser);
+
132 
+
133  if(rcode)
+
134  goto FailGetConfDescr;
+
135 
+
136  if(bNumEP > 1)
+
137  break;
+
138  } // for
+
139 
+
140  if(bNumEP < 4)
+ +
142 
+
143  // Assign epInfo to epinfo pointer
+ +
145 
+
146  USBTRACE2("Conf:", bConfNum);
+
147 
+
148  // Set Configuration Value
+
149  rcode = pUsb->setConf(bAddress, 0, bConfNum);
+
150 
+
151  if(rcode)
+
152  goto FailSetConfDescr;
+
153 
+
154  // Set up features status
+ +
156  half_duplex(false);
+
157  autoflowRTS(false);
+
158  autoflowDSR(false);
+
159  autoflowXON(false);
+
160  wide(false); // Always false, because this is only available in custom mode.
+
161 
+
162  rcode = pAsync->OnInit(this);
+
163 
+
164  if(rcode)
+
165  goto FailOnInit;
+
166 
+
167  USBTRACE("XR configured\r\n");
+
168 
+
169  ready = true;
+
170 
+
171  //bPollEnable = true;
+
172 
+
173  //USBTRACE("Poll enabled\r\n");
+
174  return 0;
+
175 
+
176 FailGetDevDescr:
+
177 #ifdef DEBUG_USB_HOST
+ +
179  goto Fail;
+
180 #endif
+
181 
+
182 FailSetDevTblEntry:
+
183 #ifdef DEBUG_USB_HOST
+ +
185  goto Fail;
+
186 #endif
+
187 
+
188 FailGetConfDescr:
+
189 #ifdef DEBUG_USB_HOST
+ +
191  goto Fail;
+
192 #endif
+
193 
+
194 FailSetConfDescr:
+
195 #ifdef DEBUG_USB_HOST
+ +
197  goto Fail;
+
198 #endif
+
199 
+
200 FailOnInit:
+
201 #ifdef DEBUG_USB_HOST
+
202  USBTRACE("OnInit:");
+
203 #endif
+
204 
+
205 #ifdef DEBUG_USB_HOST
+
206 Fail:
+
207  NotifyFail(rcode);
+
208 #endif
+
209  Release();
+
210  return rcode;
+
211 }
+
#define USB_CLASS_COM_AND_CDC_CTRL
Definition: UsbCore.h:58
+
#define USB_CLASS_CDC_DATA
Definition: UsbCore.h:65
+
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:769
+ +
#define CDC_SUBCLASS_ACM
Definition: cdcacm.h:27
+
#define CDC_PROTOCOL_ITU_T_V_250
Definition: cdcacm.h:40
+
EpInfo * epinfo
Definition: address.h:76
+
#define CP_MASK_COMPARE_PROTOCOL
+
virtual void autoflowRTS(bool s)
+
bool lowspeed
Definition: address.h:79
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
+
virtual uint8_t OnInit(ACM *pacm)
Definition: cdcacm.h:131
+ + +
uint8_t bMaxPacketSize0
Definition: usb_ch9.h:105
+
volatile bool ready
Definition: cdcacm.h:178
+
#define NotifyFail(...)
Definition: message.h:55
+
USB * pUsb
Definition: cdcacm.h:169
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
+
uint8_t bNumEP
Definition: cdcacm.h:175
+
EpInfo epInfo[ACM_MAX_ENDPOINTS]
Definition: cdcacm.h:181
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
+
#define NotifyFailGetDevDescr(...)
Definition: message.h:50
+
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
+
#define CP_MASK_COMPARE_CLASS
+
virtual void FreeAddress(uint8_t addr)=0
+
virtual void half_duplex(bool s)
+
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
+
CDCAsyncOper * pAsync
Definition: cdcacm.h:170
+
XR21B1411(USB *pusb, CDCAsyncOper *pasync)
+ +
#define USBTRACE2(s, r)
Definition: macros.h:77
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
+
#define NotifyFailGetConfDescr(...)
Definition: message.h:52
+
virtual void wide(bool s)
Definition: cdcacm.h:245
+
virtual void autoflowXON(bool s)
+
Definition: address.h:32
+
#define CP_MASK_COMPARE_SUBCLASS
+
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
+
uint8_t bAddress
Definition: cdcacm.h:171
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
+ +
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:77
+
virtual tty_features enhanced_features(void)
+
virtual void autoflowDSR(bool s)
+
uint16_t idProduct
Definition: usb_ch9.h:107
+
uint8_t Release()
Definition: cdcacm.cpp:257
+
uint8_t bConfNum
Definition: cdcacm.h:172
+
uint8_t bNumConfigurations
Definition: usb_ch9.h:112
+
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:80
+ +
uint8_t maxPktSize
Definition: address.h:34
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
Definition: UsbCore.h:197
+
Definition: cdcacm.h:163
+
#define NotifyFailSetConfDescr(...)
Definition: message.h:53
+
tty_features _enhanced_status
Definition: cdcacm.h:179
+
#define USBTRACE(s)
Definition: macros.h:75
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
+
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:51
+ +
+ + + + diff --git a/cdc___x_r21_b1411_8h.html b/cdc___x_r21_b1411_8h.html new file mode 100644 index 00000000..bf6e4b52 --- /dev/null +++ b/cdc___x_r21_b1411_8h.html @@ -0,0 +1,1027 @@ + + + + + + +USB Host Shield 2.0: cdc_XR21B1411.h File Reference + + + + + + + + + + + +
+
+ + + + + + +
+
USB Host Shield 2.0 +
+
+
+ + + + + + +
+
+ + +
+ +
+ + +
+
+
+Classes | +Macros
+
+
cdc_XR21B1411.h File Reference
+
+
+
#include "cdcacm.h"
+
+Include dependency graph for cdc_XR21B1411.h:
+
+
+ + +
+
+This graph shows which files directly or indirectly include this file:
+
+
+ + +
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  XR21B1411
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define XR_REG_CUSTOM_DRIVER   (0x020DU)
 
#define XR_REG_CUSTOM_DRIVER_ACTIVE   (0x0001U)
 
#define XR_REG_ACM_FLOW_CTL   (0x0216U)
 
#define XR_REG_FLOW_CTL   (0x0C06U)
 
#define XR_REG_FLOW_CTL_HALF_DPLX   (0x0008U)
 
#define XR_REG_FLOW_CTL_MODE_MASK   (0x0007U)
 
#define XR_REG_FLOW_CTL_NONE   (0x0000U)
 
#define XR_REG_FLOW_CTL_HW   (0x0001U)
 
#define XR_REG_FLOW_CTL_SW   (0x0002U)
 
#define XR_REG_FLOW_CTL_MMMRX   (0x0003U)
 
#define XR_REG_FLOW_CTL_MMMRXTX   (0x0004U)
 
#define XR_REG_ACM_GPIO_MODE   (0x0217U)
 
#define XR_REG_GPIO_MODE   (0x0C0CU)
 
#define XR_REG_GPIO_MODE_GPIO   (0x0000U)
 
#define XR_REG_GPIO_MODE_FC_RTSCTS   (0x0001U)
 
#define XR_REG_GPIO_MODE_FC_DTRDSR   (0x0002U)
 
#define XR_REG_GPIO_MODE_ATE   (0x0003U)
 
#define XR_REG_GPIO_MODE_ATE_ADDRESS   (0x0004U)
 
#define XR_REG_ACM_GPIO_DIR   (0x0218U)
 
#define XR_REG_GPIO_DIR   (0x0C0DU)
 
#define XR_REG_ACM_GPIO_INT   (0x0219U)
 
#define XR_REG_GPIO_INT   (0x0C11U)
 
#define XR_REG_GPIO_MASK   (0x001FU)
 
#define XR_REG_UART_ENABLE   (0x0C00U)
 
#define XR_REG_UART_ENABLE_RX   (0x0002U)
 
#define XR_REG_UART_ENABLE_TX   (0x0001U)
 
#define XR_REG_ERROR_STATUS   (0x0C09U)
 
#define XR_REG_ERROR_STATUS_MASK   (0x00F8U)
 
#define XR_REG_ERROR_STATUS_ERROR   (0x0070U)
 
#define XR_REG_ERROR_STATUS_BREAK   (0x0008U)
 
#define XR_REG_ERROR_STATUS_OVERRUN   (0x0010U)
 
#define XR_REG_ERROR_STATUS_PARITY   (0x0020U)
 
#define XR_REG_ERROR_STATUS_FRAME   (0x0040U)
 
#define XR_REG_ERROR_STATUS_BREAK   (0x0080U)
 
#define XR_REG_TX_BREAK   (0x0C0AU)
 
#define XR_REG_XCVR_EN_DELAY   (0x0C0BU)
 
#define XR_REG_GPIO_SET   (0x0C0EU)
 
#define XR_REG_GPIO_CLR   (0x0C0FU)
 
#define XR_REG_GPIO_STATUS   (0x0C10U)
 
#define XR_REG_CUSTOMISED_INT   (0x0C12U)
 
#define XR_REG_PIN_PULLUP_ENABLE   (0x0C14U)
 
#define XR_REG_PIN_PULLDOWN_ENABLE   (0x0C15U)
 
#define XR_REG_LOOPBACK   (0x0C16U)
 
#define XR_REG_RX_FIFO_LATENCY   (0x0CC2U)
 
#define XR_REG_RX_FIFO_LATENCY_ENABLE   (0x0001U)
 
#define XR_REG_WIDE_MODE   (0x0D02U)
 
#define XR_REG_WIDE_MODE_ENABLE   (0x0001U)
 
#define XR_REG_XON_CHAR   (0x0C07U)
 
#define XR_REG_XOFF_CHAR   (0x0C08U)
 
#define XR_REG_TX_FIFO_RESET   (0x0C80U)
 
#define XR_REG_TX_FIFO_COUNT   (0x0C81U)
 
#define XR_REG_RX_FIFO_RESET   (0x0CC0U)
 
#define XR_REG_RX_FIFO_COUNT   (0x0CC1U)
 
#define XR_WRITE_REQUEST_TYPE   (0x40U)
 
#define XR_READ_REQUEST_TYPE   (0xC0U)
 
#define XR_MAX_ENDPOINTS   4
 
+

Macro Definition Documentation

+ +
+
+ + + + +
#define XR_REG_CUSTOM_DRIVER   (0x020DU)
+
+ +

Definition at line 24 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_CUSTOM_DRIVER_ACTIVE   (0x0001U)
+
+ +

Definition at line 25 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ACM_FLOW_CTL   (0x0216U)
+
+ +

Definition at line 27 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_FLOW_CTL   (0x0C06U)
+
+ +

Definition at line 28 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_FLOW_CTL_HALF_DPLX   (0x0008U)
+
+ +

Definition at line 29 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_FLOW_CTL_MODE_MASK   (0x0007U)
+
+ +

Definition at line 30 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_FLOW_CTL_NONE   (0x0000U)
+
+ +

Definition at line 31 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_FLOW_CTL_HW   (0x0001U)
+
+ +

Definition at line 32 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_FLOW_CTL_SW   (0x0002U)
+
+ +

Definition at line 33 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_FLOW_CTL_MMMRX   (0x0003U)
+
+ +

Definition at line 34 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_FLOW_CTL_MMMRXTX   (0x0004U)
+
+ +

Definition at line 35 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ACM_GPIO_MODE   (0x0217U)
+
+ +

Definition at line 37 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_MODE   (0x0C0CU)
+
+ +

Definition at line 38 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_MODE_GPIO   (0x0000U)
+
+ +

Definition at line 39 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_MODE_FC_RTSCTS   (0x0001U)
+
+ +

Definition at line 40 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_MODE_FC_DTRDSR   (0x0002U)
+
+ +

Definition at line 41 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_MODE_ATE   (0x0003U)
+
+ +

Definition at line 42 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_MODE_ATE_ADDRESS   (0x0004U)
+
+ +

Definition at line 43 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ACM_GPIO_DIR   (0x0218U)
+
+ +

Definition at line 45 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_DIR   (0x0C0DU)
+
+ +

Definition at line 46 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ACM_GPIO_INT   (0x0219U)
+
+ +

Definition at line 48 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_INT   (0x0C11U)
+
+ +

Definition at line 49 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_MASK   (0x001FU)
+
+ +

Definition at line 50 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_UART_ENABLE   (0x0C00U)
+
+ +

Definition at line 52 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_UART_ENABLE_RX   (0x0002U)
+
+ +

Definition at line 53 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_UART_ENABLE_TX   (0x0001U)
+
+ +

Definition at line 54 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ERROR_STATUS   (0x0C09U)
+
+ +

Definition at line 56 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ERROR_STATUS_MASK   (0x00F8U)
+
+ +

Definition at line 57 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ERROR_STATUS_ERROR   (0x0070U)
+
+ +

Definition at line 58 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ERROR_STATUS_BREAK   (0x0008U)
+
+ +

Definition at line 63 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ERROR_STATUS_OVERRUN   (0x0010U)
+
+ +

Definition at line 60 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ERROR_STATUS_PARITY   (0x0020U)
+
+ +

Definition at line 61 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ERROR_STATUS_FRAME   (0x0040U)
+
+ +

Definition at line 62 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_ERROR_STATUS_BREAK   (0x0080U)
+
+ +

Definition at line 63 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_TX_BREAK   (0x0C0AU)
+
+ +

Definition at line 65 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_XCVR_EN_DELAY   (0x0C0BU)
+
+ +

Definition at line 67 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_SET   (0x0C0EU)
+
+ +

Definition at line 69 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_CLR   (0x0C0FU)
+
+ +

Definition at line 71 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_GPIO_STATUS   (0x0C10U)
+
+ +

Definition at line 73 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_CUSTOMISED_INT   (0x0C12U)
+
+ +

Definition at line 75 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_PIN_PULLUP_ENABLE   (0x0C14U)
+
+ +

Definition at line 77 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_PIN_PULLDOWN_ENABLE   (0x0C15U)
+
+ +

Definition at line 79 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_LOOPBACK   (0x0C16U)
+
+ +

Definition at line 81 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_RX_FIFO_LATENCY   (0x0CC2U)
+
+ +

Definition at line 83 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_RX_FIFO_LATENCY_ENABLE   (0x0001U)
+
+ +

Definition at line 84 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_WIDE_MODE   (0x0D02U)
+
+ +

Definition at line 86 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_WIDE_MODE_ENABLE   (0x0001U)
+
+ +

Definition at line 87 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_XON_CHAR   (0x0C07U)
+
+ +

Definition at line 89 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_XOFF_CHAR   (0x0C08U)
+
+ +

Definition at line 90 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_TX_FIFO_RESET   (0x0C80U)
+
+ +

Definition at line 92 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_TX_FIFO_COUNT   (0x0C81U)
+
+ +

Definition at line 93 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_RX_FIFO_RESET   (0x0CC0U)
+
+ +

Definition at line 94 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_REG_RX_FIFO_COUNT   (0x0CC1U)
+
+ +

Definition at line 95 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_WRITE_REQUEST_TYPE   (0x40U)
+
+ +

Definition at line 97 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_READ_REQUEST_TYPE   (0xC0U)
+
+ +

Definition at line 99 of file cdc_XR21B1411.h.

+ +
+
+ +
+
+ + + + +
#define XR_MAX_ENDPOINTS   4
+
+ +

Definition at line 101 of file cdc_XR21B1411.h.

+ +
+
+
+ + + + diff --git a/cdc___x_r21_b1411_8h__dep__incl.map b/cdc___x_r21_b1411_8h__dep__incl.map new file mode 100644 index 00000000..a71f1f70 --- /dev/null +++ b/cdc___x_r21_b1411_8h__dep__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/cdc___x_r21_b1411_8h__dep__incl.md5 b/cdc___x_r21_b1411_8h__dep__incl.md5 new file mode 100644 index 00000000..d1f48836 --- /dev/null +++ b/cdc___x_r21_b1411_8h__dep__incl.md5 @@ -0,0 +1 @@ +250b78e5b50dfc5c4569c99531678ec3 \ No newline at end of file diff --git a/cdc___x_r21_b1411_8h__dep__incl.png b/cdc___x_r21_b1411_8h__dep__incl.png new file mode 100644 index 00000000..f110787f Binary files /dev/null and b/cdc___x_r21_b1411_8h__dep__incl.png differ diff --git a/cdc___x_r21_b1411_8h__incl.map b/cdc___x_r21_b1411_8h__incl.map new file mode 100644 index 00000000..e2cc2275 --- /dev/null +++ b/cdc___x_r21_b1411_8h__incl.map @@ -0,0 +1,4 @@ + + + + diff --git a/cdc___x_r21_b1411_8h__incl.md5 b/cdc___x_r21_b1411_8h__incl.md5 new file mode 100644 index 00000000..8ab25f05 --- /dev/null +++ b/cdc___x_r21_b1411_8h__incl.md5 @@ -0,0 +1 @@ +ab5d3dff2680fe378e5afcfe3049b74b \ No newline at end of file diff --git a/cdc___x_r21_b1411_8h__incl.png b/cdc___x_r21_b1411_8h__incl.png new file mode 100644 index 00000000..0d676005 Binary files /dev/null and b/cdc___x_r21_b1411_8h__incl.png differ diff --git a/cdc___x_r21_b1411_8h_source.html b/cdc___x_r21_b1411_8h_source.html new file mode 100644 index 00000000..e9667c51 --- /dev/null +++ b/cdc___x_r21_b1411_8h_source.html @@ -0,0 +1,406 @@ + + + + + + +USB Host Shield 2.0: cdc_XR21B1411.h Source File + + + + + + + + + + + +
+
+ + + + + + +
+
USB Host Shield 2.0 +
+
+
+ + + + + + +
+
+ + +
+ +
+ + +
+
+
+
cdc_XR21B1411.h
+
+
+Go to the documentation of this file.
1 /* Copyright (C) 2015 Andrew J. Kroll
+
2  and
+
3  Circuits At Home, LTD. All rights reserved.
+
4 
+
5 This software may be distributed and modified under the terms of the GNU
+
6 General Public License version 2 (GPL2) as published by the Free Software
+
7 Foundation and appearing in the file GPL2.TXT included in the packaging of
+
8 this file. Please note that GPL2 Section 2[b] requires that all works based
+
9 on this software must also be made publicly available under the terms of
+
10 the GPL2 ("Copyleft").
+
11 
+
12 Contact information
+
13 -------------------
+
14 
+
15 Circuits At Home, LTD
+
16 Web : http://www.circuitsathome.com
+
17 e-mail : support@circuitsathome.com
+
18  */
+
19 #if !defined(__CDC_XR21B1411_H__)
+
20 #define __CDC_XR21B1411_H__
+
21 
+
22 #include "cdcacm.h"
+
23 
+
24 #define XR_REG_CUSTOM_DRIVER (0x020DU) // DRIVER SELECT
+
25 #define XR_REG_CUSTOM_DRIVER_ACTIVE (0x0001U) // 0: CDC 1: CUSTOM
+
26 
+
27 #define XR_REG_ACM_FLOW_CTL (0x0216U) // FLOW CONTROL REGISTER CDCACM MODE
+
28 #define XR_REG_FLOW_CTL (0x0C06U) // FLOW CONTROL REGISTER CUSTOM MODE
+
29 #define XR_REG_FLOW_CTL_HALF_DPLX (0x0008U) // 0:FULL DUPLEX 1:HALF DUPLEX
+
30 #define XR_REG_FLOW_CTL_MODE_MASK (0x0007U) // MODE BITMASK
+
31 #define XR_REG_FLOW_CTL_NONE (0x0000U) // NO FLOW CONTROL
+
32 #define XR_REG_FLOW_CTL_HW (0x0001U) // HARDWARE FLOW CONTROL
+
33 #define XR_REG_FLOW_CTL_SW (0x0002U) // SOFTWARE FLOW CONTROL
+
34 #define XR_REG_FLOW_CTL_MMMRX (0x0003U) // MULTIDROP RX UPON ADDRESS MATCH
+
35 #define XR_REG_FLOW_CTL_MMMRXTX (0x0004U) // MULTIDROP RX/TX UPON ADDRESS MATCH
+
36 
+
37 #define XR_REG_ACM_GPIO_MODE (0x0217U) // GPIO MODE REGISTER IN CDCACM MODE
+
38 #define XR_REG_GPIO_MODE (0x0C0CU) // GPIO MODE REGISTER IN CUSTOM MODE
+
39 #define XR_REG_GPIO_MODE_GPIO (0x0000U) // ALL GPIO PINS ACM PROGRAMMABLE
+
40 #define XR_REG_GPIO_MODE_FC_RTSCTS (0x0001U) // AUTO RTSCTS HW FC (GPIO 4/5)
+
41 #define XR_REG_GPIO_MODE_FC_DTRDSR (0x0002U) // AUTO DTRDSR HW FC (GPIO 2/3)
+
42 #define XR_REG_GPIO_MODE_ATE (0x0003U) // AUTO TRANSCEIVER ENABLE DURING TX (GPIO 5)
+
43 #define XR_REG_GPIO_MODE_ATE_ADDRESS (0x0004U) // AUTO TRANSCEIVER ENABLE ON ADDRESS MATCH (GPIO 5)
+
44 
+
45 #define XR_REG_ACM_GPIO_DIR (0x0218U) // GPIO DIRECTION REGISTER CDCACM MODE, 0:IN 1:OUT
+
46 #define XR_REG_GPIO_DIR (0x0C0DU) // GPIO DIRECTION REGISTER CUSTOM MODE, 0:IN 1:OUT
+
47 
+
48 #define XR_REG_ACM_GPIO_INT (0x0219U) // GPIO PIN CHANGE INTERRUPT ENABLE CDCACM MODE, 0: ENABLED 1: DISABLED
+
49 #define XR_REG_GPIO_INT (0x0C11U) // GPIO PIN CHANGE INTERRUPT ENABLE CUSTOM MODE, 0: ENABLED 1: DISABLED
+
50 #define XR_REG_GPIO_MASK (0x001FU) // GPIO REGISTERS BITMASK
+
51 
+
52 #define XR_REG_UART_ENABLE (0x0C00U) // UART I/O ENABLE REGISTER
+
53 #define XR_REG_UART_ENABLE_RX (0x0002U) // 0:DISABLED 1:ENABLED
+
54 #define XR_REG_UART_ENABLE_TX (0x0001U) // 0:DISABLED 1:ENABLED
+
55 
+
56 #define XR_REG_ERROR_STATUS (0x0C09U) // ERROR STATUS REGISTER
+
57 #define XR_REG_ERROR_STATUS_MASK (0x00F8U) // ERROR STATUS BITMASK
+
58 #define XR_REG_ERROR_STATUS_ERROR (0x0070U) // ERROR STATUS ERROR BITMASK
+
59 #define XR_REG_ERROR_STATUS_BREAK (0x0008U) // BREAK HAS BEEN DETECTED
+
60 #define XR_REG_ERROR_STATUS_OVERRUN (0x0010U) // RX OVERRUN ERROR
+
61 #define XR_REG_ERROR_STATUS_PARITY (0x0020U) // PARITY ERROR
+
62 #define XR_REG_ERROR_STATUS_FRAME (0x0040U) // FRAMING ERROR
+
63 #define XR_REG_ERROR_STATUS_BREAK (0x0080U) // BREAK IS BEING DETECTED
+
64 
+
65 #define XR_REG_TX_BREAK (0x0C0AU) // TRANSMIT BREAK. 0X0001-0XFFE TIME IN MS, 0X0000 STOP, 0X0FFF BREAK ON
+
66 
+
67 #define XR_REG_XCVR_EN_DELAY (0x0C0BU) // TURN-ARROUND DELAY IN BIT-TIMES 0X0000-0X000F
+
68 
+
69 #define XR_REG_GPIO_SET (0x0C0EU) // 1:SET GPIO PIN
+
70 
+
71 #define XR_REG_GPIO_CLR (0x0C0FU) // 1:CLEAR GPIO PIN
+
72 
+
73 #define XR_REG_GPIO_STATUS (0x0C10U) // READ GPIO PINS
+
74 
+
75 #define XR_REG_CUSTOMISED_INT (0x0C12U) // 0:STANDARD 1:CUSTOM SEE DATA SHEET
+
76 
+
77 #define XR_REG_PIN_PULLUP_ENABLE (0x0C14U) // 0:DISABLE 1:ENABLE, BITS 0-5:GPIO, 6:RX 7:TX
+
78 
+
79 #define XR_REG_PIN_PULLDOWN_ENABLE (0x0C15U) // 0:DISABLE 1:ENABLE, BITS 0-5:GPIO, 6:RX 7:TX
+
80 
+
81 #define XR_REG_LOOPBACK (0x0C16U) // 0:DISABLE 1:ENABLE, SEE DATA SHEET
+
82 
+
83 #define XR_REG_RX_FIFO_LATENCY (0x0CC2U) // FIFO LATENCY REGISTER
+
84 #define XR_REG_RX_FIFO_LATENCY_ENABLE (0x0001U) //
+
85 
+
86 #define XR_REG_WIDE_MODE (0x0D02U)
+
87 #define XR_REG_WIDE_MODE_ENABLE (0x0001U)
+
88 
+
89 #define XR_REG_XON_CHAR (0x0C07U)
+
90 #define XR_REG_XOFF_CHAR (0x0C08U)
+
91 
+
92 #define XR_REG_TX_FIFO_RESET (0x0C80U) // 1: RESET, SELF-CLEARING
+
93 #define XR_REG_TX_FIFO_COUNT (0x0C81U) // READ-ONLY
+
94 #define XR_REG_RX_FIFO_RESET (0x0CC0U) // 1: RESET, SELF-CLEARING
+
95 #define XR_REG_RX_FIFO_COUNT (0x0CC1U) // READ-ONLY
+
96 
+
97 #define XR_WRITE_REQUEST_TYPE (0x40U)
+
98 
+
99 #define XR_READ_REQUEST_TYPE (0xC0U)
+
100 
+
101 #define XR_MAX_ENDPOINTS 4
+
102 
+
103 class XR21B1411 : public ACM {
+
104 protected:
+
105 
+
106 public:
+
107  XR21B1411(USB *pusb, CDCAsyncOper *pasync);
+
108 
+
115  virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
+
116  return (((vid == 0x2890U) && (pid == 0x0201U)) || ((vid == 0x04e2U) && (pid == 0x1411U)));
+
117  };
+
118 
+
119  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
+
120 
+ +
122  tty_features rv;
+
123  rv.enhanced = true;
+
124  rv.autoflow_RTS = true;
+
125  rv.autoflow_DSR = true;
+
126  rv.autoflow_XON = true;
+
127  rv.half_duplex = true;
+
128  rv.wide = true;
+
129  return rv;
+
130  };
+
131 
+
132  uint8_t read_register(uint16_t reg, uint16_t *val) {
+
133  return (pUsb->ctrlReq(bAddress, 0, XR_READ_REQUEST_TYPE, 1, 0, 0, reg, 2, 2, (uint8_t *)val, NULL));
+
134  }
+
135 
+
136  uint8_t write_register(uint16_t reg, uint16_t val) {
+
137  return (pUsb->ctrlReq(bAddress, 0, XR_WRITE_REQUEST_TYPE, 0, BGRAB0(val), BGRAB1(val), reg, 0, 0, NULL, NULL));
+
138  }
+
139 
+
140 
+
142  // The following methods set the CDC-ACM defaults.
+
144 
+
145  virtual void autoflowRTS(bool s) {
+
146  uint16_t val;
+
147  uint8_t rval;
+
148  rval = read_register(XR_REG_ACM_FLOW_CTL, &val);
+
149  if(!rval) {
+
150  if(s) {
+ +
152  val |= XR_REG_FLOW_CTL_HW;
+
153  } else {
+ +
155  }
+
156  rval = write_register(XR_REG_ACM_FLOW_CTL, val);
+
157  if(!rval) {
+ +
159  if(!rval) {
+
160  // ACM commands apply the new settings.
+
161  LINE_CODING LCT;
+
162  rval = GetLineCoding(&LCT);
+
163  if(!rval) {
+
164  rval = SetLineCoding(&LCT);
+
165  if(!rval) {
+ + + +
169  }
+
170  }
+
171  }
+
172  }
+
173  }
+
174  };
+
175 
+
176  virtual void autoflowDSR(bool s) {
+
177  uint16_t val;
+
178  uint8_t rval;
+
179  rval = read_register(XR_REG_ACM_FLOW_CTL, &val);
+
180  if(!rval) {
+
181  if(s) {
+ +
183  val |= XR_REG_FLOW_CTL_HW;
+
184  } else {
+ +
186  }
+
187  rval = write_register(XR_REG_ACM_FLOW_CTL, val);
+
188  if(!rval) {
+
189  if(s) {
+ +
191  } else {
+ +
193  }
+
194  if(!rval) {
+
195  // ACM commands apply the new settings.
+
196  LINE_CODING LCT;
+
197  rval = GetLineCoding(&LCT);
+
198  if(!rval) {
+
199  rval = SetLineCoding(&LCT);
+
200  if(!rval) {
+ + + +
204  }
+
205  }
+
206  }
+
207  }
+
208  }
+
209  };
+
210 
+
211  virtual void autoflowXON(bool s) {
+
212  // NOTE: hardware defaults to the normal XON/XOFF
+
213  uint16_t val;
+
214  uint8_t rval;
+
215  rval = read_register(XR_REG_ACM_FLOW_CTL, &val);
+
216  if(!rval) {
+
217  if(s) {
+ +
219  val |= XR_REG_FLOW_CTL_SW;
+
220  } else {
+ +
222  }
+
223  rval = write_register(XR_REG_ACM_FLOW_CTL, val);
+
224  if(!rval) {
+ +
226  if(!rval) {
+
227  // ACM commands apply the new settings.
+
228  LINE_CODING LCT;
+
229  rval = GetLineCoding(&LCT);
+
230  if(!rval) {
+
231  rval = SetLineCoding(&LCT);
+
232  if(!rval) {
+ + + +
236  }
+
237  }
+
238  }
+
239  }
+
240  }
+
241  };
+
242 
+
243  virtual void half_duplex(bool s) {
+
244  uint16_t val;
+
245  uint8_t rval;
+
246  rval = read_register(XR_REG_ACM_FLOW_CTL, &val);
+
247  if(!rval) {
+
248  if(s) {
+ +
250  } else {
+ +
252  }
+
253  rval = write_register(XR_REG_ACM_FLOW_CTL, val);
+
254  if(!rval) {
+
255  // ACM commands apply the new settings.
+
256  LINE_CODING LCT;
+
257  rval = GetLineCoding(&LCT);
+
258  if(!rval) {
+
259  rval = SetLineCoding(&LCT);
+
260  if(!rval) {
+ +
262  }
+
263  }
+
264  }
+
265  }
+
266  };
+
267 
+
268 
+
269 
+
270 };
+
271 
+
272 #endif // __CDCPROLIFIC_H__
+
virtual void autoflowRTS(bool s)
+
#define XR_REG_ACM_FLOW_CTL
Definition: cdc_XR21B1411.h:27
+
uint8_t write_register(uint16_t reg, uint16_t val)
+
USB * pUsb
Definition: cdcacm.h:169
+
#define BGRAB0(__usi__)
Definition: macros.h:49
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
+
#define XR_WRITE_REQUEST_TYPE
Definition: cdc_XR21B1411.h:97
+
virtual void half_duplex(bool s)
+
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
Definition: Usb.cpp:126
+
XR21B1411(USB *pusb, CDCAsyncOper *pasync)
+
#define XR_REG_GPIO_MODE_FC_DTRDSR
Definition: cdc_XR21B1411.h:41
+
uint8_t GetLineCoding(LINE_CODING *dataptr)
Definition: cdcacm.cpp:304
+
#define XR_REG_FLOW_CTL_HW
Definition: cdc_XR21B1411.h:32
+
bool enhanced
Definition: cdcacm.h:149
+
bool wide
Definition: cdcacm.h:152
+
virtual void autoflowXON(bool s)
+
bool autoflow_XON
Definition: cdcacm.h:155
+
bool autoflow_RTS
Definition: cdcacm.h:153
+
#define XR_REG_FLOW_CTL_SW
Definition: cdc_XR21B1411.h:33
+
#define XR_READ_REQUEST_TYPE
Definition: cdc_XR21B1411.h:99
+ +
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)
+
bool autoflow_DSR
Definition: cdcacm.h:154
+
uint8_t bAddress
Definition: cdcacm.h:171
+ +
uint8_t SetLineCoding(const LINE_CODING *dataptr)
Definition: cdcacm.cpp:300
+ + +
#define XR_REG_FLOW_CTL_HALF_DPLX
Definition: cdc_XR21B1411.h:29
+
virtual tty_features enhanced_features(void)
+
virtual void autoflowDSR(bool s)
+
bool half_duplex
Definition: cdcacm.h:156
+ +
Definition: UsbCore.h:197
+
uint8_t read_register(uint16_t reg, uint16_t *val)
+
Definition: cdcacm.h:163
+
#define XR_REG_ACM_GPIO_MODE
Definition: cdc_XR21B1411.h:37
+
tty_features _enhanced_status
Definition: cdcacm.h:179
+
#define BGRAB1(__usi__)
Definition: macros.h:50
+
#define XR_REG_GPIO_MODE_GPIO
Definition: cdc_XR21B1411.h:39
+
#define XR_REG_FLOW_CTL_MODE_MASK
Definition: cdc_XR21B1411.h:30
+
+ + + + diff --git a/cdcacm_8cpp.html b/cdcacm_8cpp.html index 8732c352..4a062855 100644 --- a/cdcacm_8cpp.html +++ b/cdcacm_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcacm.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -104,7 +105,7 @@ Include dependency graph for cdcacm.cpp:
diff --git a/cdcacm_8cpp__incl.md5 b/cdcacm_8cpp__incl.md5 index 49395eca..9fd4609d 100644 --- a/cdcacm_8cpp__incl.md5 +++ b/cdcacm_8cpp__incl.md5 @@ -1 +1 @@ -b7b7a67edb342e99305bf84049fe6e3a \ No newline at end of file +8836c5951dac28c739547b666b24d9f8 \ No newline at end of file diff --git a/cdcacm_8cpp_source.html b/cdcacm_8cpp_source.html index e69fbb75..080d3116 100644 --- a/cdcacm_8cpp_source.html +++ b/cdcacm_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcacm.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -121,429 +122,418 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
30 qNextPollTime(0),
31 bPollEnable(false),
32 ready(false) {
-
33  for(uint8_t i = 0; i < ACM_MAX_ENDPOINTS; i++) {
-
34  epInfo[i].epAddr = 0;
-
35  epInfo[i].maxPktSize = (i) ? 0 : 8;
-
36  epInfo[i].epAttribs = 0;
-
37  //epInfo[i].bmNakPower = USB_NAK_NOWAIT;
-
38  epInfo[i].bmNakPower = USB_NAK_MAX_POWER;
+
33  _enhanced_status = enhanced_features(); // Set up features
+
34  for(uint8_t i = 0; i < ACM_MAX_ENDPOINTS; i++) {
+
35  epInfo[i].epAddr = 0;
+
36  epInfo[i].maxPktSize = (i) ? 0 : 8;
+
37  epInfo[i].epAttribs = 0;
+
38  epInfo[i].bmNakPower = (i == epDataInIndex) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
39 
-
40  //if (!i)
-
41  epInfo[i].bmNakPower = USB_NAK_MAX_POWER;
-
42  }
-
43  if(pUsb)
-
44  pUsb->RegisterDeviceClass(this);
-
45 }
+
40  }
+
41  if(pUsb)
+
42  pUsb->RegisterDeviceClass(this);
+
43 }
+
44 
+
45 uint8_t ACM::Init(uint8_t parent, uint8_t port, bool lowspeed) {
46 
-
47 uint8_t ACM::Init(uint8_t parent, uint8_t port, bool lowspeed) {
-
48  const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR);
-
49 
-
50  uint8_t buf[constBufSize];
-
51  USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
-
52 
-
53  uint8_t rcode;
-
54  UsbDevice *p = NULL;
-
55  EpInfo *oldep_ptr = NULL;
-
56  uint8_t num_of_conf; // number of configurations
-
57 
-
58  AddressPool &addrPool = pUsb->GetAddressPool();
-
59 
-
60  USBTRACE("ACM Init\r\n");
-
61 
-
62  if(bAddress)
-
63  return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE;
-
64 
-
65  // Get pointer to pseudo device with address 0 assigned
-
66  p = addrPool.GetUsbDevicePtr(0);
-
67 
-
68  if(!p)
-
69  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
-
70 
-
71  if(!p->epinfo) {
-
72  USBTRACE("epinfo\r\n");
-
73  return USB_ERROR_EPINFO_IS_NULL;
-
74  }
-
75 
-
76  // Save old pointer to EP_RECORD of address 0
-
77  oldep_ptr = p->epinfo;
-
78 
-
79  // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence
-
80  p->epinfo = epInfo;
-
81 
-
82  p->lowspeed = lowspeed;
-
83 
-
84  // Get device descriptor
-
85  rcode = pUsb->getDevDescr(0, 0, constBufSize, (uint8_t*)buf);
-
86 
-
87  // Restore p->epinfo
-
88  p->epinfo = oldep_ptr;
-
89 
-
90  if(rcode)
-
91  goto FailGetDevDescr;
-
92 
-
93  // Allocate new address according to device class
-
94  bAddress = addrPool.AllocAddress(parent, false, port);
-
95 
-
96  if(!bAddress)
-
97  return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL;
-
98 
-
99  // Extract Max Packet Size from the device descriptor
-
100  epInfo[0].maxPktSize = udd->bMaxPacketSize0;
-
101 
-
102  // Assign new address to the device
-
103  rcode = pUsb->setAddr(0, 0, bAddress);
-
104 
-
105  if(rcode) {
-
106  p->lowspeed = false;
-
107  addrPool.FreeAddress(bAddress);
-
108  bAddress = 0;
-
109  USBTRACE2("setAddr:", rcode);
-
110  return rcode;
-
111  }
-
112 
-
113  USBTRACE2("Addr:", bAddress);
-
114 
-
115  p->lowspeed = false;
-
116 
-
117  p = addrPool.GetUsbDevicePtr(bAddress);
-
118 
-
119  if(!p)
-
120  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
-
121 
-
122  p->lowspeed = lowspeed;
-
123 
-
124  num_of_conf = udd->bNumConfigurations;
-
125 
-
126  // Assign epInfo to epinfo pointer
-
127  rcode = pUsb->setEpInfoEntry(bAddress, 1, epInfo);
-
128 
-
129  if(rcode)
-
130  goto FailSetDevTblEntry;
-
131 
-
132  USBTRACE2("NC:", num_of_conf);
-
133 
-
134  for(uint8_t i = 0; i < num_of_conf; i++) {
-
135  ConfigDescParser< USB_CLASS_COM_AND_CDC_CTRL,
-
136  CDC_SUBCLASS_ACM,
-
137  CDC_PROTOCOL_ITU_T_V_250,
-
138  CP_MASK_COMPARE_CLASS |
-
139  CP_MASK_COMPARE_SUBCLASS |
-
140  CP_MASK_COMPARE_PROTOCOL > CdcControlParser(this);
-
141 
-
142  ConfigDescParser<USB_CLASS_CDC_DATA, 0, 0,
-
143  CP_MASK_COMPARE_CLASS> CdcDataParser(this);
-
144 
-
145  rcode = pUsb->getConfDescr(bAddress, 0, i, &CdcControlParser);
-
146 
-
147  if(rcode)
-
148  goto FailGetConfDescr;
-
149 
-
150  rcode = pUsb->getConfDescr(bAddress, 0, i, &CdcDataParser);
-
151 
-
152  if(rcode)
-
153  goto FailGetConfDescr;
-
154 
-
155  if(bNumEP > 1)
-
156  break;
-
157  } // for
-
158 
-
159  if(bNumEP < 4)
-
160  return USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED;
-
161 
-
162  // Assign epInfo to epinfo pointer
-
163  rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo);
-
164 
-
165  USBTRACE2("Conf:", bConfNum);
-
166 
-
167  // Set Configuration Value
-
168  rcode = pUsb->setConf(bAddress, 0, bConfNum);
-
169 
-
170  if(rcode)
-
171  goto FailSetConfDescr;
-
172 
-
173  rcode = pAsync->OnInit(this);
-
174 
-
175  if(rcode)
-
176  goto FailOnInit;
-
177 
-
178  USBTRACE("ACM configured\r\n");
-
179 
-
180  ready = true;
-
181 
-
182  //bPollEnable = true;
+
47  const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR);
+
48 
+
49  uint8_t buf[constBufSize];
+
50  USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
+
51 
+
52  uint8_t rcode;
+
53  UsbDevice *p = NULL;
+
54  EpInfo *oldep_ptr = NULL;
+
55  uint8_t num_of_conf; // number of configurations
+
56 
+
57  AddressPool &addrPool = pUsb->GetAddressPool();
+
58 
+
59  USBTRACE("ACM Init\r\n");
+
60 
+
61  if(bAddress)
+
62  return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE;
+
63 
+
64  // Get pointer to pseudo device with address 0 assigned
+
65  p = addrPool.GetUsbDevicePtr(0);
+
66 
+
67  if(!p)
+
68  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
+
69 
+
70  if(!p->epinfo) {
+
71  USBTRACE("epinfo\r\n");
+
72  return USB_ERROR_EPINFO_IS_NULL;
+
73  }
+
74 
+
75  // Save old pointer to EP_RECORD of address 0
+
76  oldep_ptr = p->epinfo;
+
77 
+
78  // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence
+
79  p->epinfo = epInfo;
+
80 
+
81  p->lowspeed = lowspeed;
+
82 
+
83  // Get device descriptor
+
84  rcode = pUsb->getDevDescr(0, 0, constBufSize, (uint8_t*)buf);
+
85 
+
86  // Restore p->epinfo
+
87  p->epinfo = oldep_ptr;
+
88 
+
89  if(rcode)
+
90  goto FailGetDevDescr;
+
91 
+
92  // Allocate new address according to device class
+
93  bAddress = addrPool.AllocAddress(parent, false, port);
+
94 
+
95  if(!bAddress)
+
96  return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL;
+
97 
+
98  // Extract Max Packet Size from the device descriptor
+
99  epInfo[0].maxPktSize = udd->bMaxPacketSize0;
+
100 
+
101  // Assign new address to the device
+
102  rcode = pUsb->setAddr(0, 0, bAddress);
+
103 
+
104  if(rcode) {
+
105  p->lowspeed = false;
+
106  addrPool.FreeAddress(bAddress);
+
107  bAddress = 0;
+
108  USBTRACE2("setAddr:", rcode);
+
109  return rcode;
+
110  }
+
111 
+
112  USBTRACE2("Addr:", bAddress);
+
113 
+
114  p->lowspeed = false;
+
115 
+
116  p = addrPool.GetUsbDevicePtr(bAddress);
+
117 
+
118  if(!p)
+
119  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
+
120 
+
121  p->lowspeed = lowspeed;
+
122 
+
123  num_of_conf = udd->bNumConfigurations;
+
124 
+
125  // Assign epInfo to epinfo pointer
+
126  rcode = pUsb->setEpInfoEntry(bAddress, 1, epInfo);
+
127 
+
128  if(rcode)
+
129  goto FailSetDevTblEntry;
+
130 
+
131  USBTRACE2("NC:", num_of_conf);
+
132 
+
133  for(uint8_t i = 0; i < num_of_conf; i++) {
+
134  ConfigDescParser< USB_CLASS_COM_AND_CDC_CTRL,
+
135  CDC_SUBCLASS_ACM,
+
136  CDC_PROTOCOL_ITU_T_V_250,
+
137  CP_MASK_COMPARE_CLASS |
+
138  CP_MASK_COMPARE_SUBCLASS |
+
139  CP_MASK_COMPARE_PROTOCOL > CdcControlParser(this);
+
140 
+
141  ConfigDescParser<USB_CLASS_CDC_DATA, 0, 0,
+
142  CP_MASK_COMPARE_CLASS> CdcDataParser(this);
+
143 
+
144  rcode = pUsb->getConfDescr(bAddress, 0, i, &CdcControlParser);
+
145 
+
146  if(rcode)
+
147  goto FailGetConfDescr;
+
148 
+
149  rcode = pUsb->getConfDescr(bAddress, 0, i, &CdcDataParser);
+
150 
+
151  if(rcode)
+
152  goto FailGetConfDescr;
+
153 
+
154  if(bNumEP > 1)
+
155  break;
+
156  } // for
+
157 
+
158  if(bNumEP < 4)
+
159  return USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED;
+
160 
+
161  // Assign epInfo to epinfo pointer
+
162  rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo);
+
163 
+
164  USBTRACE2("Conf:", bConfNum);
+
165 
+
166  // Set Configuration Value
+
167  rcode = pUsb->setConf(bAddress, 0, bConfNum);
+
168 
+
169  if(rcode)
+
170  goto FailSetConfDescr;
+
171 
+
172  // Set up features status
+
173  _enhanced_status = enhanced_features();
+
174  half_duplex(false);
+
175  autoflowRTS(false);
+
176  autoflowDSR(false);
+
177  autoflowXON(false);
+
178  wide(false); // Always false, because this is only available in custom mode.
+
179  rcode = pAsync->OnInit(this);
+
180 
+
181  if(rcode)
+
182  goto FailOnInit;
183 
-
184  //USBTRACE("Poll enabled\r\n");
-
185  return 0;
-
186 
-
187 FailGetDevDescr:
-
188 #ifdef DEBUG_USB_HOST
-
189  NotifyFailGetDevDescr();
-
190  goto Fail;
-
191 #endif
+
184  USBTRACE("ACM configured\r\n");
+
185 
+
186  ready = true;
+
187 
+
188  //bPollEnable = true;
+
189 
+
190  //USBTRACE("Poll enabled\r\n");
+
191  return 0;
192 
-
193 FailSetDevTblEntry:
+
193 FailGetDevDescr:
194 #ifdef DEBUG_USB_HOST
-
195  NotifyFailSetDevTblEntry();
+
195  NotifyFailGetDevDescr();
196  goto Fail;
197 #endif
198 
-
199 FailGetConfDescr:
+
199 FailSetDevTblEntry:
200 #ifdef DEBUG_USB_HOST
-
201  NotifyFailGetConfDescr();
+
201  NotifyFailSetDevTblEntry();
202  goto Fail;
203 #endif
204 
-
205 FailSetConfDescr:
+
205 FailGetConfDescr:
206 #ifdef DEBUG_USB_HOST
-
207  NotifyFailSetConfDescr();
+
207  NotifyFailGetConfDescr();
208  goto Fail;
209 #endif
210 
-
211 FailOnInit:
+
211 FailSetConfDescr:
212 #ifdef DEBUG_USB_HOST
-
213  USBTRACE("OnInit:");
-
214 #endif
-
215 
-
216 #ifdef DEBUG_USB_HOST
-
217 Fail:
-
218  NotifyFail(rcode);
-
219 #endif
-
220  Release();
-
221  return rcode;
-
222 }
-
223 
-
224 void ACM::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) {
-
225  ErrorMessage<uint8_t > (PSTR("Conf.Val"), conf);
-
226  ErrorMessage<uint8_t > (PSTR("Iface Num"), iface);
-
227  ErrorMessage<uint8_t > (PSTR("Alt.Set"), alt);
-
228 
-
229  bConfNum = conf;
-
230 
-
231  uint8_t index;
-
232 
-
233  if((pep->bmAttributes & 0x03) == 3 && (pep->bEndpointAddress & 0x80) == 0x80)
-
234  index = epInterruptInIndex;
-
235  else
-
236  if((pep->bmAttributes & 0x02) == 2)
-
237  index = ((pep->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex;
-
238  else
-
239  return;
-
240 
-
241  // Fill in the endpoint info structure
-
242  epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F);
-
243  epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize;
-
244  epInfo[index].epAttribs = 0;
-
245 
-
246  bNumEP++;
-
247 
-
248  PrintEndpointDescriptor(pep);
-
249 }
-
250 
-
251 uint8_t ACM::Release() {
-
252  pUsb->GetAddressPool().FreeAddress(bAddress);
+
213  NotifyFailSetConfDescr();
+
214  goto Fail;
+
215 #endif
+
216 
+
217 FailOnInit:
+
218 #ifdef DEBUG_USB_HOST
+
219  USBTRACE("OnInit:");
+
220 #endif
+
221 
+
222 #ifdef DEBUG_USB_HOST
+
223 Fail:
+
224  NotifyFail(rcode);
+
225 #endif
+
226  Release();
+
227  return rcode;
+
228 }
+
229 
+
230 void ACM::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) {
+
231  //ErrorMessage<uint8_t > (PSTR("Conf.Val"), conf);
+
232  //ErrorMessage<uint8_t > (PSTR("Iface Num"), iface);
+
233  //ErrorMessage<uint8_t > (PSTR("Alt.Set"), alt);
+
234 
+
235  bConfNum = conf;
+
236 
+
237  uint8_t index;
+
238 
+
239  if((pep->bmAttributes & 0x03) == 3 && (pep->bEndpointAddress & 0x80) == 0x80)
+
240  index = epInterruptInIndex;
+
241  else
+
242  if((pep->bmAttributes & 0x02) == 2)
+
243  index = ((pep->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex;
+
244  else
+
245  return;
+
246 
+
247  // Fill in the endpoint info structure
+
248  epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F);
+
249  epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize;
+
250  epInfo[index].epAttribs = 0;
+
251 
+
252  bNumEP++;
253 
-
254  bControlIface = 0;
-
255  bDataIface = 0;
-
256  bNumEP = 1;
-
257 
-
258  bAddress = 0;
-
259  qNextPollTime = 0;
-
260  bPollEnable = false;
-
261  return 0;
-
262 }
-
263 
-
264 uint8_t ACM::Poll() {
-
265  uint8_t rcode = 0;
-
266 
-
267  if(!bPollEnable)
-
268  return 0;
-
269 
-
270  //uint32_t time_now = millis();
-
271 
-
272  //if (qNextPollTime <= time_now)
-
273  //{
-
274  // qNextPollTime = time_now + 100;
-
275 
-
276  // uint8_t rcode;
-
277  // const uint8_t constBufSize = 16;
-
278  // uint8_t buf[constBufSize];
+
254  PrintEndpointDescriptor(pep);
+
255 }
+
256 
+
257 uint8_t ACM::Release() {
+
258  ready = false;
+
259  pUsb->GetAddressPool().FreeAddress(bAddress);
+
260 
+
261  bControlIface = 0;
+
262  bDataIface = 0;
+
263  bNumEP = 1;
+
264 
+
265  bAddress = 0;
+
266  qNextPollTime = 0;
+
267  bPollEnable = false;
+
268  return 0;
+
269 }
+
270 
+
271 uint8_t ACM::Poll() {
+
272  uint8_t rcode = 0;
+
273 
+
274  if(!bPollEnable)
+
275  return 0;
+
276 
+
277  return rcode;
+
278 }
279 
-
280  // for (uint8_t i=0; i<constBufSize; i++)
-
281  // buf[i] = 0;
-
282 
-
283  // uint16_t read = (constBufSize > epInfo[epInterruptInIndex].maxPktSize)
-
284  // ? epInfo[epInterruptInIndex].maxPktSize : constBufSize;
-
285  // rcode = pUsb->inTransfer(bAddress, epInfo[epInterruptInIndex].epAddr, &read, buf);
-
286 
-
287  // if (rcode)
-
288  // return rcode;
-
289 
-
290  // for (uint8_t i=0; i<read; i++)
-
291  // {
-
292  // PrintHex<uint8_t>(buf[i]);
-
293  // USB_HOST_SERIAL.print(" ");
-
294  // }
-
295  // USBTRACE("\r\n");
-
296  //}
-
297  return rcode;
+
280 uint8_t ACM::RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr) {
+
281  return pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, bytes_rcvd, dataptr);
+
282 }
+
283 
+
284 uint8_t ACM::SndData(uint16_t nbytes, uint8_t *dataptr) {
+
285  return pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, nbytes, dataptr);
+
286 }
+
287 
+
288 uint8_t ACM::SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr) {
+
289  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCOUT, CDC_SET_COMM_FEATURE, (fid & 0xff), (fid >> 8), bControlIface, nbytes, nbytes, dataptr, NULL));
+
290 }
+
291 
+
292 uint8_t ACM::GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr) {
+
293  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCIN, CDC_GET_COMM_FEATURE, (fid & 0xff), (fid >> 8), bControlIface, nbytes, nbytes, dataptr, NULL));
+
294 }
+
295 
+
296 uint8_t ACM::ClearCommFeature(uint16_t fid) {
+
297  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCOUT, CDC_CLEAR_COMM_FEATURE, (fid & 0xff), (fid >> 8), bControlIface, 0, 0, NULL, NULL));
298 }
299 
-
300 uint8_t ACM::RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr) {
-
301  return pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, bytes_rcvd, dataptr);
+
300 uint8_t ACM::SetLineCoding(const LINE_CODING *dataptr) {
+
301  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCOUT, CDC_SET_LINE_CODING, 0x00, 0x00, bControlIface, sizeof (LINE_CODING), sizeof (LINE_CODING), (uint8_t*)dataptr, NULL));
302 }
303 
-
304 uint8_t ACM::SndData(uint16_t nbytes, uint8_t *dataptr) {
-
305  return pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, nbytes, dataptr);
+
304 uint8_t ACM::GetLineCoding(LINE_CODING *dataptr) {
+
305  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCIN, CDC_GET_LINE_CODING, 0x00, 0x00, bControlIface, sizeof (LINE_CODING), sizeof (LINE_CODING), (uint8_t*)dataptr, NULL));
306 }
307 
-
308 uint8_t ACM::SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr) {
-
309  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCOUT, CDC_SET_COMM_FEATURE, (fid & 0xff), (fid >> 8), bControlIface, nbytes, nbytes, dataptr, NULL));
+
308 uint8_t ACM::SetControlLineState(uint8_t state) {
+
309  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCOUT, CDC_SET_CONTROL_LINE_STATE, state, 0, bControlIface, 0, 0, NULL, NULL));
310 }
311 
-
312 uint8_t ACM::GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr) {
-
313  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCIN, CDC_GET_COMM_FEATURE, (fid & 0xff), (fid >> 8), bControlIface, nbytes, nbytes, dataptr, NULL));
+
312 uint8_t ACM::SendBreak(uint16_t duration) {
+
313  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCOUT, CDC_SEND_BREAK, (duration & 0xff), (duration >> 8), bControlIface, 0, 0, NULL, NULL));
314 }
315 
-
316 uint8_t ACM::ClearCommFeature(uint16_t fid) {
-
317  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCOUT, CDC_CLEAR_COMM_FEATURE, (fid & 0xff), (fid >> 8), bControlIface, 0, 0, NULL, NULL));
-
318 }
-
319 
-
320 uint8_t ACM::SetLineCoding(const LINE_CODING *dataptr) {
-
321  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCOUT, CDC_SET_LINE_CODING, 0x00, 0x00, bControlIface, sizeof (LINE_CODING), sizeof (LINE_CODING), (uint8_t*)dataptr, NULL));
-
322 }
-
323 
-
324 uint8_t ACM::GetLineCoding(LINE_CODING *dataptr) {
-
325  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCIN, CDC_GET_LINE_CODING, 0x00, 0x00, bControlIface, sizeof (LINE_CODING), sizeof (LINE_CODING), (uint8_t*)dataptr, NULL));
-
326 }
-
327 
-
328 uint8_t ACM::SetControlLineState(uint8_t state) {
-
329  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCOUT, CDC_SET_CONTROL_LINE_STATE, state, 0, bControlIface, 0, 0, NULL, NULL));
-
330 }
-
331 
-
332 uint8_t ACM::SendBreak(uint16_t duration) {
-
333  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_CDCOUT, CDC_SEND_BREAK, (duration & 0xff), (duration >> 8), bControlIface, 0, 0, NULL, NULL));
-
334 }
-
335 
-
336 void ACM::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) {
-
337  Notify(PSTR("Endpoint descriptor:"), 0x80);
-
338  Notify(PSTR("\r\nLength:\t\t"), 0x80);
-
339  PrintHex<uint8_t > (ep_ptr->bLength, 0x80);
-
340  Notify(PSTR("\r\nType:\t\t"), 0x80);
-
341  PrintHex<uint8_t > (ep_ptr->bDescriptorType, 0x80);
-
342  Notify(PSTR("\r\nAddress:\t"), 0x80);
-
343  PrintHex<uint8_t > (ep_ptr->bEndpointAddress, 0x80);
-
344  Notify(PSTR("\r\nAttributes:\t"), 0x80);
-
345  PrintHex<uint8_t > (ep_ptr->bmAttributes, 0x80);
-
346  Notify(PSTR("\r\nMaxPktSize:\t"), 0x80);
-
347  PrintHex<uint16_t > (ep_ptr->wMaxPacketSize, 0x80);
-
348  Notify(PSTR("\r\nPoll Intrv:\t"), 0x80);
-
349  PrintHex<uint8_t > (ep_ptr->bInterval, 0x80);
-
350  Notify(PSTR("\r\n"), 0x80);
-
351 }
-
#define USB_CLASS_COM_AND_CDC_CTRL
Definition: UsbCore.h:56
-
#define USB_CLASS_CDC_DATA
Definition: UsbCore.h:63
-
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:766
+
316 void ACM::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) {
+
317  Notify(PSTR("Endpoint descriptor:"), 0x80);
+
318  Notify(PSTR("\r\nLength:\t\t"), 0x80);
+
319  D_PrintHex<uint8_t > (ep_ptr->bLength, 0x80);
+
320  Notify(PSTR("\r\nType:\t\t"), 0x80);
+
321  D_PrintHex<uint8_t > (ep_ptr->bDescriptorType, 0x80);
+
322  Notify(PSTR("\r\nAddress:\t"), 0x80);
+
323  D_PrintHex<uint8_t > (ep_ptr->bEndpointAddress, 0x80);
+
324  Notify(PSTR("\r\nAttributes:\t"), 0x80);
+
325  D_PrintHex<uint8_t > (ep_ptr->bmAttributes, 0x80);
+
326  Notify(PSTR("\r\nMaxPktSize:\t"), 0x80);
+
327  D_PrintHex<uint16_t > (ep_ptr->wMaxPacketSize, 0x80);
+
328  Notify(PSTR("\r\nPoll Intrv:\t"), 0x80);
+
329  D_PrintHex<uint8_t > (ep_ptr->bInterval, 0x80);
+
330  Notify(PSTR("\r\n"), 0x80);
+
331 }
+
#define USB_CLASS_COM_AND_CDC_CTRL
Definition: UsbCore.h:58
+
#define USB_CLASS_CDC_DATA
Definition: UsbCore.h:65
+
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:769
Definition: address.h:83
#define CDC_SUBCLASS_ACM
Definition: cdcacm.h:27
+
virtual tty_features enhanced_features(void)
Definition: cdcacm.h:222
ACM(USB *pusb, CDCAsyncOper *pasync)
Definition: cdcacm.cpp:23
#define CDC_PROTOCOL_ITU_T_V_250
Definition: cdcacm.h:40
EpInfo * epinfo
Definition: address.h:76
-
#define CP_MASK_COMPARE_PROTOCOL
+
#define CP_MASK_COMPARE_PROTOCOL
bool lowspeed
Definition: address.h:79
-
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:81
-
static const uint8_t epInterruptInIndex
Definition: cdcacm.h:142
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
+
virtual uint8_t OnInit(ACM *pacm)
Definition: cdcacm.h:131
+
static const uint8_t epInterruptInIndex
Definition: cdcacm.h:167
uint8_t bmNakPower
Definition: address.h:42
-
static const uint8_t epDataOutIndex
Definition: cdcacm.h:141
+
static const uint8_t epDataOutIndex
Definition: cdcacm.h:166
#define CDC_CLEAR_COMM_FEATURE
Definition: cdcacm.h:55
-
uint32_t qNextPollTime
Definition: cdcacm.h:151
+
uint32_t qNextPollTime
Definition: cdcacm.h:176
Definition: address.h:75
-
uint8_t bControlIface
Definition: cdcacm.h:148
+
uint8_t bControlIface
Definition: cdcacm.h:173
#define CDC_SET_COMM_FEATURE
Definition: cdcacm.h:53
Definition: usb_ch9.h:141
uint8_t bInterval
Definition: usb_ch9.h:147
#define CDC_SET_LINE_CODING
Definition: cdcacm.h:62
uint8_t bLength
Definition: usb_ch9.h:142
uint8_t bMaxPacketSize0
Definition: usb_ch9.h:105
-
bool ready
Definition: cdcacm.h:153
+
volatile bool ready
Definition: cdcacm.h:178
#define NotifyFail(...)
Definition: message.h:55
-
uint8_t bDataIface
Definition: cdcacm.h:149
-
USB * pUsb
Definition: cdcacm.h:144
-
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:805
-
uint8_t bNumEP
Definition: cdcacm.h:150
+
uint8_t bDataIface
Definition: cdcacm.h:174
+
USB * pUsb
Definition: cdcacm.h:169
+
virtual void autoflowRTS(bool s)
Definition: cdcacm.h:233
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
+
uint8_t bNumEP
Definition: cdcacm.h:175
#define bmREQ_CDCOUT
Definition: cdcacm.h:22
-
EpInfo epInfo[ACM_MAX_ENDPOINTS]
Definition: cdcacm.h:155
+
EpInfo epInfo[ACM_MAX_ENDPOINTS]
Definition: cdcacm.h:181
#define NotifyFailGetDevDescr(...)
Definition: message.h:50
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
-
#define CP_MASK_COMPARE_CLASS
-
bool bPollEnable
Definition: cdcacm.h:152
+
#define CP_MASK_COMPARE_CLASS
#define CDC_SEND_BREAK
Definition: cdcacm.h:65
#define CDC_GET_COMM_FEATURE
Definition: cdcacm.h:54
virtual void FreeAddress(uint8_t addr)=0
uint8_t epAttribs
Definition: address.h:37
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
Definition: Usb.cpp:126
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
-
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
Definition: cdcacm.cpp:336
+
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
Definition: cdcacm.cpp:316
#define Notify(...)
Definition: message.h:44
-
CDCAsyncOper * pAsync
Definition: cdcacm.h:145
+
CDCAsyncOper * pAsync
Definition: cdcacm.h:170
uint8_t bmAttributes
Definition: usb_ch9.h:145
-
+
#define USBTRACE2(s, r)
Definition: macros.h:77
-
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:796
-
#define ACM_MAX_ENDPOINTS
Definition: cdcacm.h:136
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
+
#define ACM_MAX_ENDPOINTS
Definition: cdcacm.h:161
#define NotifyFailGetConfDescr(...)
Definition: message.h:52
-
uint8_t GetLineCoding(LINE_CODING *dataptr)
Definition: cdcacm.cpp:324
+
virtual void wide(bool s)
Definition: cdcacm.h:245
+
uint8_t GetLineCoding(LINE_CODING *dataptr)
Definition: cdcacm.cpp:304
uint8_t epAddr
Definition: address.h:33
#define USB_NAK_MAX_POWER
Definition: address.h:27
+
virtual void autoflowXON(bool s)
Definition: cdcacm.h:239
#define bmREQ_CDCIN
Definition: cdcacm.h:23
-
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:304
-
virtual uint8_t Poll()
Definition: cdcacm.cpp:264
+
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:284
+
uint8_t Poll()
Definition: cdcacm.cpp:271
Definition: address.h:32
#define CDC_GET_LINE_CODING
Definition: cdcacm.h:63
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
Definition: Usb.cpp:292
uint16_t wMaxPacketSize
Definition: usb_ch9.h:146
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcacm.cpp:47
-
#define CP_MASK_COMPARE_SUBCLASS
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcacm.cpp:45
+
#define CP_MASK_COMPARE_SUBCLASS
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
uint8_t bEndpointAddress
Definition: usb_ch9.h:144
-
static const uint8_t epDataInIndex
Definition: cdcacm.h:140
-
uint8_t bAddress
Definition: cdcacm.h:146
+
static const uint8_t epDataInIndex
Definition: cdcacm.h:165
+
virtual void autoflowDSR(bool s)
Definition: cdcacm.h:236
+
uint8_t bAddress
Definition: cdcacm.h:171
Definition: cdcacm.h:110
-
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:83
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
+
#define PSTR(str)
uint8_t bDescriptorType
Definition: usb_ch9.h:143
-
uint8_t SetLineCoding(const LINE_CODING *dataptr)
Definition: cdcacm.cpp:320
+
uint8_t SetLineCoding(const LINE_CODING *dataptr)
Definition: cdcacm.cpp:300
-
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: cdcacm.cpp:224
-
uint8_t SendBreak(uint16_t duration)
Definition: cdcacm.cpp:332
-
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:80
+
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: cdcacm.cpp:230
+
#define USB_NAK_NOWAIT
Definition: address.h:29
+
uint8_t SendBreak(uint16_t duration)
Definition: cdcacm.cpp:312
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
Definition: cdcacm.h:128
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
Definition: Usb.cpp:206
-
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:75
-
uint8_t GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:312
-
virtual uint8_t Release()
Definition: cdcacm.cpp:251
-
uint8_t bConfNum
Definition: cdcacm.h:147
+
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:77
+
uint8_t GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:292
+
uint8_t Release()
Definition: cdcacm.cpp:257
+
uint8_t bConfNum
Definition: cdcacm.h:172
uint8_t bNumConfigurations
Definition: usb_ch9.h:112
-
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:78
+
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:80
#define CDC_SET_CONTROL_LINE_STATE
Definition: cdcacm.h:64
-
virtual uint8_t OnInit(ACM *pacm)=0
uint8_t maxPktSize
Definition: address.h:34
-
AddressPool & GetAddressPool()
Definition: UsbCore.h:206
-
Definition: UsbCore.h:190
-
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:210
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
Definition: UsbCore.h:197
+
volatile bool bPollEnable
Definition: cdcacm.h:177
+
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:217
#define NotifyFailSetConfDescr(...)
Definition: message.h:53
-
uint8_t SetControlLineState(uint8_t state)
Definition: cdcacm.cpp:328
-
uint8_t SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:308
-
uint8_t ClearCommFeature(uint16_t fid)
Definition: cdcacm.cpp:316
+
tty_features _enhanced_status
Definition: cdcacm.h:179
+
uint8_t SetControlLineState(uint8_t state)
Definition: cdcacm.cpp:308
+
uint8_t SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:288
+
uint8_t ClearCommFeature(uint16_t fid)
Definition: cdcacm.cpp:296
+
virtual void half_duplex(bool s)
Definition: cdcacm.h:242
#define USBTRACE(s)
Definition: macros.h:75
-
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:761
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:51
-
uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr)
Definition: cdcacm.cpp:300
+
uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr)
Definition: cdcacm.cpp:280
Definition: usb_ch9.h:98
diff --git a/cdcacm_8h.html b/cdcacm_8h.html index 32e1fea2..f0bde03b 100644 --- a/cdcacm_8h.html +++ b/cdcacm_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcacm.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -106,7 +107,7 @@ This graph shows which files directly or indirectly include this file:
- +

Go to the source code of this file.

@@ -125,6 +126,8 @@ Classes   class  CDCAsyncOper   +struct  tty_features +  class  ACM   @@ -969,7 +972,7 @@ Typedefs
-

Definition at line 136 of file cdcacm.h.

+

Definition at line 161 of file cdcacm.h.

@@ -1016,7 +1019,7 @@ Typedefs diff --git a/cdcacm_8h__dep__incl.map b/cdcacm_8h__dep__incl.map index 6b4e7e53..a9251060 100644 --- a/cdcacm_8h__dep__incl.map +++ b/cdcacm_8h__dep__incl.map @@ -1,5 +1,7 @@ - - - + + + + + diff --git a/cdcacm_8h__dep__incl.md5 b/cdcacm_8h__dep__incl.md5 index bbb3eb6c..9355f061 100644 --- a/cdcacm_8h__dep__incl.md5 +++ b/cdcacm_8h__dep__incl.md5 @@ -1 +1 @@ -97039ecdaa206b15dc79322f7b3da49a \ No newline at end of file +d9684fa8dbbab21f6c77cde6aba312ed \ No newline at end of file diff --git a/cdcacm_8h__dep__incl.png b/cdcacm_8h__dep__incl.png index 166474ef..03fa1f4e 100644 Binary files a/cdcacm_8h__dep__incl.png and b/cdcacm_8h__dep__incl.png differ diff --git a/cdcacm_8h__incl.md5 b/cdcacm_8h__incl.md5 index d35865e2..ac958164 100644 --- a/cdcacm_8h__incl.md5 +++ b/cdcacm_8h__incl.md5 @@ -1 +1 @@ -a06da110b6401ffa80ac6ba1c8b87e4c \ No newline at end of file +107fd47c127eab19013c78d1f9837064 \ No newline at end of file diff --git a/cdcacm_8h_source.html b/cdcacm_8h_source.html index 6bfd00b2..e64f0d69 100644 --- a/cdcacm_8h_source.html +++ b/cdcacm_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcacm.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -114,53 +115,53 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
23 #define bmREQ_CDCIN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
24 
25 // CDC Subclass Constants
-
26 #define CDC_SUBCLASS_DLCM 0x01 // Direct Line Control Model
-
27 #define CDC_SUBCLASS_ACM 0x02 // Abstract Control Model
-
28 #define CDC_SUBCLASS_TCM 0x03 // Telephone Control Model
-
29 #define CDC_SUBCLASS_MCCM 0x04 // Multi Channel Control Model
-
30 #define CDC_SUBCLASS_CAPI 0x05 // CAPI Control Model
-
31 #define CDC_SUBCLASS_ETHERNET 0x06 // Ethernet Network Control Model
-
32 #define CDC_SUBCLASS_ATM 0x07 // ATM Network Control Model
+
26 #define CDC_SUBCLASS_DLCM 0x01 // Direct Line Control Model
+
27 #define CDC_SUBCLASS_ACM 0x02 // Abstract Control Model
+
28 #define CDC_SUBCLASS_TCM 0x03 // Telephone Control Model
+
29 #define CDC_SUBCLASS_MCCM 0x04 // Multi Channel Control Model
+
30 #define CDC_SUBCLASS_CAPI 0x05 // CAPI Control Model
+
31 #define CDC_SUBCLASS_ETHERNET 0x06 // Ethernet Network Control Model
+
32 #define CDC_SUBCLASS_ATM 0x07 // ATM Network Control Model
33 #define CDC_SUBCLASS_WIRELESS_HANDSET 0x08 // Wireless Handset Control Model
34 #define CDC_SUBCLASS_DEVICE_MANAGEMENT 0x09 // Device Management
35 #define CDC_SUBCLASS_MOBILE_DIRECT_LINE 0x0A // Mobile Direct Line Model
-
36 #define CDC_SUBCLASS_OBEX 0x0B // OBEX
-
37 #define CDC_SUBCLASS_ETHERNET_EMU 0x0C // Ethernet Emulation Model
+
36 #define CDC_SUBCLASS_OBEX 0x0B // OBEX
+
37 #define CDC_SUBCLASS_ETHERNET_EMU 0x0C // Ethernet Emulation Model
38 
39 // Communication Interface Class Control Protocol Codes
-
40 #define CDC_PROTOCOL_ITU_T_V_250 0x01 // AT Commands defined by ITU-T V.250
-
41 #define CDC_PROTOCOL_PCCA_101 0x02 // AT Commands defined by PCCA-101
-
42 #define CDC_PROTOCOL_PCCA_101_O 0x03 // AT Commands defined by PCCA-101 & Annex O
-
43 #define CDC_PROTOCOL_GSM_7_07 0x04 // AT Commands defined by GSM 7.07
-
44 #define CDC_PROTOCOL_3GPP_27_07 0x05 // AT Commands defined by 3GPP 27.007
-
45 #define CDC_PROTOCOL_C_S0017_0 0x06 // AT Commands defined by TIA for CDMA
-
46 #define CDC_PROTOCOL_USB_EEM 0x07 // Ethernet Emulation Model
+
40 #define CDC_PROTOCOL_ITU_T_V_250 0x01 // AT Commands defined by ITU-T V.250
+
41 #define CDC_PROTOCOL_PCCA_101 0x02 // AT Commands defined by PCCA-101
+
42 #define CDC_PROTOCOL_PCCA_101_O 0x03 // AT Commands defined by PCCA-101 & Annex O
+
43 #define CDC_PROTOCOL_GSM_7_07 0x04 // AT Commands defined by GSM 7.07
+
44 #define CDC_PROTOCOL_3GPP_27_07 0x05 // AT Commands defined by 3GPP 27.007
+
45 #define CDC_PROTOCOL_C_S0017_0 0x06 // AT Commands defined by TIA for CDMA
+
46 #define CDC_PROTOCOL_USB_EEM 0x07 // Ethernet Emulation Model
47 
48 // CDC Commands defined by CDC 1.2
49 #define CDC_SEND_ENCAPSULATED_COMMAND 0x00
50 #define CDC_GET_ENCAPSULATED_RESPONSE 0x01
51 
52 // CDC Commands defined by PSTN 1.2
-
53 #define CDC_SET_COMM_FEATURE 0x02
-
54 #define CDC_GET_COMM_FEATURE 0x03
-
55 #define CDC_CLEAR_COMM_FEATURE 0x04
-
56 #define CDC_SET_AUX_LINE_STATE 0x10
-
57 #define CDC_SET_HOOK_STATE 0x11
-
58 #define CDC_PULSE_SETUP 0x12
-
59 #define CDC_SEND_PULSE 0x13
-
60 #define CDC_SET_PULSE_TIME 0x14
-
61 #define CDC_RING_AUX_JACK 0x15
-
62 #define CDC_SET_LINE_CODING 0x20
-
63 #define CDC_GET_LINE_CODING 0x21
-
64 #define CDC_SET_CONTROL_LINE_STATE 0x22
-
65 #define CDC_SEND_BREAK 0x23
-
66 #define CDC_SET_RINGER_PARMS 0x30
-
67 #define CDC_GET_RINGER_PARMS 0x31
-
68 #define CDC_SET_OPERATION_PARMS 0x32
-
69 #define CDC_GET_OPERATION_PARMS 0x33
-
70 #define CDC_SET_LINE_PARMS 0x34
-
71 #define CDC_GET_LINE_PARMS 0x35
-
72 #define CDC_DIAL_DIGITS 0x36
+
53 #define CDC_SET_COMM_FEATURE 0x02
+
54 #define CDC_GET_COMM_FEATURE 0x03
+
55 #define CDC_CLEAR_COMM_FEATURE 0x04
+
56 #define CDC_SET_AUX_LINE_STATE 0x10
+
57 #define CDC_SET_HOOK_STATE 0x11
+
58 #define CDC_PULSE_SETUP 0x12
+
59 #define CDC_SEND_PULSE 0x13
+
60 #define CDC_SET_PULSE_TIME 0x14
+
61 #define CDC_RING_AUX_JACK 0x15
+
62 #define CDC_SET_LINE_CODING 0x20
+
63 #define CDC_GET_LINE_CODING 0x21
+
64 #define CDC_SET_CONTROL_LINE_STATE 0x22
+
65 #define CDC_SEND_BREAK 0x23
+
66 #define CDC_SET_RINGER_PARMS 0x30
+
67 #define CDC_GET_RINGER_PARMS 0x31
+
68 #define CDC_SET_OPERATION_PARMS 0x32
+
69 #define CDC_GET_OPERATION_PARMS 0x33
+
70 #define CDC_SET_LINE_PARMS 0x34
+
71 #define CDC_GET_LINE_PARMS 0x35
+
72 #define CDC_DIAL_DIGITS 0x36
73 
74 //Class-Specific Notification Codes
75 #define NETWORK_CONNECTION 0x00
@@ -218,149 +219,221 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
127 
128 class CDCAsyncOper {
129 public:
-
130  virtual uint8_t OnInit(ACM *pacm) = 0;
-
131  //virtual void OnDataRcvd(ACM *pacm, uint8_t nbytes, uint8_t *dataptr) = 0;
-
132  //virtual void OnDisconnected(ACM *pacm) = 0;
-
133 };
-
134 
-
135 
-
136 #define ACM_MAX_ENDPOINTS 4
+
130 
+
131  virtual uint8_t OnInit(ACM *pacm) {
+
132  return 0;
+
133  };
+
134  //virtual void OnDataRcvd(ACM *pacm, uint8_t nbytes, uint8_t *dataptr) = 0;
+
135  //virtual void OnDisconnected(ACM *pacm) = 0;
+
136 };
137 
-
138 class ACM : public USBDeviceConfig, public UsbConfigXtracter {
-
139 protected:
-
140  static const uint8_t epDataInIndex; // DataIn endpoint index
-
141  static const uint8_t epDataOutIndex; // DataOUT endpoint index
-
142  static const uint8_t epInterruptInIndex; // InterruptIN endpoint index
-
143 
-
144  USB *pUsb;
-
145  CDCAsyncOper *pAsync;
-
146  uint8_t bAddress;
-
147  uint8_t bConfNum; // configuration number
-
148  uint8_t bControlIface; // Control interface value
-
149  uint8_t bDataIface; // Data interface value
-
150  uint8_t bNumEP; // total number of EP in the configuration
-
151  uint32_t qNextPollTime; // next poll time
-
152  bool bPollEnable; // poll enable flag
-
153  bool ready; //device ready indicator
-
154 
-
155  EpInfo epInfo[ACM_MAX_ENDPOINTS];
-
156 
-
157  void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr);
-
158 
-
159 public:
-
160  ACM(USB *pusb, CDCAsyncOper *pasync);
-
161 
-
162  uint8_t SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr);
-
163  uint8_t GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr);
-
164  uint8_t ClearCommFeature(uint16_t fid);
-
165  uint8_t SetLineCoding(const LINE_CODING *dataptr);
-
166  uint8_t GetLineCoding(LINE_CODING *dataptr);
-
167  uint8_t SetControlLineState(uint8_t state);
-
168  uint8_t SendBreak(uint16_t duration);
-
169  uint8_t GetNotif(uint16_t *bytes_rcvd, uint8_t *dataptr);
-
170 
-
171  // Methods for recieving and sending data
-
172  uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr);
-
173  uint8_t SndData(uint16_t nbytes, uint8_t *dataptr);
-
174 
-
175  // USBDeviceConfig implementation
-
176  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
-
177  virtual uint8_t Release();
-
178  virtual uint8_t Poll();
-
179 
-
180  virtual uint8_t GetAddress() {
-
181  return bAddress;
-
182  };
-
183 
-
184  virtual bool isReady() {
-
185  return ready;
-
186  };
+
143 typedef struct {
+
144 
+
145  union {
+
146  uint8_t tty;
+
147 
+
148  struct {
+
149  bool enhanced : 1; // Do we have the ability to set/clear any features?
+
150  // Status and 8th bit in data stream.
+
151  // Presence only indicates feature is available, but this isn't used for CDC-ACM.
+
152  bool wide : 1;
+
153  bool autoflow_RTS : 1; // Has autoflow on RTS/CTS
+
154  bool autoflow_DSR : 1; // Has autoflow on DTR/DSR
+
155  bool autoflow_XON : 1; // Has autoflow XON/XOFF
+
156  bool half_duplex : 1; // Has half-duplex capability.
+
157  } __attribute__((packed));
+
158  };
+
159 } tty_features;
+
160 
+
161 #define ACM_MAX_ENDPOINTS 4
+
162 
+
163 class ACM : public USBDeviceConfig, public UsbConfigXtracter {
+
164 protected:
+
165  static const uint8_t epDataInIndex; // DataIn endpoint index
+
166  static const uint8_t epDataOutIndex; // DataOUT endpoint index
+
167  static const uint8_t epInterruptInIndex; // InterruptIN endpoint index
+
168 
+
169  USB *pUsb;
+
170  CDCAsyncOper *pAsync;
+
171  uint8_t bAddress;
+
172  uint8_t bConfNum; // configuration number
+
173  uint8_t bControlIface; // Control interface value
+
174  uint8_t bDataIface; // Data interface value
+
175  uint8_t bNumEP; // total number of EP in the configuration
+
176  uint32_t qNextPollTime; // next poll time
+
177  volatile bool bPollEnable; // poll enable flag
+
178  volatile bool ready; //device ready indicator
+
179  tty_features _enhanced_status; // current status
+
180 
+
181  EpInfo epInfo[ACM_MAX_ENDPOINTS];
+
182 
+
183  void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr);
+
184 
+
185 public:
+
186  ACM(USB *pusb, CDCAsyncOper *pasync);
187 
-
188  // UsbConfigXtracter implementation
-
189  virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
-
190 };
-
191 
-
192 #endif // __CDCACM_H__
+
188  uint8_t SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr);
+
189  uint8_t GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr);
+
190  uint8_t ClearCommFeature(uint16_t fid);
+
191  uint8_t SetLineCoding(const LINE_CODING *dataptr);
+
192  uint8_t GetLineCoding(LINE_CODING *dataptr);
+
193  uint8_t SetControlLineState(uint8_t state);
+
194  uint8_t SendBreak(uint16_t duration);
+
195  uint8_t GetNotif(uint16_t *bytes_rcvd, uint8_t *dataptr);
+
196 
+
197  // Methods for receiving and sending data
+
198  uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr);
+
199  uint8_t SndData(uint16_t nbytes, uint8_t *dataptr);
+
200 
+
201  // USBDeviceConfig implementation
+
202  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
+
203  uint8_t Release();
+
204  uint8_t Poll();
+
205 
+
206  bool available(void) {
+
207 
+
208  };
+
209 
+
210  virtual uint8_t GetAddress() {
+
211  return bAddress;
+
212  };
+
213 
+
214  virtual bool isReady() {
+
215  return ready;
+
216  };
+
217 
+
218  virtual tty_features enhanced_status(void) {
+
219  return _enhanced_status;
+
220  };
+
221 
+
222  virtual tty_features enhanced_features(void) {
+
223  tty_features rv;
+
224  rv.enhanced = false;
+
225  rv.autoflow_RTS = false;
+
226  rv.autoflow_DSR = false;
+
227  rv.autoflow_XON = false;
+
228  rv.half_duplex = false;
+
229  rv.wide = false;
+
230  return rv;
+
231  };
+
232 
+
233  virtual void autoflowRTS(bool s) {
+
234  };
+
235 
+
236  virtual void autoflowDSR(bool s) {
+
237  };
+
238 
+
239  virtual void autoflowXON(bool s) {
+
240  };
+
241 
+
242  virtual void half_duplex(bool s) {
+
243  };
+
244 
+
245  virtual void wide(bool s) {
+
246  };
+
247 
+
248  // UsbConfigXtracter implementation
+
249  void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
+
250 };
+
251 
+
252 #endif // __CDCACM_H__
uint16_t wIndex
Definition: cdcacm.h:121
+
virtual tty_features enhanced_features(void)
Definition: cdcacm.h:222
+
bool available(void)
Definition: cdcacm.h:206
ACM(USB *pusb, CDCAsyncOper *pasync)
Definition: cdcacm.cpp:23
-
static const uint8_t epInterruptInIndex
Definition: cdcacm.h:142
-
virtual uint8_t GetAddress()
Definition: cdcacm.h:180
-
static const uint8_t epDataOutIndex
Definition: cdcacm.h:141
-
uint32_t qNextPollTime
Definition: cdcacm.h:151
+
virtual uint8_t OnInit(ACM *pacm)
Definition: cdcacm.h:131
+
static const uint8_t epInterruptInIndex
Definition: cdcacm.h:167
+
virtual uint8_t GetAddress()
Definition: cdcacm.h:210
+
static const uint8_t epDataOutIndex
Definition: cdcacm.h:166
+
uint32_t qNextPollTime
Definition: cdcacm.h:176
uint8_t bParityType
Definition: cdcacm.h:113
uint8_t bCharFormat
Definition: cdcacm.h:112
uint8_t bDataBits
Definition: cdcacm.h:114
uint8_t bNotification
Definition: cdcacm.h:119
-
uint8_t bControlIface
Definition: cdcacm.h:148
+
uint8_t bControlIface
Definition: cdcacm.h:173
uint16_t wValue
Definition: cdcacm.h:120
Definition: usb_ch9.h:141
-
bool ready
Definition: cdcacm.h:153
-
uint8_t bDataIface
Definition: cdcacm.h:149
-
USB * pUsb
Definition: cdcacm.h:144
+
volatile bool ready
Definition: cdcacm.h:178
+
uint8_t bDataIface
Definition: cdcacm.h:174
+
USB * pUsb
Definition: cdcacm.h:169
uint8_t bDataInterface
Definition: cdcacm.h:91
uint8_t bDescriptorType
Definition: cdcacm.h:88
-
uint8_t bNumEP
Definition: cdcacm.h:150
+
virtual void autoflowRTS(bool s)
Definition: cdcacm.h:233
+
uint8_t bNumEP
Definition: cdcacm.h:175
Definition: cdcacm.h:102
-
EpInfo epInfo[ACM_MAX_ENDPOINTS]
Definition: cdcacm.h:155
-
Definition: UsbCore.h:119
+
EpInfo epInfo[ACM_MAX_ENDPOINTS]
Definition: cdcacm.h:181
+
Definition: UsbCore.h:121
+
uint8_t tty
Definition: cdcacm.h:146
Definition: cdcacm.h:117
uint8_t bFunctionLength
Definition: cdcacm.h:95
+
virtual tty_features enhanced_status(void)
Definition: cdcacm.h:218
uint8_t bDescriptorSubtype
Definition: cdcacm.h:89
uint8_t bNumRingerPatterns
Definition: cdcacm.h:107
-
bool bPollEnable
Definition: cdcacm.h:152
uint8_t bDescriptorSubtype
Definition: cdcacm.h:97
uint16_t bmState
Definition: cdcacm.h:123
-
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
Definition: cdcacm.cpp:336
-
CDCAsyncOper * pAsync
Definition: cdcacm.h:145
-
#define ACM_MAX_ENDPOINTS
Definition: cdcacm.h:136
-
uint8_t GetLineCoding(LINE_CODING *dataptr)
Definition: cdcacm.cpp:324
+
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
Definition: cdcacm.cpp:316
+
CDCAsyncOper * pAsync
Definition: cdcacm.h:170
+
#define ACM_MAX_ENDPOINTS
Definition: cdcacm.h:161
+
virtual void wide(bool s)
Definition: cdcacm.h:245
+
uint8_t GetLineCoding(LINE_CODING *dataptr)
Definition: cdcacm.cpp:304
Definition: cdcacm.h:86
uint8_t bDescriptorType
Definition: cdcacm.h:96
+
bool enhanced
Definition: cdcacm.h:149
+
bool wide
Definition: cdcacm.h:152
+
virtual void autoflowXON(bool s)
Definition: cdcacm.h:239
uint8_t bRingerVolSteps
Definition: cdcacm.h:106
-
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:304
-
virtual uint8_t Poll()
Definition: cdcacm.cpp:264
+
bool autoflow_XON
Definition: cdcacm.h:155
+
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:284
+
bool autoflow_RTS
Definition: cdcacm.h:153
+
uint8_t Poll()
Definition: cdcacm.cpp:271
Definition: address.h:32
uint8_t bmCapabilities
Definition: cdcacm.h:98
uint8_t bDescriptorSubtype
Definition: cdcacm.h:105
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcacm.cpp:47
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcacm.cpp:45
+
Definition: cdcacm.h:143
uint8_t bmRequestType
Definition: cdcacm.h:118
-
static const uint8_t epDataInIndex
Definition: cdcacm.h:140
-
uint8_t bAddress
Definition: cdcacm.h:146
+
bool autoflow_DSR
Definition: cdcacm.h:154
+
static const uint8_t epDataInIndex
Definition: cdcacm.h:165
+
virtual void autoflowDSR(bool s)
Definition: cdcacm.h:236
+
uint8_t bAddress
Definition: cdcacm.h:171
Definition: cdcacm.h:110
-
virtual bool isReady()
Definition: cdcacm.h:184
-
uint8_t SetLineCoding(const LINE_CODING *dataptr)
Definition: cdcacm.cpp:320
+
virtual bool isReady()
Definition: cdcacm.h:214
+
uint8_t SetLineCoding(const LINE_CODING *dataptr)
Definition: cdcacm.cpp:300
uint8_t bFunctionLength
Definition: cdcacm.h:103
struct ACM_FUNC_DESCR TEL_CALL_STATE_REP_CPBL_FUNC_DESCR
-
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: cdcacm.cpp:224
-
uint8_t SendBreak(uint16_t duration)
Definition: cdcacm.cpp:332
+
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: cdcacm.cpp:230
+
uint8_t SendBreak(uint16_t duration)
Definition: cdcacm.cpp:312
uint16_t wLength
Definition: cdcacm.h:122
Definition: cdcacm.h:128
uint8_t GetNotif(uint16_t *bytes_rcvd, uint8_t *dataptr)
uint32_t dwDTERate
Definition: cdcacm.h:111
-
uint8_t GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:312
-
virtual uint8_t Release()
Definition: cdcacm.cpp:251
-
uint8_t bConfNum
Definition: cdcacm.h:147
+
uint8_t GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:292
+
bool half_duplex
Definition: cdcacm.h:156
+
uint8_t Release()
Definition: cdcacm.cpp:257
+
uint8_t bConfNum
Definition: cdcacm.h:172
struct ACM_FUNC_DESCR TEL_OPER_MODES_FUNC_DESCR
-
virtual uint8_t OnInit(ACM *pacm)=0
Definition: cdcacm.h:94
-
Definition: UsbCore.h:190
-
Definition: cdcacm.h:138
+
Definition: UsbCore.h:197
+
volatile bool bPollEnable
Definition: cdcacm.h:177
+
Definition: cdcacm.h:163
uint8_t bDescriptorType
Definition: cdcacm.h:104
-
uint8_t SetControlLineState(uint8_t state)
Definition: cdcacm.cpp:328
-
uint8_t SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:308
-
uint8_t ClearCommFeature(uint16_t fid)
Definition: cdcacm.cpp:316
+
tty_features _enhanced_status
Definition: cdcacm.h:179
+
uint8_t SetControlLineState(uint8_t state)
Definition: cdcacm.cpp:308
+
uint8_t SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
Definition: cdcacm.cpp:288
+
uint8_t ClearCommFeature(uint16_t fid)
Definition: cdcacm.cpp:296
struct ACM_FUNC_DESCR DLM_FUNC_DESCR
+
virtual void half_duplex(bool s)
Definition: cdcacm.h:242
uint8_t bFunctionLength
Definition: cdcacm.h:87
uint8_t bmCapabilities
Definition: cdcacm.h:90
-
uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr)
Definition: cdcacm.cpp:300
+
uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr)
Definition: cdcacm.cpp:280
diff --git a/cdcftdi_8cpp.html b/cdcftdi_8cpp.html index b8e8d212..fb6b42c2 100644 --- a/cdcftdi_8cpp.html +++ b/cdcftdi_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcftdi.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -104,7 +105,7 @@ Include dependency graph for cdcftdi.cpp:
diff --git a/cdcftdi_8cpp__incl.md5 b/cdcftdi_8cpp__incl.md5 index 958e3057..f6dd1fa8 100644 --- a/cdcftdi_8cpp__incl.md5 +++ b/cdcftdi_8cpp__incl.md5 @@ -1 +1 @@ -65fc37f20195417aa899b408712d428a \ No newline at end of file +e865f32d985af2b4d5e2da82e7c52bae \ No newline at end of file diff --git a/cdcftdi_8cpp_source.html b/cdcftdi_8cpp_source.html index 6d81d6c1..ba45527b 100644 --- a/cdcftdi_8cpp_source.html +++ b/cdcftdi_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcftdi.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -121,326 +122,321 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
30  epInfo[i].epAddr = 0;
31  epInfo[i].maxPktSize = (i) ? 0 : 8;
32  epInfo[i].epAttribs = 0;
-
33 
-
34  //if (!i)
-
35  epInfo[i].bmNakPower = USB_NAK_MAX_POWER;
-
36  }
-
37  if(pUsb)
-
38  pUsb->RegisterDeviceClass(this);
-
39 }
-
40 
-
41 uint8_t FTDI::Init(uint8_t parent, uint8_t port, bool lowspeed) {
-
42  const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR);
-
43 
-
44  uint8_t buf[constBufSize];
-
45  USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
-
46  uint8_t rcode;
-
47  UsbDevice *p = NULL;
-
48  EpInfo *oldep_ptr = NULL;
-
49  //uint8_t len = 0;
-
50  //uint16_t cd_len = 0;
+
33  epInfo[i].bmNakPower = (i==epDataInIndex) ? USB_NAK_NOWAIT: USB_NAK_MAX_POWER;
+
34  }
+
35  if(pUsb)
+
36  pUsb->RegisterDeviceClass(this);
+
37 }
+
38 
+
39 uint8_t FTDI::Init(uint8_t parent, uint8_t port, bool lowspeed) {
+
40  const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR);
+
41 
+
42  uint8_t buf[constBufSize];
+
43  USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
+
44  uint8_t rcode;
+
45  UsbDevice *p = NULL;
+
46  EpInfo *oldep_ptr = NULL;
+
47 
+
48  uint8_t num_of_conf; // number of configurations
+
49 
+
50  AddressPool &addrPool = pUsb->GetAddressPool();
51 
-
52  uint8_t num_of_conf; // number of configurations
-
53  //uint8_t num_of_intf; // number of interfaces
-
54 
-
55  AddressPool &addrPool = pUsb->GetAddressPool();
+
52  USBTRACE("FTDI Init\r\n");
+
53 
+
54  if(bAddress)
+
55  return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE;
56 
-
57  USBTRACE("FTDI Init\r\n");
-
58 
-
59  if(bAddress)
-
60  return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE;
-
61 
-
62  // Get pointer to pseudo device with address 0 assigned
-
63  p = addrPool.GetUsbDevicePtr(0);
-
64 
-
65  if(!p)
-
66  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
+
57  // Get pointer to pseudo device with address 0 assigned
+
58  p = addrPool.GetUsbDevicePtr(0);
+
59 
+
60  if(!p)
+
61  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
+
62 
+
63  if(!p->epinfo) {
+
64  USBTRACE("epinfo\r\n");
+
65  return USB_ERROR_EPINFO_IS_NULL;
+
66  }
67 
-
68  if(!p->epinfo) {
-
69  USBTRACE("epinfo\r\n");
-
70  return USB_ERROR_EPINFO_IS_NULL;
-
71  }
-
72 
-
73  // Save old pointer to EP_RECORD of address 0
-
74  oldep_ptr = p->epinfo;
+
68  // Save old pointer to EP_RECORD of address 0
+
69  oldep_ptr = p->epinfo;
+
70 
+
71  // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence
+
72  p->epinfo = epInfo;
+
73 
+
74  p->lowspeed = lowspeed;
75 
-
76  // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence
-
77  p->epinfo = epInfo;
+
76  // Get device descriptor
+
77  rcode = pUsb->getDevDescr(0, 0, sizeof (USB_DEVICE_DESCRIPTOR), buf);
78 
-
79  p->lowspeed = lowspeed;
-
80 
-
81  // Get device descriptor
-
82  rcode = pUsb->getDevDescr(0, 0, sizeof (USB_DEVICE_DESCRIPTOR), buf);
-
83 
-
84  // Restore p->epinfo
-
85  p->epinfo = oldep_ptr;
+
79  // Restore p->epinfo
+
80  p->epinfo = oldep_ptr;
+
81 
+
82  if(rcode)
+
83  goto FailGetDevDescr;
+
84  if(udd->idVendor != FTDI_VID || udd->idProduct != FTDI_PID)
+
85  return USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED;
86 
-
87  if(rcode)
-
88  goto FailGetDevDescr;
-
89  if(udd->idVendor != FTDI_VID || udd->idProduct != FTDI_PID)
-
90  return USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED;
-
91 
-
92  // Save type of FTDI chip
-
93  wFTDIType = udd->bcdDevice;
-
94 
-
95  // Allocate new address according to device class
-
96  bAddress = addrPool.AllocAddress(parent, false, port);
-
97 
-
98  if(!bAddress)
-
99  return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL;
-
100 
-
101  // Extract Max Packet Size from the device descriptor
-
102  epInfo[0].maxPktSize = udd->bMaxPacketSize0;
-
103 
-
104  // Assign new address to the device
-
105  rcode = pUsb->setAddr(0, 0, bAddress);
-
106 
-
107  if(rcode) {
-
108  p->lowspeed = false;
-
109  addrPool.FreeAddress(bAddress);
-
110  bAddress = 0;
-
111  USBTRACE2("setAddr:", rcode);
-
112  return rcode;
-
113  }
-
114 
-
115  USBTRACE2("Addr:", bAddress);
-
116 
-
117  p->lowspeed = false;
+
87  // Save type of FTDI chip
+
88  wFTDIType = udd->bcdDevice;
+
89 
+
90  // Allocate new address according to device class
+
91  bAddress = addrPool.AllocAddress(parent, false, port);
+
92 
+
93  if(!bAddress)
+
94  return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL;
+
95 
+
96  // Extract Max Packet Size from the device descriptor
+
97  epInfo[0].maxPktSize = udd->bMaxPacketSize0;
+
98 
+
99  // Assign new address to the device
+
100  rcode = pUsb->setAddr(0, 0, bAddress);
+
101 
+
102  if(rcode) {
+
103  p->lowspeed = false;
+
104  addrPool.FreeAddress(bAddress);
+
105  bAddress = 0;
+
106  USBTRACE2("setAddr:", rcode);
+
107  return rcode;
+
108  }
+
109 
+
110  USBTRACE2("Addr:", bAddress);
+
111 
+
112  p->lowspeed = false;
+
113 
+
114  p = addrPool.GetUsbDevicePtr(bAddress);
+
115 
+
116  if(!p)
+
117  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
118 
-
119  p = addrPool.GetUsbDevicePtr(bAddress);
+
119  p->lowspeed = lowspeed;
120 
-
121  if(!p)
-
122  return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL;
-
123 
-
124  p->lowspeed = lowspeed;
+
121  num_of_conf = udd->bNumConfigurations;
+
122 
+
123  // Assign epInfo to epinfo pointer
+
124  rcode = pUsb->setEpInfoEntry(bAddress, 1, epInfo);
125 
-
126  num_of_conf = udd->bNumConfigurations;
-
127 
-
128  // Assign epInfo to epinfo pointer
-
129  rcode = pUsb->setEpInfoEntry(bAddress, 1, epInfo);
+
126  if(rcode)
+
127  goto FailSetDevTblEntry;
+
128 
+
129  USBTRACE2("NC:", num_of_conf);
130 
-
131  if(rcode)
-
132  goto FailSetDevTblEntry;
-
133 
-
134  USBTRACE2("NC:", num_of_conf);
-
135 
-
136  for(uint8_t i = 0; i < num_of_conf; i++) {
-
137  HexDumper<USBReadParser, uint16_t, uint16_t> HexDump;
-
138  ConfigDescParser < 0xFF, 0xFF, 0xFF, CP_MASK_COMPARE_ALL> confDescrParser(this);
+
131  for(uint8_t i = 0; i < num_of_conf; i++) {
+
132  HexDumper<USBReadParser, uint16_t, uint16_t> HexDump;
+
133  ConfigDescParser < 0xFF, 0xFF, 0xFF, CP_MASK_COMPARE_ALL> confDescrParser(this);
+
134 
+
135  rcode = pUsb->getConfDescr(bAddress, 0, i, &HexDump);
+
136 
+
137  if(rcode)
+
138  goto FailGetConfDescr;
139 
-
140  rcode = pUsb->getConfDescr(bAddress, 0, i, &HexDump);
+
140  rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser);
141 
142  if(rcode)
143  goto FailGetConfDescr;
144 
-
145  rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser);
-
146 
-
147  if(rcode)
-
148  goto FailGetConfDescr;
-
149 
-
150  if(bNumEP > 1)
-
151  break;
-
152  } // for
+
145  if(bNumEP > 1)
+
146  break;
+
147  } // for
+
148 
+
149  if(bNumEP < 2)
+
150  return USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED;
+
151 
+
152  USBTRACE2("NumEP:", bNumEP);
153 
-
154  if(bNumEP < 2)
-
155  return USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED;
+
154  // Assign epInfo to epinfo pointer
+
155  rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo);
156 
-
157  USBTRACE2("NumEP:", bNumEP);
+
157  USBTRACE2("Conf:", bConfNum);
158 
-
159  // Assign epInfo to epinfo pointer
-
160  rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo);
+
159  // Set Configuration Value
+
160  rcode = pUsb->setConf(bAddress, 0, bConfNum);
161 
-
162  USBTRACE2("Conf:", bConfNum);
-
163 
-
164  // Set Configuration Value
-
165  rcode = pUsb->setConf(bAddress, 0, bConfNum);
+
162  if(rcode)
+
163  goto FailSetConfDescr;
+
164 
+
165  rcode = pAsync->OnInit(this);
166 
167  if(rcode)
-
168  goto FailSetConfDescr;
+
168  goto FailOnInit;
169 
-
170  rcode = pAsync->OnInit(this);
+
170  USBTRACE("FTDI configured\r\n");
171 
-
172  if(rcode)
-
173  goto FailOnInit;
+
172  bPollEnable = true;
+
173  return 0;
174 
-
175  USBTRACE("FTDI configured\r\n");
-
176 
-
177  bPollEnable = true;
-
178  return 0;
-
179 
-
180 FailGetDevDescr:
-
181 #ifdef DEBUG_USB_HOST
-
182  NotifyFailGetDevDescr();
-
183  goto Fail;
-
184 #endif
-
185 
-
186 FailSetDevTblEntry:
-
187 #ifdef DEBUG_USB_HOST
-
188  NotifyFailSetDevTblEntry();
-
189  goto Fail;
-
190 #endif
-
191 
-
192 FailGetConfDescr:
-
193 #ifdef DEBUG_USB_HOST
-
194  NotifyFailGetConfDescr();
-
195  goto Fail;
-
196 #endif
-
197 
-
198 FailSetConfDescr:
-
199 #ifdef DEBUG_USB_HOST
-
200  NotifyFailSetConfDescr();
-
201  goto Fail;
-
202 #endif
-
203 
-
204 FailOnInit:
-
205 #ifdef DEBUG_USB_HOST
-
206  USBTRACE("OnInit:");
-
207 
-
208 Fail:
-
209  NotifyFail(rcode);
-
210 #endif
-
211  Release();
-
212  return rcode;
-
213 }
+
175 FailGetDevDescr:
+
176 #ifdef DEBUG_USB_HOST
+
177  NotifyFailGetDevDescr();
+
178  goto Fail;
+
179 #endif
+
180 
+
181 FailSetDevTblEntry:
+
182 #ifdef DEBUG_USB_HOST
+
183  NotifyFailSetDevTblEntry();
+
184  goto Fail;
+
185 #endif
+
186 
+
187 FailGetConfDescr:
+
188 #ifdef DEBUG_USB_HOST
+
189  NotifyFailGetConfDescr();
+
190  goto Fail;
+
191 #endif
+
192 
+
193 FailSetConfDescr:
+
194 #ifdef DEBUG_USB_HOST
+
195  NotifyFailSetConfDescr();
+
196  goto Fail;
+
197 #endif
+
198 
+
199 FailOnInit:
+
200 #ifdef DEBUG_USB_HOST
+
201  USBTRACE("OnInit:");
+
202 
+
203 Fail:
+
204  NotifyFail(rcode);
+
205 #endif
+
206  Release();
+
207  return rcode;
+
208 }
+
209 
+
210 void FTDI::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) {
+
211  ErrorMessage<uint8_t > (PSTR("Conf.Val"), conf);
+
212  ErrorMessage<uint8_t > (PSTR("Iface Num"), iface);
+
213  ErrorMessage<uint8_t > (PSTR("Alt.Set"), alt);
214 
-
215 void FTDI::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) {
-
216  ErrorMessage<uint8_t > (PSTR("Conf.Val"), conf);
-
217  ErrorMessage<uint8_t > (PSTR("Iface Num"), iface);
-
218  ErrorMessage<uint8_t > (PSTR("Alt.Set"), alt);
-
219 
-
220  bConfNum = conf;
-
221 
-
222  uint8_t index;
-
223 
-
224  if((pep->bmAttributes & 0x03) == 3 && (pep->bEndpointAddress & 0x80) == 0x80)
-
225  index = epInterruptInIndex;
-
226  else
-
227  if((pep->bmAttributes & 0x02) == 2)
-
228  index = ((pep->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex;
-
229  else
-
230  return;
+
215  bConfNum = conf;
+
216 
+
217  uint8_t index;
+
218 
+
219  if((pep->bmAttributes & 0x03) == 3 && (pep->bEndpointAddress & 0x80) == 0x80)
+
220  index = epInterruptInIndex;
+
221  else
+
222  if((pep->bmAttributes & 0x02) == 2)
+
223  index = ((pep->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex;
+
224  else
+
225  return;
+
226 
+
227  // Fill in the endpoint info structure
+
228  epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F);
+
229  epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize;
+
230  epInfo[index].epAttribs = 0;
231 
-
232  // Fill in the endpoint info structure
-
233  epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F);
-
234  epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize;
-
235  epInfo[index].epAttribs = 0;
+
232  bNumEP++;
+
233 
+
234  PrintEndpointDescriptor(pep);
+
235 }
236 
-
237  bNumEP++;
-
238 
-
239  PrintEndpointDescriptor(pep);
-
240 }
-
241 
-
242 uint8_t FTDI::Release() {
-
243  pUsb->GetAddressPool().FreeAddress(bAddress);
-
244 
-
245  bAddress = 0;
-
246  bNumEP = 1;
-
247  qNextPollTime = 0;
-
248  bPollEnable = false;
-
249  return 0;
-
250 }
-
251 
-
252 uint8_t FTDI::Poll() {
-
253  uint8_t rcode = 0;
-
254 
-
255  //if (!bPollEnable)
-
256  // return 0;
-
257 
-
258  //if (qNextPollTime <= millis())
-
259  //{
-
260  // USB_HOST_SERIAL.println(bAddress, HEX);
+
237 uint8_t FTDI::Release() {
+
238  pUsb->GetAddressPool().FreeAddress(bAddress);
+
239 
+
240  bAddress = 0;
+
241  bNumEP = 1;
+
242  qNextPollTime = 0;
+
243  bPollEnable = false;
+
244  return pAsync->OnRelease(this);
+
245 }
+
246 
+
247 uint8_t FTDI::Poll() {
+
248  uint8_t rcode = 0;
+
249 
+
250  //if (!bPollEnable)
+
251  // return 0;
+
252 
+
253  //if (qNextPollTime <= millis())
+
254  //{
+
255  // USB_HOST_SERIAL.println(bAddress, HEX);
+
256 
+
257  // qNextPollTime = millis() + 100;
+
258  //}
+
259  return rcode;
+
260 }
261 
-
262  // qNextPollTime = millis() + 100;
-
263  //}
-
264  return rcode;
-
265 }
-
266 
-
267 uint8_t FTDI::SetBaudRate(uint32_t baud) {
-
268  uint16_t baud_value, baud_index = 0;
-
269  uint32_t divisor3;
-
270 
-
271  divisor3 = 48000000 / 2 / baud; // divisor shifted 3 bits to the left
-
272 
-
273  if(wFTDIType == FT232AM) {
-
274  if((divisor3 & 0x7) == 7)
-
275  divisor3++; // round x.7/8 up to x+1
-
276 
-
277  baud_value = divisor3 >> 3;
-
278  divisor3 &= 0x7;
-
279 
-
280  if(divisor3 == 1) baud_value |= 0xc000;
-
281  else // 0.125
-
282  if(divisor3 >= 4) baud_value |= 0x4000;
-
283  else // 0.5
-
284  if(divisor3 != 0) baud_value |= 0x8000; // 0.25
-
285  if(baud_value == 1) baud_value = 0; /* special case for maximum baud rate */
-
286  } else {
-
287  static const unsigned char divfrac [8] = {0, 3, 2, 0, 1, 1, 2, 3};
-
288  static const unsigned char divindex[8] = {0, 0, 0, 1, 0, 1, 1, 1};
-
289 
-
290  baud_value = divisor3 >> 3;
-
291  baud_value |= divfrac [divisor3 & 0x7] << 14;
-
292  baud_index = divindex[divisor3 & 0x7];
-
293 
-
294  /* Deal with special cases for highest baud rates. */
-
295  if(baud_value == 1) baud_value = 0;
-
296  else // 1.0
-
297  if(baud_value == 0x4001) baud_value = 1; // 1.5
-
298  }
-
299  USBTRACE2("baud_value:", baud_value);
-
300  USBTRACE2("baud_index:", baud_index);
-
301  return pUsb->ctrlReq(bAddress, 0, bmREQ_FTDI_OUT, FTDI_SIO_SET_BAUD_RATE, baud_value & 0xff, baud_value >> 8, baud_index, 0, 0, NULL, NULL);
-
302 }
-
303 
-
304 uint8_t FTDI::SetModemControl(uint16_t signal) {
-
305  return pUsb->ctrlReq(bAddress, 0, bmREQ_FTDI_OUT, FTDI_SIO_MODEM_CTRL, signal & 0xff, signal >> 8, 0, 0, 0, NULL, NULL);
-
306 }
-
307 
-
308 uint8_t FTDI::SetFlowControl(uint8_t protocol, uint8_t xon, uint8_t xoff) {
-
309  return pUsb->ctrlReq(bAddress, 0, bmREQ_FTDI_OUT, FTDI_SIO_SET_FLOW_CTRL, xon, xoff, protocol << 8, 0, 0, NULL, NULL);
-
310 }
-
311 
-
312 uint8_t FTDI::SetData(uint16_t databm) {
-
313  return pUsb->ctrlReq(bAddress, 0, bmREQ_FTDI_OUT, FTDI_SIO_SET_DATA, databm & 0xff, databm >> 8, 0, 0, 0, NULL, NULL);
-
314 }
-
315 
-
316 uint8_t FTDI::RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr) {
-
317  return pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, bytes_rcvd, dataptr);
-
318 }
-
319 
-
320 uint8_t FTDI::SndData(uint16_t nbytes, uint8_t *dataptr) {
-
321  return pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, nbytes, dataptr);
-
322 }
-
323 
-
324 void FTDI::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) {
-
325  Notify(PSTR("Endpoint descriptor:"), 0x80);
-
326  Notify(PSTR("\r\nLength:\t\t"), 0x80);
-
327  PrintHex<uint8_t > (ep_ptr->bLength, 0x80);
-
328  Notify(PSTR("\r\nType:\t\t"), 0x80);
-
329  PrintHex<uint8_t > (ep_ptr->bDescriptorType, 0x80);
-
330  Notify(PSTR("\r\nAddress:\t"), 0x80);
-
331  PrintHex<uint8_t > (ep_ptr->bEndpointAddress, 0x80);
-
332  Notify(PSTR("\r\nAttributes:\t"), 0x80);
-
333  PrintHex<uint8_t > (ep_ptr->bmAttributes, 0x80);
-
334  Notify(PSTR("\r\nMaxPktSize:\t"), 0x80);
-
335  PrintHex<uint16_t > (ep_ptr->wMaxPacketSize, 0x80);
-
336  Notify(PSTR("\r\nPoll Intrv:\t"), 0x80);
-
337  PrintHex<uint8_t > (ep_ptr->bInterval, 0x80);
-
338  Notify(PSTR("\r\n"), 0x80);
-
339 }
-
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:766
+
262 uint8_t FTDI::SetBaudRate(uint32_t baud) {
+
263  uint16_t baud_value, baud_index = 0;
+
264  uint32_t divisor3;
+
265 
+
266  divisor3 = 48000000 / 2 / baud; // divisor shifted 3 bits to the left
+
267 
+
268  if(wFTDIType == FT232AM) {
+
269  if((divisor3 & 0x7) == 7)
+
270  divisor3++; // round x.7/8 up to x+1
+
271 
+
272  baud_value = divisor3 >> 3;
+
273  divisor3 &= 0x7;
+
274 
+
275  if(divisor3 == 1) baud_value |= 0xc000;
+
276  else // 0.125
+
277  if(divisor3 >= 4) baud_value |= 0x4000;
+
278  else // 0.5
+
279  if(divisor3 != 0) baud_value |= 0x8000; // 0.25
+
280  if(baud_value == 1) baud_value = 0; /* special case for maximum baud rate */
+
281  } else {
+
282  static const unsigned char divfrac [8] = {0, 3, 2, 0, 1, 1, 2, 3};
+
283  static const unsigned char divindex[8] = {0, 0, 0, 1, 0, 1, 1, 1};
+
284 
+
285  baud_value = divisor3 >> 3;
+
286  baud_value |= divfrac [divisor3 & 0x7] << 14;
+
287  baud_index = divindex[divisor3 & 0x7];
+
288 
+
289  /* Deal with special cases for highest baud rates. */
+
290  if(baud_value == 1) baud_value = 0;
+
291  else // 1.0
+
292  if(baud_value == 0x4001) baud_value = 1; // 1.5
+
293  }
+
294  USBTRACE2("baud_value:", baud_value);
+
295  USBTRACE2("baud_index:", baud_index);
+
296  return pUsb->ctrlReq(bAddress, 0, bmREQ_FTDI_OUT, FTDI_SIO_SET_BAUD_RATE, baud_value & 0xff, baud_value >> 8, baud_index, 0, 0, NULL, NULL);
+
297 }
+
298 
+
299 uint8_t FTDI::SetModemControl(uint16_t signal) {
+
300  return pUsb->ctrlReq(bAddress, 0, bmREQ_FTDI_OUT, FTDI_SIO_MODEM_CTRL, signal & 0xff, signal >> 8, 0, 0, 0, NULL, NULL);
+
301 }
+
302 
+
303 uint8_t FTDI::SetFlowControl(uint8_t protocol, uint8_t xon, uint8_t xoff) {
+
304  return pUsb->ctrlReq(bAddress, 0, bmREQ_FTDI_OUT, FTDI_SIO_SET_FLOW_CTRL, xon, xoff, protocol << 8, 0, 0, NULL, NULL);
+
305 }
+
306 
+
307 uint8_t FTDI::SetData(uint16_t databm) {
+
308  return pUsb->ctrlReq(bAddress, 0, bmREQ_FTDI_OUT, FTDI_SIO_SET_DATA, databm & 0xff, databm >> 8, 0, 0, 0, NULL, NULL);
+
309 }
+
310 
+
311 uint8_t FTDI::RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr) {
+
312  return pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, bytes_rcvd, dataptr);
+
313 }
+
314 
+
315 uint8_t FTDI::SndData(uint16_t nbytes, uint8_t *dataptr) {
+
316  return pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, nbytes, dataptr);
+
317 }
+
318 
+
319 void FTDI::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) {
+
320  Notify(PSTR("Endpoint descriptor:"), 0x80);
+
321  Notify(PSTR("\r\nLength:\t\t"), 0x80);
+
322  D_PrintHex<uint8_t > (ep_ptr->bLength, 0x80);
+
323  Notify(PSTR("\r\nType:\t\t"), 0x80);
+
324  D_PrintHex<uint8_t > (ep_ptr->bDescriptorType, 0x80);
+
325  Notify(PSTR("\r\nAddress:\t"), 0x80);
+
326  D_PrintHex<uint8_t > (ep_ptr->bEndpointAddress, 0x80);
+
327  Notify(PSTR("\r\nAttributes:\t"), 0x80);
+
328  D_PrintHex<uint8_t > (ep_ptr->bmAttributes, 0x80);
+
329  Notify(PSTR("\r\nMaxPktSize:\t"), 0x80);
+
330  D_PrintHex<uint16_t > (ep_ptr->wMaxPacketSize, 0x80);
+
331  Notify(PSTR("\r\nPoll Intrv:\t"), 0x80);
+
332  D_PrintHex<uint8_t > (ep_ptr->bInterval, 0x80);
+
333  Notify(PSTR("\r\n"), 0x80);
+
334 }
+
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:769
Definition: address.h:83
#define bmREQ_FTDI_OUT
Definition: cdcftdi.h:22
EpInfo * epinfo
Definition: address.h:76
-
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: cdcftdi.cpp:215
+
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: cdcftdi.cpp:210
bool lowspeed
Definition: address.h:79
-
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:81
-
uint8_t SetBaudRate(uint32_t baud)
Definition: cdcftdi.cpp:267
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
+
uint8_t SetBaudRate(uint32_t baud)
Definition: cdcftdi.cpp:262
uint8_t bmNakPower
Definition: address.h:42
#define FT232AM
Definition: cdcftdi.h:31
Definition: address.h:75
uint16_t bcdDevice
Definition: usb_ch9.h:108
-
uint8_t SetModemControl(uint16_t control)
Definition: cdcftdi.cpp:304
+
uint8_t SetModemControl(uint16_t control)
Definition: cdcftdi.cpp:299
uint16_t idVendor
Definition: usb_ch9.h:106
Definition: hexdump.h:25
#define FTDI_SIO_SET_BAUD_RATE
Definition: cdcftdi.h:40
@@ -452,55 +448,58 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
#define NotifyFail(...)
Definition: message.h:55
#define FTDI_SIO_SET_DATA
Definition: cdcftdi.h:41
-
uint8_t SetFlowControl(uint8_t protocol, uint8_t xon=0x11, uint8_t xoff=0x13)
Definition: cdcftdi.cpp:308
-
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:805
+
uint8_t SetFlowControl(uint8_t protocol, uint8_t xon=0x11, uint8_t xoff=0x13)
Definition: cdcftdi.cpp:303
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
Definition: cdcftdi.h:79
#define NotifyFailGetDevDescr(...)
Definition: message.h:50
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
-
uint8_t RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr)
Definition: cdcftdi.cpp:316
+
uint8_t RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr)
Definition: cdcftdi.cpp:311
virtual void FreeAddress(uint8_t addr)=0
uint8_t epAttribs
Definition: address.h:37
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
Definition: Usb.cpp:126
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
#define Notify(...)
Definition: message.h:44
uint8_t bmAttributes
Definition: usb_ch9.h:145
-
+
#define USBTRACE2(s, r)
Definition: macros.h:77
-
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:796
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
#define NotifyFailGetConfDescr(...)
Definition: message.h:52
uint8_t epAddr
Definition: address.h:33
#define USB_NAK_MAX_POWER
Definition: address.h:27
-
virtual uint8_t Poll()
Definition: cdcftdi.cpp:252
+
uint8_t Poll()
Definition: cdcftdi.cpp:247
Definition: address.h:32
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
Definition: Usb.cpp:292
uint16_t wMaxPacketSize
Definition: usb_ch9.h:146
#define FTDI_PID
Definition: cdcftdi.h:29
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcftdi.cpp:41
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcftdi.cpp:39
#define FTDI_SIO_SET_FLOW_CTRL
Definition: cdcftdi.h:39
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
uint8_t bEndpointAddress
Definition: usb_ch9.h:144
-
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:83
-
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
Definition: cdcftdi.cpp:320
+
virtual uint8_t OnInit(FTDI *pftdi)
Definition: cdcftdi.h:82
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
+
#define PSTR(str)
+
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
Definition: cdcftdi.cpp:315
uint8_t bDescriptorType
Definition: usb_ch9.h:143
-
virtual uint8_t OnInit(FTDI *pftdi)=0
-
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:80
+
#define USB_NAK_NOWAIT
Definition: address.h:29
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
+
virtual uint8_t OnRelease(FTDI *pftdi)
Definition: cdcftdi.h:85
#define FTDI_VID
Definition: cdcftdi.h:28
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
Definition: Usb.cpp:206
-
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:75
-
virtual uint8_t Release()
Definition: cdcftdi.cpp:242
+
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:77
+
uint8_t Release()
Definition: cdcftdi.cpp:237
uint16_t idProduct
Definition: usb_ch9.h:107
uint8_t bNumConfigurations
Definition: usb_ch9.h:112
-
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:78
+
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:80
#define FTDI_SIO_MODEM_CTRL
Definition: cdcftdi.h:38
uint8_t maxPktSize
Definition: address.h:34
-
AddressPool & GetAddressPool()
Definition: UsbCore.h:206
-
Definition: UsbCore.h:190
-
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:210
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
Definition: UsbCore.h:197
+
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
Definition: UsbCore.h:217
#define NotifyFailSetConfDescr(...)
Definition: message.h:53
-
uint8_t SetData(uint16_t databm)
Definition: cdcftdi.cpp:312
-
#define FTDI_MAX_ENDPOINTS
Definition: cdcftdi.h:87
+
uint8_t SetData(uint16_t databm)
Definition: cdcftdi.cpp:307
+
#define FTDI_MAX_ENDPOINTS
Definition: cdcftdi.h:92
#define USBTRACE(s)
Definition: macros.h:75
-
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:761
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:51
Definition: usb_ch9.h:98
@@ -508,7 +507,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/cdcftdi_8h.html b/cdcftdi_8h.html index 2a7ec6fd..d1246275 100644 --- a/cdcftdi_8h.html +++ b/cdcftdi_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcftdi.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -805,7 +806,7 @@ Macros
-

Definition at line 87 of file cdcftdi.h.

+

Definition at line 92 of file cdcftdi.h.

@@ -814,7 +815,7 @@ Macros diff --git a/cdcftdi_8h__dep__incl.md5 b/cdcftdi_8h__dep__incl.md5 index 400265fa..d2a73e5f 100644 --- a/cdcftdi_8h__dep__incl.md5 +++ b/cdcftdi_8h__dep__incl.md5 @@ -1 +1 @@ -6df33ccb134496caa17a0ccfb805cc20 \ No newline at end of file +bb94e7e9d10e1bde33f1040736fc690f \ No newline at end of file diff --git a/cdcftdi_8h__incl.md5 b/cdcftdi_8h__incl.md5 index a83f7eac..8f85634d 100644 --- a/cdcftdi_8h__incl.md5 +++ b/cdcftdi_8h__incl.md5 @@ -1 +1 @@ -7d34e76d8855698f6d76eca966d6ea18 \ No newline at end of file +5a325c73b89e2318a59e437a1ca1f735 \ No newline at end of file diff --git a/cdcftdi_8h_source.html b/cdcftdi_8h_source.html index 657af0ff..a74a5172 100644 --- a/cdcftdi_8h_source.html +++ b/cdcftdi_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcftdi.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -113,143 +114,157 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
22 #define bmREQ_FTDI_OUT 0x40
23 #define bmREQ_FTDI_IN 0xc0
24 
-
25 //#define bmREQ_FTDI_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
-
26 //#define bmREQ_FTDI_IN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
+
25 //#define bmREQ_FTDI_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
+
26 //#define bmREQ_FTDI_IN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
27 
-
28 #define FTDI_VID 0x0403 // FTDI VID
-
29 #define FTDI_PID 0x6001 // FTDI PID
+
28 #define FTDI_VID 0x0403 // FTDI VID
+
29 #define FTDI_PID 0x6001 // FTDI PID
30 
-
31 #define FT232AM 0x0200
-
32 #define FT232BM 0x0400
-
33 #define FT2232 0x0500
-
34 #define FT232R 0x0600
+
31 #define FT232AM 0x0200
+
32 #define FT232BM 0x0400
+
33 #define FT2232 0x0500
+
34 #define FT232R 0x0600
35 
36 // Commands
-
37 #define FTDI_SIO_RESET 0 /* Reset the port */
-
38 #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
-
39 #define FTDI_SIO_SET_FLOW_CTRL 2 /* Set flow control register */
-
40 #define FTDI_SIO_SET_BAUD_RATE 3 /* Set baud rate */
-
41 #define FTDI_SIO_SET_DATA 4 /* Set the data characteristics of the port */
-
42 #define FTDI_SIO_GET_MODEM_STATUS 5 /* Retrieve current value of modem status register */
-
43 #define FTDI_SIO_SET_EVENT_CHAR 6 /* Set the event character */
-
44 #define FTDI_SIO_SET_ERROR_CHAR 7 /* Set the error character */
+
37 #define FTDI_SIO_RESET 0 /* Reset the port */
+
38 #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
+
39 #define FTDI_SIO_SET_FLOW_CTRL 2 /* Set flow control register */
+
40 #define FTDI_SIO_SET_BAUD_RATE 3 /* Set baud rate */
+
41 #define FTDI_SIO_SET_DATA 4 /* Set the data characteristics of the port */
+
42 #define FTDI_SIO_GET_MODEM_STATUS 5 /* Retrieve current value of modem status register */
+
43 #define FTDI_SIO_SET_EVENT_CHAR 6 /* Set the event character */
+
44 #define FTDI_SIO_SET_ERROR_CHAR 7 /* Set the error character */
45 
-
46 #define FTDI_SIO_RESET_SIO 0
-
47 #define FTDI_SIO_RESET_PURGE_RX 1
-
48 #define FTDI_SIO_RESET_PURGE_TX 2
+
46 #define FTDI_SIO_RESET_SIO 0
+
47 #define FTDI_SIO_RESET_PURGE_RX 1
+
48 #define FTDI_SIO_RESET_PURGE_TX 2
49 
-
50 #define FTDI_SIO_SET_DATA_PARITY_NONE (0x0 << 8 )
-
51 #define FTDI_SIO_SET_DATA_PARITY_ODD (0x1 << 8 )
-
52 #define FTDI_SIO_SET_DATA_PARITY_EVEN (0x2 << 8 )
-
53 #define FTDI_SIO_SET_DATA_PARITY_MARK (0x3 << 8 )
-
54 #define FTDI_SIO_SET_DATA_PARITY_SPACE (0x4 << 8 )
-
55 #define FTDI_SIO_SET_DATA_STOP_BITS_1 (0x0 << 11)
-
56 #define FTDI_SIO_SET_DATA_STOP_BITS_15 (0x1 << 11)
-
57 #define FTDI_SIO_SET_DATA_STOP_BITS_2 (0x2 << 11)
-
58 #define FTDI_SIO_SET_BREAK (0x1 << 14)
+
50 #define FTDI_SIO_SET_DATA_PARITY_NONE (0x0 << 8 )
+
51 #define FTDI_SIO_SET_DATA_PARITY_ODD (0x1 << 8 )
+
52 #define FTDI_SIO_SET_DATA_PARITY_EVEN (0x2 << 8 )
+
53 #define FTDI_SIO_SET_DATA_PARITY_MARK (0x3 << 8 )
+
54 #define FTDI_SIO_SET_DATA_PARITY_SPACE (0x4 << 8 )
+
55 #define FTDI_SIO_SET_DATA_STOP_BITS_1 (0x0 << 11)
+
56 #define FTDI_SIO_SET_DATA_STOP_BITS_15 (0x1 << 11)
+
57 #define FTDI_SIO_SET_DATA_STOP_BITS_2 (0x2 << 11)
+
58 #define FTDI_SIO_SET_BREAK (0x1 << 14)
59 
-
60 #define FTDI_SIO_SET_DTR_MASK 0x1
-
61 #define FTDI_SIO_SET_DTR_HIGH ( 1 | ( FTDI_SIO_SET_DTR_MASK << 8))
-
62 #define FTDI_SIO_SET_DTR_LOW ( 0 | ( FTDI_SIO_SET_DTR_MASK << 8))
-
63 #define FTDI_SIO_SET_RTS_MASK 0x2
-
64 #define FTDI_SIO_SET_RTS_HIGH ( 2 | ( FTDI_SIO_SET_RTS_MASK << 8 ))
-
65 #define FTDI_SIO_SET_RTS_LOW ( 0 | ( FTDI_SIO_SET_RTS_MASK << 8 ))
+
60 #define FTDI_SIO_SET_DTR_MASK 0x1
+
61 #define FTDI_SIO_SET_DTR_HIGH ( 1 | ( FTDI_SIO_SET_DTR_MASK << 8))
+
62 #define FTDI_SIO_SET_DTR_LOW ( 0 | ( FTDI_SIO_SET_DTR_MASK << 8))
+
63 #define FTDI_SIO_SET_RTS_MASK 0x2
+
64 #define FTDI_SIO_SET_RTS_HIGH ( 2 | ( FTDI_SIO_SET_RTS_MASK << 8 ))
+
65 #define FTDI_SIO_SET_RTS_LOW ( 0 | ( FTDI_SIO_SET_RTS_MASK << 8 ))
66 
-
67 #define FTDI_SIO_DISABLE_FLOW_CTRL 0x0
-
68 #define FTDI_SIO_RTS_CTS_HS (0x1 << 8)
-
69 #define FTDI_SIO_DTR_DSR_HS (0x2 << 8)
-
70 #define FTDI_SIO_XON_XOFF_HS (0x4 << 8)
+
67 #define FTDI_SIO_DISABLE_FLOW_CTRL 0x0
+
68 #define FTDI_SIO_RTS_CTS_HS (0x1 << 8)
+
69 #define FTDI_SIO_DTR_DSR_HS (0x2 << 8)
+
70 #define FTDI_SIO_XON_XOFF_HS (0x4 << 8)
71 
-
72 #define FTDI_SIO_CTS_MASK 0x10
-
73 #define FTDI_SIO_DSR_MASK 0x20
-
74 #define FTDI_SIO_RI_MASK 0x40
-
75 #define FTDI_SIO_RLSD_MASK 0x80
+
72 #define FTDI_SIO_CTS_MASK 0x10
+
73 #define FTDI_SIO_DSR_MASK 0x20
+
74 #define FTDI_SIO_RI_MASK 0x40
+
75 #define FTDI_SIO_RLSD_MASK 0x80
76 
77 class FTDI;
78 
79 class FTDIAsyncOper {
80 public:
-
81  virtual uint8_t OnInit(FTDI *pftdi) = 0;
-
82 };
-
83 
+
81 
+
82  virtual uint8_t OnInit(FTDI *pftdi) {
+
83  };
84 
-
85 // Only single port chips are currently supported by the library,
-
86 // so only three endpoints are allocated.
-
87 #define FTDI_MAX_ENDPOINTS 3
+
85  virtual uint8_t OnRelease(FTDI *pftdi) {
+
86  };
+
87 };
88 
-
89 class FTDI : public USBDeviceConfig, public UsbConfigXtracter {
-
90  static const uint8_t epDataInIndex; // DataIn endpoint index
-
91  static const uint8_t epDataOutIndex; // DataOUT endpoint index
-
92  static const uint8_t epInterruptInIndex; // InterruptIN endpoint index
+
89 
+
90 // Only single port chips are currently supported by the library,
+
91 // so only three endpoints are allocated.
+
92 #define FTDI_MAX_ENDPOINTS 3
93 
-
94  FTDIAsyncOper *pAsync;
-
95  USB *pUsb;
-
96  uint8_t bAddress;
-
97  uint8_t bConfNum; // configuration number
-
98  uint8_t bNumIface; // number of interfaces in the configuration
-
99  uint8_t bNumEP; // total number of EP in the configuration
-
100  uint32_t qNextPollTime; // next poll time
-
101  bool bPollEnable; // poll enable flag
-
102  uint16_t wFTDIType; // Type of FTDI chip
-
103 
-
104  EpInfo epInfo[FTDI_MAX_ENDPOINTS];
-
105 
-
106  void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr);
-
107 
-
108 public:
-
109  FTDI(USB *pusb, FTDIAsyncOper *pasync);
+
94 class FTDI : public USBDeviceConfig, public UsbConfigXtracter {
+
95  static const uint8_t epDataInIndex; // DataIn endpoint index
+
96  static const uint8_t epDataOutIndex; // DataOUT endpoint index
+
97  static const uint8_t epInterruptInIndex; // InterruptIN endpoint index
+
98 
+
99  FTDIAsyncOper *pAsync;
+
100  USB *pUsb;
+
101  uint8_t bAddress;
+
102  uint8_t bConfNum; // configuration number
+
103  uint8_t bNumIface; // number of interfaces in the configuration
+
104  uint8_t bNumEP; // total number of EP in the configuration
+
105  uint32_t qNextPollTime; // next poll time
+
106  bool bPollEnable; // poll enable flag
+
107  uint16_t wFTDIType; // Type of FTDI chip
+
108 
+
109  EpInfo epInfo[FTDI_MAX_ENDPOINTS];
110 
-
111  uint8_t SetBaudRate(uint32_t baud);
-
112  uint8_t SetModemControl(uint16_t control);
-
113  uint8_t SetFlowControl(uint8_t protocol, uint8_t xon = 0x11, uint8_t xoff = 0x13);
-
114  uint8_t SetData(uint16_t databm);
+
111  void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr);
+
112 
+
113 public:
+
114  FTDI(USB *pusb, FTDIAsyncOper *pasync);
115 
-
116  // Methods for recieving and sending data
-
117  uint8_t RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr);
-
118  uint8_t SndData(uint16_t nbytes, uint8_t *dataptr);
-
119 
-
120  // USBDeviceConfig implementation
-
121  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
-
122  virtual uint8_t Release();
-
123  virtual uint8_t Poll();
+
116  uint8_t SetBaudRate(uint32_t baud);
+
117  uint8_t SetModemControl(uint16_t control);
+
118  uint8_t SetFlowControl(uint8_t protocol, uint8_t xon = 0x11, uint8_t xoff = 0x13);
+
119  uint8_t SetData(uint16_t databm);
+
120 
+
121  // Methods for recieving and sending data
+
122  uint8_t RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr);
+
123  uint8_t SndData(uint16_t nbytes, uint8_t *dataptr);
124 
-
125  virtual uint8_t GetAddress() {
-
126  return bAddress;
-
127  };
-
128 
-
129  // UsbConfigXtracter implementation
-
130  virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
-
131 };
-
132 
-
133 #endif // __CDCFTDI_H__
-
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: cdcftdi.cpp:215
-
uint8_t SetBaudRate(uint32_t baud)
Definition: cdcftdi.cpp:267
-
uint8_t SetModemControl(uint16_t control)
Definition: cdcftdi.cpp:304
+
125  // USBDeviceConfig implementation
+
126  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
+
127  uint8_t Release();
+
128  uint8_t Poll();
+
129 
+
130  virtual uint8_t GetAddress() {
+
131  return bAddress;
+
132  };
+
133 
+
134  // UsbConfigXtracter implementation
+
135  void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
+
136 
+
137  virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
+
138  return (vid == FTDI_VID && pid == FTDI_PID);
+
139  }
+
140 
+
141 };
+
142 
+
143 #endif // __CDCFTDI_H__
+
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)
Definition: cdcftdi.h:137
+
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
Definition: cdcftdi.cpp:210
+
uint8_t SetBaudRate(uint32_t baud)
Definition: cdcftdi.cpp:262
+
uint8_t SetModemControl(uint16_t control)
Definition: cdcftdi.cpp:299
Definition: usb_ch9.h:141
FTDI(USB *pusb, FTDIAsyncOper *pasync)
Definition: cdcftdi.cpp:23
-
uint8_t SetFlowControl(uint8_t protocol, uint8_t xon=0x11, uint8_t xoff=0x13)
Definition: cdcftdi.cpp:308
-
Definition: UsbCore.h:119
+
uint8_t SetFlowControl(uint8_t protocol, uint8_t xon=0x11, uint8_t xoff=0x13)
Definition: cdcftdi.cpp:303
+
Definition: UsbCore.h:121
Definition: cdcftdi.h:79
-
uint8_t RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr)
Definition: cdcftdi.cpp:316
-
virtual uint8_t Poll()
Definition: cdcftdi.cpp:252
+
uint8_t RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr)
Definition: cdcftdi.cpp:311
+
uint8_t Poll()
Definition: cdcftdi.cpp:247
Definition: address.h:32
-
Definition: cdcftdi.h:89
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcftdi.cpp:41
-
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
Definition: cdcftdi.cpp:320
-
virtual uint8_t GetAddress()
Definition: cdcftdi.h:125
+
Definition: cdcftdi.h:94
+
#define FTDI_PID
Definition: cdcftdi.h:29
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcftdi.cpp:39
+
virtual uint8_t OnInit(FTDI *pftdi)
Definition: cdcftdi.h:82
+
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
Definition: cdcftdi.cpp:315
+
virtual uint8_t GetAddress()
Definition: cdcftdi.h:130
-
virtual uint8_t OnInit(FTDI *pftdi)=0
-
virtual uint8_t Release()
Definition: cdcftdi.cpp:242
-
Definition: UsbCore.h:190
-
uint8_t SetData(uint16_t databm)
Definition: cdcftdi.cpp:312
-
#define FTDI_MAX_ENDPOINTS
Definition: cdcftdi.h:87
+
virtual uint8_t OnRelease(FTDI *pftdi)
Definition: cdcftdi.h:85
+
#define FTDI_VID
Definition: cdcftdi.h:28
+
uint8_t Release()
Definition: cdcftdi.cpp:237
+
Definition: UsbCore.h:197
+
uint8_t SetData(uint16_t databm)
Definition: cdcftdi.cpp:307
+
#define FTDI_MAX_ENDPOINTS
Definition: cdcftdi.h:92
diff --git a/cdcprolific_8cpp.html b/cdcprolific_8cpp.html index 5e5af464..19b9d676 100644 --- a/cdcprolific_8cpp.html +++ b/cdcprolific_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcprolific.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -104,7 +105,7 @@ Include dependency graph for cdcprolific.cpp:
diff --git a/cdcprolific_8cpp__incl.md5 b/cdcprolific_8cpp__incl.md5 index 44ce861d..1e1ab220 100644 --- a/cdcprolific_8cpp__incl.md5 +++ b/cdcprolific_8cpp__incl.md5 @@ -1 +1 @@ -1b82f3fbedb914a6f7a2686151967527 \ No newline at end of file +a91e5714ebd81502b745c96a64138390 \ No newline at end of file diff --git a/cdcprolific_8cpp_source.html b/cdcprolific_8cpp_source.html index 092a7bfc..31248a13 100644 --- a/cdcprolific_8cpp_source.html +++ b/cdcprolific_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcprolific.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -236,7 +237,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
145  if(rcode)
146  goto FailSetConfDescr;
147 
-
148  rcode = pAsync->OnInit(this);
+
148  rcode = pAsync->OnInit(this);
149 
150  if(rcode)
151  goto FailOnInit;
@@ -244,7 +245,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
153  USBTRACE("PL configured\r\n");
154 
155  //bPollEnable = true;
-
156  ready = true;
+
156  ready = true;
157  return 0;
158 
159 FailGetDevDescr:
@@ -286,69 +287,69 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
195 
196 //uint8_t PL::Poll()
197 //{
-
198 // uint8_t rcode = 0;
+
198 // uint8_t rcode = 0;
199 //
-
200 // //if (!bPollEnable)
-
201 // // return 0;
+
200 // //if (!bPollEnable)
+
201 // // return 0;
202 //
-
203 // //if (qNextPollTime <= millis())
-
204 // //{
-
205 // // USB_HOST_SERIAL.println(bAddress, HEX);
+
203 // //if (qNextPollTime <= millis())
+
204 // //{
+
205 // // USB_HOST_SERIAL.println(bAddress, HEX);
206 //
-
207 // // qNextPollTime = millis() + 100;
-
208 // //}
-
209 // return rcode;
+
207 // // qNextPollTime = millis() + 100;
+
208 // //}
+
209 // return rcode;
210 //}
-
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:766
+
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
Definition: Usb.cpp:769
Definition: address.h:83
EpInfo * epinfo
Definition: address.h:76
bool lowspeed
Definition: address.h:79
-
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:81
+
#define USB_ERROR_EPINFO_IS_NULL
Definition: UsbCore.h:83
+
virtual uint8_t OnInit(ACM *pacm)
Definition: cdcacm.h:131
Definition: address.h:75
uint16_t bcdDevice
Definition: usb_ch9.h:108
#define PL_PID
Definition: cdcprolific.h:23
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcprolific.cpp:24
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcprolific.cpp:24
uint16_t idVendor
Definition: usb_ch9.h:106
PL2303(USB *pusb, CDCAsyncOper *pasync)
Definition: cdcprolific.cpp:19
Definition: hexdump.h:25
uint8_t bMaxPacketSize0
Definition: usb_ch9.h:105
-
bool ready
Definition: cdcacm.h:153
+
volatile bool ready
Definition: cdcacm.h:178
#define NotifyFail(...)
Definition: message.h:55
-
USB * pUsb
Definition: cdcacm.h:144
-
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:805
-
uint8_t bNumEP
Definition: cdcacm.h:150
-
EpInfo epInfo[ACM_MAX_ENDPOINTS]
Definition: cdcacm.h:155
+
USB * pUsb
Definition: cdcacm.h:169
+
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
Definition: Usb.cpp:808
+
uint8_t bNumEP
Definition: cdcacm.h:175
+
EpInfo epInfo[ACM_MAX_ENDPOINTS]
Definition: cdcacm.h:181
#define NotifyFailGetDevDescr(...)
Definition: message.h:50
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
Definition: Usb.cpp:64
virtual void FreeAddress(uint8_t addr)=0
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
-
CDCAsyncOper * pAsync
Definition: cdcacm.h:145
-
+
CDCAsyncOper * pAsync
Definition: cdcacm.h:170
+
#define USBTRACE2(s, r)
Definition: macros.h:77
-
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:796
+
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
Definition: Usb.cpp:799
#define NotifyFailGetConfDescr(...)
Definition: message.h:52
Definition: address.h:32
#define PL_VID
Definition: cdcprolific.h:22
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
-
uint8_t bAddress
Definition: cdcacm.h:146
-
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:83
-
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:80
+
uint8_t bAddress
Definition: cdcacm.h:171
+
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
Definition: UsbCore.h:85
+
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
Definition: UsbCore.h:82
Definition: cdcacm.h:128
-
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:75
+
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
Definition: UsbCore.h:77
uint16_t idProduct
Definition: usb_ch9.h:107
-
virtual uint8_t Release()
Definition: cdcacm.cpp:251
-
uint8_t bConfNum
Definition: cdcacm.h:147
+
uint8_t Release()
Definition: cdcacm.cpp:257
+
uint8_t bConfNum
Definition: cdcacm.h:172
uint8_t bNumConfigurations
Definition: usb_ch9.h:112
-
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:78
-
virtual uint8_t OnInit(ACM *pacm)=0
+
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
Definition: UsbCore.h:80
uint8_t maxPktSize
Definition: address.h:34
-
AddressPool & GetAddressPool()
Definition: UsbCore.h:206
-
Definition: UsbCore.h:190
-
Definition: cdcacm.h:138
+
AddressPool & GetAddressPool()
Definition: UsbCore.h:213
+
Definition: UsbCore.h:197
+
Definition: cdcacm.h:163
#define NotifyFailSetConfDescr(...)
Definition: message.h:53
#define USBTRACE(s)
Definition: macros.h:75
-
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:761
+
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
Definition: Usb.cpp:764
#define NotifyFailSetDevTblEntry(...)
Definition: message.h:51
Definition: usb_ch9.h:98
@@ -356,7 +357,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/cdcprolific_8h.html b/cdcprolific_8h.html index 3749bd30..1c73a705 100644 --- a/cdcprolific_8h.html +++ b/cdcprolific_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcprolific.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -677,7 +678,7 @@ Enumerations
-

Definition at line 68 of file cdcprolific.h.

+

Definition at line 60 of file cdcprolific.h.

@@ -691,7 +692,7 @@ Enumerations
-

Definition at line 69 of file cdcprolific.h.

+

Definition at line 61 of file cdcprolific.h.

@@ -705,7 +706,7 @@ Enumerations
-

Definition at line 70 of file cdcprolific.h.

+

Definition at line 62 of file cdcprolific.h.

@@ -719,7 +720,7 @@ Enumerations
-

Definition at line 71 of file cdcprolific.h.

+

Definition at line 63 of file cdcprolific.h.

@@ -733,7 +734,7 @@ Enumerations
-

Definition at line 72 of file cdcprolific.h.

+

Definition at line 64 of file cdcprolific.h.

@@ -747,7 +748,7 @@ Enumerations
-

Definition at line 74 of file cdcprolific.h.

+

Definition at line 66 of file cdcprolific.h.

@@ -761,7 +762,7 @@ Enumerations
-

Definition at line 75 of file cdcprolific.h.

+

Definition at line 67 of file cdcprolific.h.

@@ -775,7 +776,7 @@ Enumerations
-

Definition at line 76 of file cdcprolific.h.

+

Definition at line 68 of file cdcprolific.h.

@@ -789,7 +790,7 @@ Enumerations
-

Definition at line 77 of file cdcprolific.h.

+

Definition at line 69 of file cdcprolific.h.

@@ -803,7 +804,7 @@ Enumerations
-

Definition at line 78 of file cdcprolific.h.

+

Definition at line 70 of file cdcprolific.h.

@@ -817,7 +818,7 @@ Enumerations
-

Definition at line 80 of file cdcprolific.h.

+

Definition at line 72 of file cdcprolific.h.

@@ -831,7 +832,7 @@ Enumerations
-

Definition at line 81 of file cdcprolific.h.

+

Definition at line 73 of file cdcprolific.h.

@@ -845,7 +846,7 @@ Enumerations
-

Definition at line 83 of file cdcprolific.h.

+

Definition at line 75 of file cdcprolific.h.

@@ -859,7 +860,7 @@ Enumerations
-

Definition at line 84 of file cdcprolific.h.

+

Definition at line 76 of file cdcprolific.h.

@@ -873,7 +874,7 @@ Enumerations
-

Definition at line 87 of file cdcprolific.h.

+

Definition at line 79 of file cdcprolific.h.

@@ -887,7 +888,7 @@ Enumerations
-

Definition at line 88 of file cdcprolific.h.

+

Definition at line 80 of file cdcprolific.h.

@@ -901,7 +902,7 @@ Enumerations
-

Definition at line 89 of file cdcprolific.h.

+

Definition at line 81 of file cdcprolific.h.

@@ -915,7 +916,7 @@ Enumerations
-

Definition at line 90 of file cdcprolific.h.

+

Definition at line 82 of file cdcprolific.h.

@@ -929,7 +930,7 @@ Enumerations
-

Definition at line 91 of file cdcprolific.h.

+

Definition at line 83 of file cdcprolific.h.

@@ -943,7 +944,7 @@ Enumerations
-

Definition at line 93 of file cdcprolific.h.

+

Definition at line 85 of file cdcprolific.h.

@@ -957,7 +958,7 @@ Enumerations
-

Definition at line 94 of file cdcprolific.h.

+

Definition at line 86 of file cdcprolific.h.

@@ -971,7 +972,7 @@ Enumerations
-

Definition at line 95 of file cdcprolific.h.

+

Definition at line 87 of file cdcprolific.h.

@@ -985,7 +986,7 @@ Enumerations
-

Definition at line 96 of file cdcprolific.h.

+

Definition at line 88 of file cdcprolific.h.

@@ -999,7 +1000,7 @@ Enumerations
-

Definition at line 98 of file cdcprolific.h.

+

Definition at line 90 of file cdcprolific.h.

@@ -1013,7 +1014,7 @@ Enumerations
-

Definition at line 99 of file cdcprolific.h.

+

Definition at line 91 of file cdcprolific.h.

@@ -1027,7 +1028,7 @@ Enumerations
-

Definition at line 100 of file cdcprolific.h.

+

Definition at line 92 of file cdcprolific.h.

@@ -1041,7 +1042,7 @@ Enumerations
-

Definition at line 101 of file cdcprolific.h.

+

Definition at line 93 of file cdcprolific.h.

@@ -1055,7 +1056,7 @@ Enumerations
-

Definition at line 104 of file cdcprolific.h.

+

Definition at line 96 of file cdcprolific.h.

@@ -1069,7 +1070,7 @@ Enumerations
-

Definition at line 105 of file cdcprolific.h.

+

Definition at line 97 of file cdcprolific.h.

@@ -1083,7 +1084,7 @@ Enumerations
-

Definition at line 116 of file cdcprolific.h.

+

Definition at line 100 of file cdcprolific.h.

@@ -1110,7 +1111,7 @@ Enumerations -

Definition at line 60 of file cdcprolific.h.

+

Definition at line 102 of file cdcprolific.h.

@@ -1136,7 +1137,7 @@ Enumerations -

Definition at line 107 of file cdcprolific.h.

+

Definition at line 110 of file cdcprolific.h.

@@ -1145,7 +1146,7 @@ Enumerations diff --git a/cdcprolific_8h__dep__incl.md5 b/cdcprolific_8h__dep__incl.md5 index 6e869c59..3f648651 100644 --- a/cdcprolific_8h__dep__incl.md5 +++ b/cdcprolific_8h__dep__incl.md5 @@ -1 +1 @@ -7e1c0310ccf8e65031fd95168f61528c \ No newline at end of file +5601c68c5c5e913b421194d3f765f64d \ No newline at end of file diff --git a/cdcprolific_8h__incl.md5 b/cdcprolific_8h__incl.md5 index 4016e2b7..e7519a47 100644 --- a/cdcprolific_8h__incl.md5 +++ b/cdcprolific_8h__incl.md5 @@ -1 +1 @@ -e26e4be2e6b8e7c00195ad3f65bee601 \ No newline at end of file +9d9a09dd605ff7c3be8e192a907ecbfe \ No newline at end of file diff --git a/cdcprolific_8h_source.html b/cdcprolific_8h_source.html index 150d8dc1..ccb28001 100644 --- a/cdcprolific_8h_source.html +++ b/cdcprolific_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: cdcprolific.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -113,140 +114,141 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
22 #define PL_VID 0x067B
23 #define PL_PID ( 0x2303 || 0x0609 )
24 
-
25 //#define PL_PID 0x0609
+
25 //#define PL_PID 0x0609
26 
27 #define PROLIFIC_REV_H 0x0202
28 #define PROLIFIC_REV_X 0x0300
29 #define PROLIFIC_REV_HX_CHIP_D 0x0400
30 #define PROLIFIC_REV_1 0x0001
31 
-
32 #define kXOnChar '\x11'
-
33 #define kXOffChar '\x13'
+
32 #define kXOnChar '\x11'
+
33 #define kXOffChar '\x13'
34 
-
35 #define SPECIAL_SHIFT (5)
-
36 #define SPECIAL_MASK ((1<<SPECIAL_SHIFT) - 1)
-
37 #define STATE_ALL ( PD_RS232_S_MASK | PD_S_MASK )
-
38 #define FLOW_RX_AUTO ( PD_RS232_A_RFR | PD_RS232_A_DTR | PD_RS232_A_RXO )
-
39 #define FLOW_TX_AUTO ( PD_RS232_A_CTS | PD_RS232_A_DSR | PD_RS232_A_TXO | PD_RS232_A_DCD )
-
40 #define CAN_BE_AUTO ( FLOW_RX_AUTO | FLOW_TX_AUTO )
-
41 #define CAN_NOTIFY ( PD_RS232_N_MASK )
-
42 #define EXTERNAL_MASK ( PD_S_MASK | (PD_RS232_S_MASK & ~PD_RS232_S_LOOP) )
-
43 #define INTERNAL_DELAY ( PD_RS232_S_LOOP )
-
44 #define DEFAULT_AUTO ( PD_RS232_A_DTR | PD_RS232_A_RFR | PD_RS232_A_CTS | PD_RS232_A_DSR )
-
45 #define DEFAULT_NOTIFY 0x00
-
46 #define DEFAULT_STATE ( PD_S_TX_ENABLE | PD_S_RX_ENABLE | PD_RS232_A_TXO | PD_RS232_A_RXO )
+
35 #define SPECIAL_SHIFT (5)
+
36 #define SPECIAL_MASK ((1<<SPECIAL_SHIFT) - 1)
+
37 #define STATE_ALL ( PD_RS232_S_MASK | PD_S_MASK )
+
38 #define FLOW_RX_AUTO ( PD_RS232_A_RFR | PD_RS232_A_DTR | PD_RS232_A_RXO )
+
39 #define FLOW_TX_AUTO ( PD_RS232_A_CTS | PD_RS232_A_DSR | PD_RS232_A_TXO | PD_RS232_A_DCD )
+
40 #define CAN_BE_AUTO ( FLOW_RX_AUTO | FLOW_TX_AUTO )
+
41 #define CAN_NOTIFY ( PD_RS232_N_MASK )
+
42 #define EXTERNAL_MASK ( PD_S_MASK | (PD_RS232_S_MASK & ~PD_RS232_S_LOOP) )
+
43 #define INTERNAL_DELAY ( PD_RS232_S_LOOP )
+
44 #define DEFAULT_AUTO ( PD_RS232_A_DTR | PD_RS232_A_RFR | PD_RS232_A_CTS | PD_RS232_A_DSR )
+
45 #define DEFAULT_NOTIFY 0x00
+
46 #define DEFAULT_STATE ( PD_S_TX_ENABLE | PD_S_RX_ENABLE | PD_RS232_A_TXO | PD_RS232_A_RXO )
47 
48 #define CONTINUE_SEND 1
49 #define PAUSE_SEND 2
50 
-
51 #define kRxAutoFlow ((UInt32)( PD_RS232_A_RFR | PD_RS232_A_DTR | PD_RS232_A_RXO ))
-
52 #define kTxAutoFlow ((UInt32)( PD_RS232_A_CTS | PD_RS232_A_DSR | PD_RS232_A_TXO | PD_RS232_A_DCD ))
-
53 #define kControl_StateMask ((UInt32)( PD_RS232_S_CTS | PD_RS232_S_DSR | PD_RS232_S_CAR | PD_RS232_S_RI ))
-
54 #define kRxQueueState ((UInt32)( PD_S_RXQ_EMPTY | PD_S_RXQ_LOW_WATER | PD_S_RXQ_HIGH_WATER | PD_S_RXQ_FULL ))
-
55 #define kTxQueueState ((UInt32)( PD_S_TXQ_EMPTY | PD_S_TXQ_LOW_WATER | PD_S_TXQ_HIGH_WATER | PD_S_TXQ_FULL ))
+
51 #define kRxAutoFlow ((UInt32)( PD_RS232_A_RFR | PD_RS232_A_DTR | PD_RS232_A_RXO ))
+
52 #define kTxAutoFlow ((UInt32)( PD_RS232_A_CTS | PD_RS232_A_DSR | PD_RS232_A_TXO | PD_RS232_A_DCD ))
+
53 #define kControl_StateMask ((UInt32)( PD_RS232_S_CTS | PD_RS232_S_DSR | PD_RS232_S_CAR | PD_RS232_S_RI ))
+
54 #define kRxQueueState ((UInt32)( PD_S_RXQ_EMPTY | PD_S_RXQ_LOW_WATER | PD_S_RXQ_HIGH_WATER | PD_S_RXQ_FULL ))
+
55 #define kTxQueueState ((UInt32)( PD_S_TXQ_EMPTY | PD_S_TXQ_LOW_WATER | PD_S_TXQ_HIGH_WATER | PD_S_TXQ_FULL ))
56 
57 #define kCONTROL_DTR 0x01
58 #define kCONTROL_RTS 0x02
59 
-
60 enum tXO_State {
-
61  kXOnSent = -2,
-
62  kXOffSent = -1,
-
63  kXO_Idle = 0,
-
64  kXOffNeeded = 1,
-
65  kXOnNeeded = 2
-
66 };
-
67 
-
68 #define kStateTransientMask 0x74
-
69 #define kBreakError 0x04
-
70 #define kFrameError 0x10
-
71 #define kParityError 0x20
-
72 #define kOverrunError 0x40
-
73 
-
74 #define kCTS 0x80
-
75 #define kDSR 0x02
-
76 #define kRI 0x08
-
77 #define kDCD 0x01
-
78 #define kHandshakeInMask ((UInt32)( PD_RS232_S_CTS | PD_RS232_S_DSR | PD_RS232_S_CAR | PD_RS232_S_RI ))
-
79 
-
80 #define VENDOR_WRITE_REQUEST_TYPE 0x40
-
81 #define VENDOR_WRITE_REQUEST 0x01
-
82 
-
83 #define VENDOR_READ_REQUEST_TYPE 0xc0
-
84 #define VENDOR_READ_REQUEST 0x01
-
85 
-
86 // Device Configuration Registers (DCR0, DCR1, DCR2)
-
87 #define SET_DCR0 0x00
-
88 #define GET_DCR0 0x80
-
89 #define DCR0_INIT 0x01
-
90 #define DCR0_INIT_H 0x41
-
91 #define DCR0_INIT_X 0x61
-
92 
-
93 #define SET_DCR1 0x01
-
94 #define GET_DCR1 0x81
-
95 #define DCR1_INIT_H 0x80
-
96 #define DCR1_INIT_X 0x00
-
97 
-
98 #define SET_DCR2 0x02
-
99 #define GET_DCR2 0x82
-
100 #define DCR2_INIT_H 0x24
-
101 #define DCR2_INIT_X 0x44
-
102 
-
103 // On-chip Data Buffers:
-
104 #define RESET_DOWNSTREAM_DATA_PIPE 0x08
-
105 #define RESET_UPSTREAM_DATA_PIPE 0x09
-
106 
-
107 enum pl2303_type {
-
108  unknown,
-
109  type_1, /* don't know the difference between type 0 and */
-
110  rev_X, /* type 1, until someone from prolific tells us... */
-
111  rev_HX, /* HX version of the pl2303 chip */
-
112  rev_H
-
113 };
-
114 
-
115 
-
116 #define PL_MAX_ENDPOINTS 4
+
60 #define kStateTransientMask 0x74
+
61 #define kBreakError 0x04
+
62 #define kFrameError 0x10
+
63 #define kParityError 0x20
+
64 #define kOverrunError 0x40
+
65 
+
66 #define kCTS 0x80
+
67 #define kDSR 0x02
+
68 #define kRI 0x08
+
69 #define kDCD 0x01
+
70 #define kHandshakeInMask ((UInt32)( PD_RS232_S_CTS | PD_RS232_S_DSR | PD_RS232_S_CAR | PD_RS232_S_RI ))
+
71 
+
72 #define VENDOR_WRITE_REQUEST_TYPE 0x40
+
73 #define VENDOR_WRITE_REQUEST 0x01
+
74 
+
75 #define VENDOR_READ_REQUEST_TYPE 0xc0
+
76 #define VENDOR_READ_REQUEST 0x01
+
77 
+
78 // Device Configuration Registers (DCR0, DCR1, DCR2)
+
79 #define SET_DCR0 0x00
+
80 #define GET_DCR0 0x80
+
81 #define DCR0_INIT 0x01
+
82 #define DCR0_INIT_H 0x41
+
83 #define DCR0_INIT_X 0x61
+
84 
+
85 #define SET_DCR1 0x01
+
86 #define GET_DCR1 0x81
+
87 #define DCR1_INIT_H 0x80
+
88 #define DCR1_INIT_X 0x00
+
89 
+
90 #define SET_DCR2 0x02
+
91 #define GET_DCR2 0x82
+
92 #define DCR2_INIT_H 0x24
+
93 #define DCR2_INIT_X 0x44
+
94 
+
95 // On-chip Data Buffers:
+
96 #define RESET_DOWNSTREAM_DATA_PIPE 0x08
+
97 #define RESET_UPSTREAM_DATA_PIPE 0x09
+
98 
+
99 
+
100 #define PL_MAX_ENDPOINTS 4
+
101 
+
102 enum tXO_State {
+
103  kXOnSent = -2,
+
104  kXOffSent = -1,
+
105  kXO_Idle = 0,
+
106  kXOffNeeded = 1,
+
107  kXOnNeeded = 2
+
108 };
+
109 
+
110 enum pl2303_type {
+
111  unknown,
+
112  type_1, /* don't know the difference between type 0 and */
+
113  rev_X, /* type 1, until someone from prolific tells us... */
+
114  rev_HX, /* HX version of the pl2303 chip */
+
115  rev_H
+
116 };
117 
-
118 class PL2303 : public ACM {
-
119  uint16_t wPLType; // Type of chip
-
120 
-
121 public:
-
122  PL2303(USB *pusb, CDCAsyncOper *pasync);
-
123 
-
124  // USBDeviceConfig implementation
-
125  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
-
126  //virtual uint8_t Release();
-
127  //virtual uint8_t Poll();
-
128  //virtual uint8_t GetAddress() { return bAddress; };
-
129 
-
131  //virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
-
132 };
-
133 
-
134 #endif // __CDCPROLIFIC_H__
-
Definition: cdcprolific.h:109
-
Definition: cdcprolific.h:61
-
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcprolific.cpp:24
+
118 
+
119 class PL2303 : public ACM {
+
120  uint16_t wPLType; // Type of chip
+
121 
+
122 public:
+
123  PL2303(USB *pusb, CDCAsyncOper *pasync);
+
124 
+
125  // USBDeviceConfig implementation
+
126  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
+
127  //virtual uint8_t Release();
+
128  //virtual uint8_t Poll();
+
129  //virtual uint8_t GetAddress() { return bAddress; };
+
130 
+
132  //virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
+
133 };
+
134 
+
135 #endif // __CDCPROLIFIC_H__
+
Definition: cdcprolific.h:112
+
Definition: cdcprolific.h:103
+
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
Definition: cdcprolific.cpp:24
PL2303(USB *pusb, CDCAsyncOper *pasync)
Definition: cdcprolific.cpp:19
-
Definition: cdcprolific.h:110
-
tXO_State
Definition: cdcprolific.h:60
-
Definition: cdcprolific.h:64
-
Definition: cdcprolific.h:62
-
Definition: cdcprolific.h:111
-
Definition: cdcprolific.h:108
-
Definition: cdcprolific.h:112
-
Definition: cdcprolific.h:65
-
pl2303_type
Definition: cdcprolific.h:107
+
Definition: cdcprolific.h:113
+
tXO_State
Definition: cdcprolific.h:102
+
Definition: cdcprolific.h:106
+
Definition: cdcprolific.h:104
+
Definition: cdcprolific.h:114
+
Definition: cdcprolific.h:111
+
Definition: cdcprolific.h:115
+
Definition: cdcprolific.h:107
+
pl2303_type
Definition: cdcprolific.h:110
Definition: cdcacm.h:128
-
Definition: cdcprolific.h:118
-
Definition: cdcprolific.h:63
-
Definition: UsbCore.h:190
-
Definition: cdcacm.h:138
+
Definition: cdcprolific.h:119
+
Definition: cdcprolific.h:105
+
Definition: UsbCore.h:197
+
Definition: cdcacm.h:163
diff --git a/class_a_c_m-members.html b/class_a_c_m-members.html index af1245dc..c889dc66 100644 --- a/class_a_c_m-members.html +++ b/class_a_c_m-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -90,17 +91,25 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

This is the complete list of members for ACM, including all inherited members.

- - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -109,29 +118,31 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +
ACM(USB *pusb, CDCAsyncOper *pasync)ACM
bAddressACMprotected
bConfNumACMprotected
bControlIfaceACMprotected
bDataIfaceACMprotected
bNumEPACMprotected
bPollEnableACMprotected
ClearCommFeature(uint16_t fid)ACM
ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual
DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual
_enhanced_statusACMprotected
ACM(USB *pusb, CDCAsyncOper *pasync)ACM
autoflowDSR(bool s)ACMinlinevirtual
autoflowRTS(bool s)ACMinlinevirtual
autoflowXON(bool s)ACMinlinevirtual
available(void)ACMinline
bAddressACMprotected
bConfNumACMprotected
bControlIfaceACMprotected
bDataIfaceACMprotected
bNumEPACMprotected
bPollEnableACMprotected
ClearCommFeature(uint16_t fid)ACM
ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual
DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual
DEVSUBCLASSOK(uint8_t subklass)USBDeviceConfiginlinevirtual
EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)ACMvirtual
enhanced_features(void)ACMinlinevirtual
enhanced_status(void)ACMinlinevirtual
epDataInIndexACMprotectedstatic
epDataOutIndexACMprotectedstatic
epInfoACMprotected
GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)ACM
GetLineCoding(LINE_CODING *dataptr)ACM
GetNotif(uint16_t *bytes_rcvd, uint8_t *dataptr)ACM
Init(uint8_t parent, uint8_t port, bool lowspeed)ACMvirtual
isReady()ACMinlinevirtual
pAsyncACMprotected
Poll()ACMvirtual
PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)ACMprotected
pUsbACMprotected
qNextPollTimeACMprotected
RcvData(uint16_t *nbytesptr, uint8_t *dataptr)ACM
readyACMprotected
Release()ACMvirtual
ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual
SendBreak(uint16_t duration)ACM
SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)ACM
SetControlLineState(uint8_t state)ACM
SetLineCoding(const LINE_CODING *dataptr)ACM
SndData(uint16_t nbytes, uint8_t *dataptr)ACM
VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual
half_duplex(bool s)ACMinlinevirtual
Init(uint8_t parent, uint8_t port, bool lowspeed)ACMvirtual
isReady()ACMinlinevirtual
pAsyncACMprotected
Poll()ACMvirtual
PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)ACMprotected
pUsbACMprotected
qNextPollTimeACMprotected
RcvData(uint16_t *nbytesptr, uint8_t *dataptr)ACM
readyACMprotected
Release()ACMvirtual
ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual
SendBreak(uint16_t duration)ACM
SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)ACM
SetControlLineState(uint8_t state)ACM
SetLineCoding(const LINE_CODING *dataptr)ACM
SndData(uint16_t nbytes, uint8_t *dataptr)ACM
VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual
wide(bool s)ACMinlinevirtual
diff --git a/class_a_c_m.html b/class_a_c_m.html index 217e95dd..bc36a52d 100644 --- a/class_a_c_m.html +++ b/class_a_c_m.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: ACM Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -100,14 +101,14 @@ Inheritance diagram for ACM:
Inheritance graph
- +
[legend]
Collaboration diagram for ACM:
Collaboration graph
- +
[legend]
- + - + - + + + - + + + + + + + + + + + + + + + - - - - + + + + + +

@@ -134,27 +135,45 @@ Public Member Functions

 
uint8_t SndData (uint16_t nbytes, uint8_t *dataptr)
 
virtual uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)
uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)
 
virtual uint8_t Release ()
uint8_t Release ()
 
virtual uint8_t Poll ()
uint8_t Poll ()
 
bool available (void)
 
virtual uint8_t GetAddress ()
 
virtual bool isReady ()
 
virtual void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
virtual tty_features enhanced_status (void)
 
virtual tty_features enhanced_features (void)
 
virtual void autoflowRTS (bool s)
 
virtual void autoflowDSR (bool s)
 
virtual void autoflowXON (bool s)
 
virtual void half_duplex (bool s)
 
virtual void wide (bool s)
 
void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
 
- Public Member Functions inherited from USBDeviceConfig
virtual uint8_t ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed)
 
virtual void ResetHubPort (uint8_t port)
 
virtual boolean VIDPIDOK (uint16_t vid, uint16_t pid)
 
virtual boolean DEVCLASSOK (uint8_t klass)
 
virtual bool VIDPIDOK (uint16_t vid, uint16_t pid)
 
virtual bool DEVCLASSOK (uint8_t klass)
 
virtual bool DEVSUBCLASSOK (uint8_t subklass)
 
@@ -179,10 +198,12 @@ Protected Attributes - - - - + + + + + +

Protected Member Functions

 
uint32_t qNextPollTime
 
bool bPollEnable
 
bool ready
 
volatile bool bPollEnable
 
volatile bool ready
 
tty_features _enhanced_status
 
EpInfo epInfo [ACM_MAX_ENDPOINTS]
 
@@ -197,7 +218,7 @@ Static Protected Attributes

Detailed Description

-

Definition at line 138 of file cdcacm.h.

+

Definition at line 163 of file cdcacm.h.

Constructor & Destructor Documentation

@@ -250,7 +271,7 @@ Static Protected Attributes
-

Definition at line 336 of file cdcacm.cpp.

+

Definition at line 316 of file cdcacm.cpp.

@@ -284,7 +305,7 @@ Static Protected Attributes
-

Definition at line 308 of file cdcacm.cpp.

+

Definition at line 288 of file cdcacm.cpp.

@@ -318,7 +339,7 @@ Static Protected Attributes
-

Definition at line 312 of file cdcacm.cpp.

+

Definition at line 292 of file cdcacm.cpp.

@@ -336,7 +357,7 @@ Static Protected Attributes
-

Definition at line 316 of file cdcacm.cpp.

+

Definition at line 296 of file cdcacm.cpp.

@@ -354,7 +375,7 @@ Static Protected Attributes
-

Definition at line 320 of file cdcacm.cpp.

+

Definition at line 300 of file cdcacm.cpp.

@@ -372,7 +393,7 @@ Static Protected Attributes
-

Definition at line 324 of file cdcacm.cpp.

+

Definition at line 304 of file cdcacm.cpp.

@@ -390,7 +411,7 @@ Static Protected Attributes
-

Definition at line 328 of file cdcacm.cpp.

+

Definition at line 308 of file cdcacm.cpp.

@@ -408,7 +429,7 @@ Static Protected Attributes
-

Definition at line 332 of file cdcacm.cpp.

+

Definition at line 312 of file cdcacm.cpp.

@@ -462,7 +483,7 @@ Static Protected Attributes
-

Definition at line 300 of file cdcacm.cpp.

+

Definition at line 280 of file cdcacm.cpp.

@@ -490,7 +511,7 @@ Static Protected Attributes
-

Definition at line 304 of file cdcacm.cpp.

+

Definition at line 284 of file cdcacm.cpp.

@@ -536,7 +557,7 @@ Static Protected Attributes

Reimplemented in PL2303.

-

Definition at line 47 of file cdcacm.cpp.

+

Definition at line 45 of file cdcacm.cpp.

@@ -563,7 +584,7 @@ Static Protected Attributes

Reimplemented from USBDeviceConfig.

-

Definition at line 251 of file cdcacm.cpp.

+

Definition at line 257 of file cdcacm.cpp.

@@ -590,7 +611,33 @@ Static Protected Attributes

Reimplemented from USBDeviceConfig.

-

Definition at line 264 of file cdcacm.cpp.

+

Definition at line 271 of file cdcacm.cpp.

+ + + + +
+
+ + + + + +
+ + + + + + + + +
bool ACM::available (void )
+
+inline
+
+ +

Definition at line 206 of file cdcacm.h.

@@ -617,7 +664,7 @@ Static Protected Attributes

Reimplemented from USBDeviceConfig.

-

Definition at line 180 of file cdcacm.h.

+

Definition at line 210 of file cdcacm.h.

@@ -642,7 +689,199 @@ Static Protected Attributes
-

Definition at line 184 of file cdcacm.h.

+

Definition at line 214 of file cdcacm.h.

+ +
+ + +
+
+ + + + + +
+ + + + + + + + +
virtual tty_features ACM::enhanced_status (void )
+
+inlinevirtual
+
+ +

Definition at line 218 of file cdcacm.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual tty_features ACM::enhanced_features (void )
+
+inlinevirtual
+
+ +

Reimplemented in XR21B1411.

+ +

Definition at line 222 of file cdcacm.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual void ACM::autoflowRTS (bool s)
+
+inlinevirtual
+
+ +

Reimplemented in XR21B1411.

+ +

Definition at line 233 of file cdcacm.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual void ACM::autoflowDSR (bool s)
+
+inlinevirtual
+
+ +

Reimplemented in XR21B1411.

+ +

Definition at line 236 of file cdcacm.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual void ACM::autoflowXON (bool s)
+
+inlinevirtual
+
+ +

Reimplemented in XR21B1411.

+ +

Definition at line 239 of file cdcacm.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual void ACM::half_duplex (bool s)
+
+inlinevirtual
+
+ +

Reimplemented in XR21B1411.

+ +

Definition at line 242 of file cdcacm.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual void ACM::wide (bool s)
+
+inlinevirtual
+
+ +

Definition at line 245 of file cdcacm.h.

@@ -696,9 +935,9 @@ Static Protected Attributes
-

Implements UsbConfigXtracter.

+

Reimplemented from UsbConfigXtracter.

-

Definition at line 224 of file cdcacm.cpp.

+

Definition at line 230 of file cdcacm.cpp.

@@ -721,7 +960,7 @@ Static Protected Attributes
-

Definition at line 140 of file cdcacm.h.

+

Definition at line 165 of file cdcacm.h.

@@ -743,7 +982,7 @@ Static Protected Attributes
-

Definition at line 141 of file cdcacm.h.

+

Definition at line 166 of file cdcacm.h.

@@ -765,7 +1004,7 @@ Static Protected Attributes
-

Definition at line 142 of file cdcacm.h.

+

Definition at line 167 of file cdcacm.h.

@@ -787,7 +1026,7 @@ Static Protected Attributes
-

Definition at line 144 of file cdcacm.h.

+

Definition at line 169 of file cdcacm.h.

@@ -809,7 +1048,7 @@ Static Protected Attributes
-

Definition at line 145 of file cdcacm.h.

+

Definition at line 170 of file cdcacm.h.

@@ -831,7 +1070,7 @@ Static Protected Attributes
-

Definition at line 146 of file cdcacm.h.

+

Definition at line 171 of file cdcacm.h.

@@ -853,7 +1092,7 @@ Static Protected Attributes
-

Definition at line 147 of file cdcacm.h.

+

Definition at line 172 of file cdcacm.h.

@@ -875,7 +1114,7 @@ Static Protected Attributes
-

Definition at line 148 of file cdcacm.h.

+

Definition at line 173 of file cdcacm.h.

@@ -897,7 +1136,7 @@ Static Protected Attributes
-

Definition at line 149 of file cdcacm.h.

+

Definition at line 174 of file cdcacm.h.

@@ -919,7 +1158,7 @@ Static Protected Attributes
-

Definition at line 150 of file cdcacm.h.

+

Definition at line 175 of file cdcacm.h.

@@ -941,11 +1180,11 @@ Static Protected Attributes
-

Definition at line 151 of file cdcacm.h.

+

Definition at line 176 of file cdcacm.h.

- +
@@ -953,7 +1192,7 @@ Static Protected Attributes @@ -963,11 +1202,11 @@ Static Protected Attributes
- +
bool ACM::bPollEnablevolatile bool ACM::bPollEnable
-

Definition at line 152 of file cdcacm.h.

+

Definition at line 177 of file cdcacm.h.

- +
@@ -975,7 +1214,7 @@ Static Protected Attributes @@ -985,7 +1224,29 @@ Static Protected Attributes
- +
bool ACM::readyvolatile bool ACM::ready
-

Definition at line 153 of file cdcacm.h.

+

Definition at line 178 of file cdcacm.h.

+ +
+
+ +
+
+ + + + + +
+ + + + +
tty_features ACM::_enhanced_status
+
+protected
+
+ +

Definition at line 179 of file cdcacm.h.

@@ -1007,7 +1268,7 @@ Static Protected Attributes
-

Definition at line 155 of file cdcacm.h.

+

Definition at line 181 of file cdcacm.h.

@@ -1020,7 +1281,7 @@ Static Protected Attributes diff --git a/class_a_c_m__coll__graph.map b/class_a_c_m__coll__graph.map index f5ef757e..cfeb8127 100644 --- a/class_a_c_m__coll__graph.map +++ b/class_a_c_m__coll__graph.map @@ -5,4 +5,5 @@ + diff --git a/class_a_c_m__coll__graph.md5 b/class_a_c_m__coll__graph.md5 index cbec54cc..f43712cc 100644 --- a/class_a_c_m__coll__graph.md5 +++ b/class_a_c_m__coll__graph.md5 @@ -1 +1 @@ -1882407469fb975afc811a5305d11f3f \ No newline at end of file +587ce662854a9a2b4677918117ea2d18 \ No newline at end of file diff --git a/class_a_c_m__coll__graph.png b/class_a_c_m__coll__graph.png index 65513261..8544d30d 100644 Binary files a/class_a_c_m__coll__graph.png and b/class_a_c_m__coll__graph.png differ diff --git a/class_a_c_m__inherit__graph.map b/class_a_c_m__inherit__graph.map index 2cc87bd3..7c0fc9b0 100644 --- a/class_a_c_m__inherit__graph.map +++ b/class_a_c_m__inherit__graph.map @@ -1,5 +1,6 @@ - + + diff --git a/class_a_c_m__inherit__graph.md5 b/class_a_c_m__inherit__graph.md5 index 6e76693b..69d55cdc 100644 --- a/class_a_c_m__inherit__graph.md5 +++ b/class_a_c_m__inherit__graph.md5 @@ -1 +1 @@ -0dd94ad9ae7f9063d8b27eae0ee50e3a \ No newline at end of file +1778af41b23c3b83c73bd88577cd17cc \ No newline at end of file diff --git a/class_a_c_m__inherit__graph.png b/class_a_c_m__inherit__graph.png index 02aad414..ff988c4b 100644 Binary files a/class_a_c_m__inherit__graph.png and b/class_a_c_m__inherit__graph.png differ diff --git a/class_a_d_k-members.html b/class_a_d_k-members.html index cbe1ba3c..c015f0cb 100644 --- a/class_a_d_k-members.html +++ b/class_a_d_k-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -95,29 +96,30 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); bConfNumADKprotected bNumEPADKprotected ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)ADKvirtual - DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual - EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)ADKvirtual - epDataInIndexADKprotectedstatic - epDataOutIndexADKprotectedstatic - epInfoADKprotected - GetAddress()ADKinlinevirtual - Init(uint8_t parent, uint8_t port, bool lowspeed)ADKvirtual - isReady()ADKinlinevirtual - Poll()ADKinlinevirtual - PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)ADKprotected - pUsbADKprotected - RcvData(uint16_t *nbytesptr, uint8_t *dataptr)ADK - readyADKprotected - Release()ADKvirtual - ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual - SndData(uint16_t nbytes, uint8_t *dataptr)ADK - VIDPIDOK(uint16_t vid, uint16_t pid)ADKinlinevirtual + DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual + DEVSUBCLASSOK(uint8_t subklass)USBDeviceConfiginlinevirtual + EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)ADKvirtual + epDataInIndexADKprotectedstatic + epDataOutIndexADKprotectedstatic + epInfoADKprotected + GetAddress()ADKinlinevirtual + Init(uint8_t parent, uint8_t port, bool lowspeed)ADKvirtual + isReady()ADKinlinevirtual + Poll()ADKinlinevirtual + PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)ADKprotected + pUsbADKprotected + RcvData(uint16_t *nbytesptr, uint8_t *dataptr)ADK + readyADKprotected + Release()ADKvirtual + ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual + SndData(uint16_t nbytes, uint8_t *dataptr)ADK + VIDPIDOK(uint16_t vid, uint16_t pid)ADKinlinevirtual
diff --git a/class_a_d_k.html b/class_a_d_k.html index 7b78f19d..fcb644e0 100644 --- a/class_a_d_k.html +++ b/class_a_d_k.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: ADK Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -118,11 +119,11 @@ Public Member Functions   uint8_t SndData (uint16_t nbytes, uint8_t *dataptr)   -virtual uint8_t ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed) +uint8_t ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed)   -virtual uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed) +uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)   -virtual uint8_t Release () +uint8_t Release ()   virtual uint8_t Poll ()   @@ -130,15 +131,17 @@ Public Member Functions   virtual bool isReady ()   -virtual boolean VIDPIDOK (uint16_t vid, uint16_t pid) -  -virtual void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) +virtual bool VIDPIDOK (uint16_t vid, uint16_t pid) +  +void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)   - Public Member Functions inherited from USBDeviceConfig virtual void ResetHubPort (uint8_t port)   -virtual boolean DEVCLASSOK (uint8_t klass) -  +virtual bool DEVCLASSOK (uint8_t klass) +  +virtual bool DEVSUBCLASSOK (uint8_t subklass) +  @@ -506,7 +509,7 @@ Static Protected Attributes - +

Protected Member Functions

@@ -514,7 +517,7 @@ Static Protected Attributes
- + @@ -538,7 +541,7 @@ Static Protected Attributes
virtual boolean ADK::VIDPIDOK virtual bool ADK::VIDPIDOK ( uint16_t  vid,
-

Reimplemented from USBDeviceConfig.

+

Reimplemented from USBDeviceConfig.

Definition at line 115 of file adk.h.

@@ -594,7 +597,7 @@ Static Protected Attributes
-

Implements UsbConfigXtracter.

+

Reimplemented from UsbConfigXtracter.

Definition at line 311 of file adk.cpp.

@@ -786,7 +789,7 @@ Static Protected Attributes diff --git a/class_a_d_k__coll__graph.md5 b/class_a_d_k__coll__graph.md5 index 2341756e..6e64816d 100644 --- a/class_a_d_k__coll__graph.md5 +++ b/class_a_d_k__coll__graph.md5 @@ -1 +1 @@ -37dc8161587ef9d91ca02f00e06d8d3e \ No newline at end of file +677a6776b852e96bee247fd946d74be2 \ No newline at end of file diff --git a/class_a_d_k__inherit__graph.md5 b/class_a_d_k__inherit__graph.md5 index 007981fa..55e30802 100644 --- a/class_a_d_k__inherit__graph.md5 +++ b/class_a_d_k__inherit__graph.md5 @@ -1 +1 @@ -bf61a3a2026b57525489bd4fa1b38220 \ No newline at end of file +bca330dbfb30c1761bf024a703ee6a77 \ No newline at end of file diff --git a/class_address_pool-members.html b/class_address_pool-members.html index a44847eb..ee21dc30 100644 --- a/class_address_pool-members.html +++ b/class_address_pool-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -98,7 +99,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_address_pool.html b/class_address_pool.html index 63de2747..489dc986 100644 --- a/class_address_pool.html +++ b/class_address_pool.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: AddressPool Class Reference + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -215,7 +216,7 @@ Public Member Functions diff --git a/class_address_pool__inherit__graph.md5 b/class_address_pool__inherit__graph.md5 index 208556c0..67a01c56 100644 --- a/class_address_pool__inherit__graph.md5 +++ b/class_address_pool__inherit__graph.md5 @@ -1 +1 @@ -120a062cef01918a52a6cdb4ddb3eba1 \ No newline at end of file +1e8b44e83a78a2dc42bcafc432f2a436 \ No newline at end of file diff --git a/class_address_pool_impl-members.html b/class_address_pool_impl-members.html index dbd58f87..01c7ee16 100644 --- a/class_address_pool_impl-members.html +++ b/class_address_pool_impl-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -100,7 +101,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_address_pool_impl.html b/class_address_pool_impl.html index 1e6a2438..12c6084c 100644 --- a/class_address_pool_impl.html +++ b/class_address_pool_impl.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: AddressPoolImpl< MAX_DEVICES_ALLOWED > Class Template Reference + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -113,7 +114,7 @@ Public Member Functions   virtual UsbDeviceGetUsbDevicePtr (uint8_t addr)   -void ForEachUsbDevice (UsbDeviceHandleFunc pfunc) +void ForEachUsbDevice (UsbDeviceHandleFunc pfunc)   virtual uint8_t AllocAddress (uint8_t parent, bool is_hub=false, uint8_t port=0)   @@ -197,7 +198,7 @@ template<const uint8_t MAX_DEVICES_ALLOWED>
void AddressPoolImpl< MAX_DEVICES_ALLOWED >::ForEachUsbDevice ( - UsbDeviceHandleFunc  + UsbDeviceHandleFunc  pfunc) @@ -297,7 +298,7 @@ template<const uint8_t MAX_DEVICES_ALLOWED> diff --git a/class_address_pool_impl__coll__graph.md5 b/class_address_pool_impl__coll__graph.md5 index 3317b219..77f1e07a 100644 --- a/class_address_pool_impl__coll__graph.md5 +++ b/class_address_pool_impl__coll__graph.md5 @@ -1 +1 @@ -4928b921ed421db937e32278788f372b \ No newline at end of file +77bc5e9fa2748d39429df403e8aba060 \ No newline at end of file diff --git a/class_address_pool_impl__inherit__graph.md5 b/class_address_pool_impl__inherit__graph.md5 index 3317b219..77f1e07a 100644 --- a/class_address_pool_impl__inherit__graph.md5 +++ b/class_address_pool_impl__inherit__graph.md5 @@ -1 +1 @@ -4928b921ed421db937e32278788f372b \ No newline at end of file +77bc5e9fa2748d39429df403e8aba060 \ No newline at end of file diff --git a/class_b_t_d-members.html b/class_b_t_d-members.html index 7f97288d..59e73a5b 100644 --- a/class_b_t_d-members.html +++ b/class_b_t_d-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -103,72 +104,73 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)BTDvirtual connectToHIDDeviceBTD connectToWiiBTD - DEVCLASSOK(uint8_t klass)BTDinlinevirtual - disc_bdaddrBTD - disconnect()BTDinline - EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)BTDvirtual - epInfoBTDprotected - GetAddress()BTDinlinevirtual - hci_accept_connection()BTD - hci_authentication_request()BTD - HCI_Command(uint8_t *data, uint16_t nbytes)BTD - hci_connect()BTD - hci_connect(uint8_t *bdaddr)BTD - hci_disconnect(uint16_t handle)BTD - hci_handleBTD - hci_inquiry()BTD - hci_inquiry_cancel()BTD - hci_link_key_request_negative_reply()BTD - hci_pin_code_negative_request_reply()BTD - hci_pin_code_request_reply()BTD - hci_read_bdaddr()BTD - hci_read_local_version_information()BTD - hci_remote_name()BTD - hci_reset()BTD - hci_set_local_name(const char *name)BTD - hci_versionBTD - hci_write_class_of_device()BTD - hci_write_scan_disable()BTD - hci_write_scan_enable()BTD - incomingHIDDeviceBTD - incomingWiiBTD - Init(uint8_t parent, uint8_t port, bool lowspeed)BTDvirtual - isReady()BTDinlinevirtual - L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)BTD - l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)BTD - l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)BTD - l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)BTD - l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)BTD - l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)BTD - l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)BTD - l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh)BTD - l2capConnectionClaimedBTD - motionPlusInsideBTD - my_bdaddrBTD - pairWithHID()BTDinline - pairWithHIDDeviceBTD - pairWithWiiBTD - pairWithWiimote()BTDinline - Poll()BTDvirtual - PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)BTDprotected - pUsbBTDprotected - qNextPollTimeBTDprotected - readPollInterval()BTDinline - registerServiceClass(BluetoothService *pService)BTDinline - Release()BTDvirtual - remote_nameBTD - ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual - rfcommConnectionClaimedBTD - sdpConnectionClaimedBTD - VIDPIDOK(uint16_t vid, uint16_t pid)BTDinlinevirtual - watingForConnectionBTD - wiiUProControllerBTD + DEVCLASSOK(uint8_t klass)BTDinlinevirtual + DEVSUBCLASSOK(uint8_t subklass)USBDeviceConfiginlinevirtual + disc_bdaddrBTD + disconnect()BTD + EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)BTDvirtual + epInfoBTDprotected + GetAddress()BTDinlinevirtual + hci_accept_connection()BTD + hci_authentication_request()BTD + HCI_Command(uint8_t *data, uint16_t nbytes)BTD + hci_connect()BTD + hci_connect(uint8_t *bdaddr)BTD + hci_disconnect(uint16_t handle)BTD + hci_handleBTD + hci_inquiry()BTD + hci_inquiry_cancel()BTD + hci_link_key_request_negative_reply()BTD + hci_pin_code_negative_request_reply()BTD + hci_pin_code_request_reply()BTD + hci_read_bdaddr()BTD + hci_read_local_version_information()BTD + hci_remote_name()BTD + hci_reset()BTD + hci_set_local_name(const char *name)BTD + hci_versionBTD + hci_write_class_of_device()BTD + hci_write_scan_disable()BTD + hci_write_scan_enable()BTD + incomingHIDDeviceBTD + incomingWiiBTD + Init(uint8_t parent, uint8_t port, bool lowspeed)BTDvirtual + isReady()BTDinlinevirtual + L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)BTD + l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)BTD + l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)BTD + l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)BTD + l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)BTD + l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)BTD + l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)BTD + l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh)BTD + l2capConnectionClaimedBTD + motionPlusInsideBTD + my_bdaddrBTD + pairWithHID()BTDinline + pairWithHIDDeviceBTD + pairWithWiiBTD + pairWithWiimote()BTDinline + Poll()BTDvirtual + PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)BTDprotected + pUsbBTDprotected + qNextPollTimeBTDprotected + readPollInterval()BTDinline + registerBluetoothService(BluetoothService *pService)BTDinline + Release()BTDvirtual + remote_nameBTD + ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual + rfcommConnectionClaimedBTD + sdpConnectionClaimedBTD + VIDPIDOK(uint16_t vid, uint16_t pid)BTDinlinevirtual + watingForConnectionBTD + wiiUProControllerBTD
diff --git a/class_b_t_d.html b/class_b_t_d.html index 4c735f36..1f4b2dfd 100644 --- a/class_b_t_d.html +++ b/class_b_t_d.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: BTD Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -117,8 +118,8 @@ Public Member Functions   void disconnect ()   -int8_t registerServiceClass (BluetoothService *pService) -  +int8_t registerBluetoothService (BluetoothService *pService) +  void pairWithWiimote ()   void pairWithHID () @@ -126,24 +127,24 @@ Public Member Functions uint8_t readPollInterval ()  
USBDeviceConfig implementation
-virtual uint8_t ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed) +uint8_t ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed)   -virtual uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed) +uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)   -virtual uint8_t Release () +uint8_t Release ()   -virtual uint8_t Poll () +uint8_t Poll ()   virtual uint8_t GetAddress ()   virtual bool isReady ()   -virtual boolean DEVCLASSOK (uint8_t klass) -  -virtual boolean VIDPIDOK (uint16_t vid, uint16_t pid) -  +virtual bool DEVCLASSOK (uint8_t klass) +  +virtual bool VIDPIDOK (uint16_t vid, uint16_t pid) + 
UsbConfigXtracter implementation
-virtual void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) +void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)  
HCI Commands
void HCI_Command (uint8_t *data, uint16_t nbytes) @@ -204,6 +205,8 @@ Public Member Functions - Public Member Functions inherited from USBDeviceConfig virtual void ResetHubPort (uint8_t port)   +virtual bool DEVSUBCLASSOK (uint8_t subklass) +  @@ -280,7 +283,7 @@ Static Protected Attributes

Detailed Description

The Bluetooth Dongle class will take care of all the USB communication and then pass the data to the BluetoothService classes.

-

Definition at line 230 of file BTD.h.

+

Definition at line 198 of file BTD.h.

Constructor & Destructor Documentation

@@ -493,7 +496,7 @@ Static Protected Attributes

Reimplemented from USBDeviceConfig.

-

Definition at line 270 of file BTD.h.

+

Definition at line 238 of file BTD.h.

@@ -519,11 +522,11 @@ Static Protected Attributes

Used to check if the dongle has been initialized.

Returns
True if it's ready.
-

Definition at line 278 of file BTD.h.

+

Definition at line 246 of file BTD.h.

- +

Public Attributes

@@ -531,7 +534,7 @@ Static Protected Attributes

Reimplemented in PS4BT.

-

Definition at line 115 of file BTHID.h.

+

Definition at line 120 of file BTHID.h.

@@ -588,7 +602,7 @@ Protected Attributes

Reimplemented in PS4BT.

-

Definition at line 119 of file BTHID.h.

+

Definition at line 124 of file BTHID.h.

@@ -616,7 +630,7 @@ Protected Attributes

Reimplemented in PS4BT.

-

Definition at line 123 of file BTHID.h.

+

Definition at line 128 of file BTHID.h.

@@ -632,53 +646,7 @@ Protected Attributes

True if a device is connected

-

Definition at line 92 of file BTHID.h.

- -
- - -
-
-
- + @@ -552,13 +555,13 @@ Static Protected Attributes
Returns
Returns true if the device's USB class matches this driver.
-

Reimplemented from USBDeviceConfig.

+

Reimplemented from USBDeviceConfig.

-

Definition at line 287 of file BTD.h.

+

Definition at line 255 of file BTD.h.

- +
virtual boolean BTD::DEVCLASSOK virtual bool BTD::DEVCLASSOK ( uint8_t  klass)
@@ -566,7 +569,7 @@ Static Protected Attributes

Used this to disconnect the devices.

-

Reimplemented from BluetoothService.

+

Implements BluetoothService.

-

Definition at line 52 of file BTHID.cpp.

+

Definition at line 49 of file BTHID.cpp.

@@ -356,7 +284,7 @@ Protected Attributes
Returns
Returns the corresponding HIDReportParser. Returns NULL if id is not valid.
-

Definition at line 58 of file BTHID.h.

+

Definition at line 49 of file BTHID.h.

@@ -400,7 +328,7 @@ Protected Attributes
Returns
Returns true if the HIDReportParser is set. False otherwise.
-

Definition at line 70 of file BTHID.h.

+

Definition at line 61 of file BTHID.h.

@@ -432,7 +360,7 @@ Protected Attributes -

Definition at line 81 of file BTHID.h.

+

Definition at line 72 of file BTHID.h.

@@ -456,7 +384,7 @@ Protected Attributes -

Definition at line 396 of file BTHID.cpp.

+

Definition at line 393 of file BTHID.cpp.

@@ -483,11 +411,11 @@ Protected Attributes

Call this to start the paring sequence with a device

-

Definition at line 95 of file BTHID.h.

+

Definition at line 86 of file BTHID.h.

- +
- + @@ -598,9 +601,9 @@ Static Protected Attributes
Returns
Returns true if the device's VID and PID matches this driver.
-

Reimplemented from USBDeviceConfig.

+

Reimplemented from USBDeviceConfig.

-

Definition at line 298 of file BTD.h.

+

Definition at line 266 of file BTD.h.

@@ -664,7 +667,7 @@ Static Protected Attributes -

Implements UsbConfigXtracter.

+

Reimplemented from UsbConfigXtracter.

Definition at line 314 of file BTD.cpp.

@@ -673,9 +676,6 @@ Static Protected Attributes
-
virtual boolean BTD::VIDPIDOK virtual bool BTD::VIDPIDOK ( uint16_t  vid,
- - - - -
@@ -684,19 +684,14 @@ Static Protected Attributes
void BTD::disconnect
-
-inline

Disconnects both the L2CAP Channel and the HCI Connection for all Bluetooth services.

-

Definition at line 322 of file BTD.h.

+

Definition at line 383 of file BTD.cpp.

- +
@@ -704,7 +699,7 @@ Static Protected Attributes

Member Function Documentation

- -
-
-
- + @@ -725,7 +720,7 @@ Static Protected Attributes
Returns
The service ID on success or -1 on fail.
-

Definition at line 333 of file BTD.h.

+

Definition at line 297 of file BTD.h.

@@ -760,7 +755,7 @@ Static Protected Attributes -

Definition at line 919 of file BTD.cpp.

+

Definition at line 927 of file BTD.cpp.

@@ -778,7 +773,7 @@ Static Protected Attributes

Reset the Bluetooth dongle.

-

Definition at line 924 of file BTD.cpp.

+

Definition at line 932 of file BTD.cpp.

@@ -796,7 +791,7 @@ Static Protected Attributes

Read the Bluetooth address of the dongle.

-

Definition at line 955 of file BTD.cpp.

+

Definition at line 963 of file BTD.cpp.

@@ -814,7 +809,7 @@ Static Protected Attributes

Read the HCI Version of the Bluetooth dongle.

-

Definition at line 964 of file BTD.cpp.

+

Definition at line 972 of file BTD.cpp.

@@ -838,7 +833,7 @@ Static Protected Attributes -

Definition at line 1008 of file BTD.cpp.

+

Definition at line 1016 of file BTD.cpp.

@@ -856,7 +851,7 @@ Static Protected Attributes

Enable visibility to other Bluetooth devices.

-

Definition at line 933 of file BTD.cpp.

+

Definition at line 941 of file BTD.cpp.

@@ -874,7 +869,7 @@ Static Protected Attributes

Disable visibility to other Bluetooth devices.

-

Definition at line 946 of file BTD.cpp.

+

Definition at line 954 of file BTD.cpp.

@@ -892,7 +887,7 @@ Static Protected Attributes

Read the remote devices name.

-

Definition at line 989 of file BTD.cpp.

+

Definition at line 997 of file BTD.cpp.

@@ -910,7 +905,7 @@ Static Protected Attributes

Accept the connection with the Bluetooth device.

-

Definition at line 973 of file BTD.cpp.

+

Definition at line 981 of file BTD.cpp.

@@ -934,7 +929,7 @@ Static Protected Attributes -

Definition at line 1142 of file BTD.cpp.

+

Definition at line 1150 of file BTD.cpp.

@@ -952,7 +947,7 @@ Static Protected Attributes

Respond with the pin for the connection. The pin is automatically set for the Wii library, but can be customized for the SPP library.

-

Definition at line 1068 of file BTD.cpp.

+

Definition at line 1076 of file BTD.cpp.

@@ -970,7 +965,7 @@ Static Protected Attributes

Respons when no pin was set.

-

Definition at line 1104 of file BTD.cpp.

+

Definition at line 1112 of file BTD.cpp.

@@ -988,7 +983,7 @@ Static Protected Attributes

Command is used to reply to a Link Key Request event from the BR/EDR Controller if the Host does not have a stored Link Key for the connection.

-

Definition at line 1118 of file BTD.cpp.

+

Definition at line 1126 of file BTD.cpp.

@@ -1006,7 +1001,7 @@ Static Protected Attributes

Used to try to authenticate with the remote device.

-

Definition at line 1132 of file BTD.cpp.

+

Definition at line 1140 of file BTD.cpp.

@@ -1024,7 +1019,7 @@ Static Protected Attributes

Start a HCI inquiry.

-

Definition at line 1020 of file BTD.cpp.

+

Definition at line 1028 of file BTD.cpp.

@@ -1042,7 +1037,7 @@ Static Protected Attributes

Cancel a HCI inquiry.

-

Definition at line 1034 of file BTD.cpp.

+

Definition at line 1042 of file BTD.cpp.

@@ -1060,7 +1055,7 @@ Static Protected Attributes

Connect to last device communicated with.

-

Definition at line 1042 of file BTD.cpp.

+

Definition at line 1050 of file BTD.cpp.

@@ -1084,7 +1079,7 @@ Static Protected Attributes -

Definition at line 1046 of file BTD.cpp.

+

Definition at line 1054 of file BTD.cpp.

@@ -1102,7 +1097,7 @@ Static Protected Attributes

Used to a set the class of the device.

-

Definition at line 1154 of file BTD.cpp.

+

Definition at line 1162 of file BTD.cpp.

@@ -1157,7 +1152,7 @@ Static Protected Attributes -

Definition at line 1190 of file BTD.cpp.

+

Definition at line 1198 of file BTD.cpp.

@@ -1206,7 +1201,7 @@ Static Protected Attributes -

Definition at line 1218 of file BTD.cpp.

+

Definition at line 1226 of file BTD.cpp.

@@ -1262,7 +1257,7 @@ Static Protected Attributes -

Definition at line 1231 of file BTD.cpp.

+

Definition at line 1239 of file BTD.cpp.

@@ -1304,7 +1299,7 @@ Static Protected Attributes -

Definition at line 1248 of file BTD.cpp.

+

Definition at line 1256 of file BTD.cpp.

@@ -1346,7 +1341,7 @@ Static Protected Attributes -

Definition at line 1265 of file BTD.cpp.

+

Definition at line 1273 of file BTD.cpp.

@@ -1395,7 +1390,7 @@ Static Protected Attributes -

Definition at line 1284 of file BTD.cpp.

+

Definition at line 1292 of file BTD.cpp.

@@ -1444,7 +1439,7 @@ Static Protected Attributes -

Definition at line 1297 of file BTD.cpp.

+

Definition at line 1305 of file BTD.cpp.

@@ -1492,7 +1487,7 @@ Static Protected Attributes -

Definition at line 1310 of file BTD.cpp.

+

Definition at line 1318 of file BTD.cpp.

@@ -1518,7 +1513,7 @@ Static Protected Attributes

Call this function to pair with a Wiimote

-

Definition at line 500 of file BTD.h.

+

Definition at line 464 of file BTD.h.

@@ -1544,7 +1539,7 @@ Static Protected Attributes

Call this function to pair with a Wiimote

-

Definition at line 516 of file BTD.h.

+

Definition at line 480 of file BTD.h.

@@ -1570,7 +1565,7 @@ Static Protected Attributes

Read the poll interval taken from the endpoint descriptors.

Returns
The poll interval in ms.
-

Definition at line 531 of file BTD.h.

+

Definition at line 495 of file BTD.h.

@@ -1618,7 +1613,7 @@ Static Protected Attributes

Use this to see if it is waiting for a incoming connection.

-

Definition at line 471 of file BTD.h.

+

Definition at line 435 of file BTD.h.

@@ -1633,7 +1628,7 @@ Static Protected Attributes

This is used by the service to know when to store the device information.

-

Definition at line 473 of file BTD.h.

+

Definition at line 437 of file BTD.h.

@@ -1648,7 +1643,7 @@ Static Protected Attributes

This is used by the SPP library to claim the current SDP incoming request.

-

Definition at line 475 of file BTD.h.

+

Definition at line 439 of file BTD.h.

@@ -1663,7 +1658,7 @@ Static Protected Attributes

This is used by the SPP library to claim the current RFCOMM incoming request.

-

Definition at line 477 of file BTD.h.

+

Definition at line 441 of file BTD.h.

@@ -1678,7 +1673,7 @@ Static Protected Attributes

The name you wish to make the dongle show up as. It is set automatically by the SPP library.

-

Definition at line 480 of file BTD.h.

+

Definition at line 444 of file BTD.h.

@@ -1693,7 +1688,7 @@ Static Protected Attributes

The pin you wish to make the dongle use for authentication. It is set automatically by the SPP and BTHID library.

-

Definition at line 482 of file BTD.h.

+

Definition at line 446 of file BTD.h.

@@ -1708,7 +1703,7 @@ Static Protected Attributes

The bluetooth dongles Bluetooth address.

-

Definition at line 485 of file BTD.h.

+

Definition at line 449 of file BTD.h.

@@ -1723,7 +1718,7 @@ Static Protected Attributes

HCI handle for the last connection.

-

Definition at line 487 of file BTD.h.

+

Definition at line 451 of file BTD.h.

@@ -1738,7 +1733,7 @@ Static Protected Attributes

Last incoming devices Bluetooth address.

-

Definition at line 489 of file BTD.h.

+

Definition at line 453 of file BTD.h.

@@ -1753,7 +1748,7 @@ Static Protected Attributes

First 30 chars of last remote name.

-

Definition at line 491 of file BTD.h.

+

Definition at line 455 of file BTD.h.

@@ -1768,7 +1763,7 @@ Static Protected Attributes

The supported HCI Version read from the Bluetooth dongle. Used by the PS3BT library to check the HCI Version of the Bluetooth dongle, it should be at least 3 to work properly with the library.

-

Definition at line 497 of file BTD.h.

+

Definition at line 461 of file BTD.h.

@@ -1783,7 +1778,7 @@ Static Protected Attributes

Used to only send the ACL data to the Wiimote.

-

Definition at line 503 of file BTD.h.

+

Definition at line 467 of file BTD.h.

@@ -1798,7 +1793,7 @@ Static Protected Attributes

True if a Wiimote is connecting.

-

Definition at line 507 of file BTD.h.

+

Definition at line 471 of file BTD.h.

@@ -1813,7 +1808,7 @@ Static Protected Attributes

True when it should pair with a Wiimote.

-

Definition at line 509 of file BTD.h.

+

Definition at line 473 of file BTD.h.

@@ -1828,7 +1823,7 @@ Static Protected Attributes

True if it's the new Wiimote with the Motion Plus Inside or a Wii U Pro Controller.

-

Definition at line 511 of file BTD.h.

+

Definition at line 475 of file BTD.h.

@@ -1843,7 +1838,7 @@ Static Protected Attributes

True if it's a Wii U Pro Controller.

-

Definition at line 513 of file BTD.h.

+

Definition at line 477 of file BTD.h.

@@ -1858,7 +1853,7 @@ Static Protected Attributes

Used to only send the ACL data to the Wiimote.

-

Definition at line 519 of file BTD.h.

+

Definition at line 483 of file BTD.h.

@@ -1873,7 +1868,7 @@ Static Protected Attributes

True if a Wiimote is connecting.

-

Definition at line 523 of file BTD.h.

+

Definition at line 487 of file BTD.h.

@@ -1888,7 +1883,7 @@ Static Protected Attributes

True when it should pair with a device like a mouse or keyboard.

-

Definition at line 525 of file BTD.h.

+

Definition at line 489 of file BTD.h.

@@ -1911,7 +1906,7 @@ Static Protected Attributes

Pointer to USB class instance.

-

Definition at line 533 of file BTD.h.

+

Definition at line 497 of file BTD.h.

@@ -1934,7 +1929,7 @@ Static Protected Attributes

Device address.

-

Definition at line 539 of file BTD.h.

+

Definition at line 503 of file BTD.h.

@@ -1957,7 +1952,7 @@ Static Protected Attributes

Endpoint info structure.

-

Definition at line 541 of file BTD.h.

+

Definition at line 505 of file BTD.h.

@@ -1980,7 +1975,7 @@ Static Protected Attributes

Configuration number.

-

Definition at line 544 of file BTD.h.

+

Definition at line 508 of file BTD.h.

@@ -2003,7 +1998,7 @@ Static Protected Attributes

Total number of endpoints in the configuration.

-

Definition at line 546 of file BTD.h.

+

Definition at line 510 of file BTD.h.

@@ -2026,7 +2021,7 @@ Static Protected Attributes

Next poll time based on poll interval taken from the USB descriptor.

-

Definition at line 548 of file BTD.h.

+

Definition at line 512 of file BTD.h.

@@ -2049,7 +2044,7 @@ Static Protected Attributes

Bluetooth dongle control endpoint.

-

Definition at line 551 of file BTD.h.

+

Definition at line 515 of file BTD.h.

@@ -2072,7 +2067,7 @@ Static Protected Attributes

HCI event endpoint index.

-

Definition at line 553 of file BTD.h.

+

Definition at line 517 of file BTD.h.

@@ -2095,7 +2090,7 @@ Static Protected Attributes

ACL In endpoint index.

-

Definition at line 555 of file BTD.h.

+

Definition at line 519 of file BTD.h.

@@ -2118,7 +2113,7 @@ Static Protected Attributes

ACL Out endpoint index.

-

Definition at line 557 of file BTD.h.

+

Definition at line 521 of file BTD.h.

@@ -2131,7 +2126,7 @@ Static Protected Attributes diff --git a/class_b_t_d__coll__graph.md5 b/class_b_t_d__coll__graph.md5 index 3b9a2e08..7288133e 100644 --- a/class_b_t_d__coll__graph.md5 +++ b/class_b_t_d__coll__graph.md5 @@ -1 +1 @@ -ca95807276f7b79a9da3fd2fb6368499 \ No newline at end of file +e72568841cb2f05e3bfabb29e1ce8457 \ No newline at end of file diff --git a/class_b_t_d__inherit__graph.md5 b/class_b_t_d__inherit__graph.md5 index 5d318cb2..95bb3a3b 100644 --- a/class_b_t_d__inherit__graph.md5 +++ b/class_b_t_d__inherit__graph.md5 @@ -1 +1 @@ -d46813718d41f5c0027726790fddd324 \ No newline at end of file +36ee382408a95d482da81524513435df \ No newline at end of file diff --git a/class_b_t_h_i_d-members.html b/class_b_t_h_i_d-members.html index d3489879..f611546a 100644 --- a/class_b_t_h_i_d-members.html +++ b/class_b_t_h_i_d-members.html @@ -3,15 +3,16 @@ - +USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
int8_t BTD::registerServiceClass int8_t BTD::registerBluetoothService ( BluetoothService pService)
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -90,22 +91,28 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

This is the complete list of members for BTHID, including all inherited members.

- - - + + + + + - - - - - - - + + + + + + + + + + + - + @@ -114,7 +121,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_b_t_h_i_d.html b/class_b_t_h_i_d.html index cda431c6..aa90cd14 100644 --- a/class_b_t_h_i_d.html +++ b/class_b_t_h_i_d.html @@ -3,15 +3,16 @@ - +USB Host Shield 2.0: BTHID Class Reference + @@ -31,7 +32,7 @@
ACLData(uint8_t *ACLData)BTHIDvirtual
attachOnInit(void(*funcOnInit)(void))BTHIDinline
BTHID(BTD *p, bool pair=false, const char *pin="0000")BTHID
ACLData(uint8_t *ACLData)BTHIDprotectedvirtual
attachOnInit(void(*funcOnInit)(void))BluetoothServiceinline
BluetoothService(BTD *p)BluetoothServiceinline
BTHID(BTD *p, bool pair=false, const char *pin="0000")BTHID
checkHciHandle(uint8_t *buf, uint16_t handle)BluetoothServiceinlineprotected
connectedBTHID
control_scidBTHIDprotected
disconnect()BTHIDvirtual
GetReportParser(uint8_t id)BTHIDinline
hci_handleBTHIDprotected
interrupt_scidBTHIDprotected
OnInitBTHID()BTHIDinlineprotectedvirtual
pair(void)BTHIDinline
ParseBTHIDData(uint8_t len, uint8_t *buf)BTHIDinlineprotectedvirtual
pBtdBTHIDprotected
Reset()BTHIDvirtual
hci_handleBluetoothServiceprotected
identifierBluetoothServiceprotected
interrupt_scidBTHIDprotected
l2cap_event_flagBluetoothServiceprotected
onInit()BTHIDinlineprotectedvirtual
OnInitBTHID()BTHIDinlineprotectedvirtual
pair(void)BTHIDinline
ParseBTHIDData(uint8_t len, uint8_t *buf)BTHIDinlineprotectedvirtual
pBtdBluetoothServiceprotected
pFuncOnInitBluetoothServiceprotected
Reset()BTHIDprotectedvirtual
ResetBTHID()BTHIDinlineprotectedvirtual
Run()BTHIDvirtual
Run()BTHIDprotectedvirtual
setLeds(uint8_t data)BTHID
setProtocolMode(uint8_t mode)BTHIDinline
SetReportParser(uint8_t id, HIDReportParser *prs)BTHIDinline
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -106,7 +107,7 @@ Collaboration diagram for BTHID:
Collaboration graph
- +
[legend]
- - - - - - - - - - - + + + + +

@@ -123,17 +124,11 @@ Public Member Functions

 
void pair (void)
 
void attachOnInit (void(*funcOnInit)(void))
 
BluetoothService implementation
virtual void ACLData (uint8_t *ACLData)
 
virtual void Run ()
 
virtual void Reset ()
 
virtual void disconnect ()
 
- Public Member Functions inherited from BluetoothService
 BluetoothService (BTD *p)
 
void attachOnInit (void(*funcOnInit)(void))
 
@@ -149,17 +144,40 @@ Protected Member Functions + + +

Public Attributes

 
virtual void ResetBTHID ()
 
- Protected Member Functions inherited from BluetoothService
bool checkHciHandle (uint8_t *buf, uint16_t handle)
 
- - - - + + + + + + + + + + + +

Protected Attributes

BTDpBtd
 
uint16_t hci_handle
 
uint8_t control_scid [2]
 
uint8_t interrupt_scid [2]
 
- Protected Attributes inherited from BluetoothService
void(* pFuncOnInit )(void)
 
BTDpBtd
 
uint16_t hci_handle
 
uint32_t l2cap_event_flag
 
uint8_t identifier
 
+ + + + + + + + + + +

+BluetoothService implementation

void disconnect ()
 
void ACLData (uint8_t *ACLData)
 
void Run ()
 
void Reset ()
 
void onInit ()
 

Detailed Description

This BluetoothService class implements support for Bluetooth HID devices.

@@ -209,96 +227,6 @@ Protected Attributes
- - - - -
- - - - - - - - -
void BTHID::ACLData (uint8_t * ACLData)
-
-virtual
-
-

Used to pass acldata to the services.

Parameters
- - -
ACLDataIncoming acldata.
-
-
- -

Reimplemented from BluetoothService.

- -

Definition at line 59 of file BTHID.cpp.

- -
-
- -
-
- - - - - -
- - - - - - - -
void BTHID::Run ()
-
-virtual
-
-

Used to run part of the state machine.

- -

Reimplemented from BluetoothService.

- -

Definition at line 347 of file BTHID.cpp.

- -
-
- -
-
- - - - - -
- - - - - - - -
void BTHID::Reset ()
-
-virtual
-
-

Use this to reset the service.

- -

Reimplemented from BluetoothService.

- -

Definition at line 44 of file BTHID.cpp.

- -
-
@@ -321,9 +249,9 @@ Protected Attributes
@@ -495,27 +423,113 @@ Protected Attributes +protectedvirtual
- + - - + +
void BTHID::attachOnInit void BTHID::ACLData (void(*)(void) funcOnInit)uint8_t * ACLData)
-inline
-

Used to call your own function when the device is successfully initialized.

Parameters
+

Used to pass acldata to the services.

Parameters
- +
funcOnInitFunction to call.
ACLDataIncoming acldata.
-

Definition at line 104 of file BTHID.h.

+

Implements BluetoothService.

+ +

Definition at line 56 of file BTHID.cpp.

+ +
+ + +
+
+ + + + + +
+ + + + + + + +
void BTHID::Run ()
+
+protectedvirtual
+
+

Used to run part of the state machine.

+ +

Implements BluetoothService.

+ +

Definition at line 344 of file BTHID.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void BTHID::Reset ()
+
+protectedvirtual
+
+

Use this to reset the service.

+ +

Implements BluetoothService.

+ +

Definition at line 41 of file BTHID.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void BTHID::onInit ()
+
+inlineprotectedvirtual
+
+

Called when a device is successfully initialized. Use attachOnInit(void (*funcOnInit)(void)) to call your own function. This is useful for instance if you want to set the LEDs in a specific way.

+ +

Implements BluetoothService.

+ +

Definition at line 107 of file BTHID.h.

@@ -560,7 +574,7 @@ Protected Attributes
- - - - -
- - - - -
BTD* BTHID::pBtd
-
-protected
-
-

Pointer to BTD instance

- -

Definition at line 129 of file BTHID.h.

- -
- - -
-
- - - - - -
- - - - -
uint16_t BTHID::hci_handle
-
-protected
-
-

HCI Handle for connection

- -

Definition at line 132 of file BTHID.h.

+

Definition at line 83 of file BTHID.h.

@@ -701,7 +669,7 @@ Protected Attributes

L2CAP source CID for HID_Control

-

Definition at line 136 of file BTHID.h.

+

Definition at line 134 of file BTHID.h.

@@ -724,7 +692,7 @@ Protected Attributes

L2CAP source CID for HID_Interrupt

-

Definition at line 139 of file BTHID.h.

+

Definition at line 137 of file BTHID.h.

@@ -737,7 +705,7 @@ Protected Attributes diff --git a/class_b_t_h_i_d__coll__graph.map b/class_b_t_h_i_d__coll__graph.map index 51439fee..4be7a39c 100644 --- a/class_b_t_h_i_d__coll__graph.map +++ b/class_b_t_h_i_d__coll__graph.map @@ -1,6 +1,6 @@ - - + + diff --git a/class_b_t_h_i_d__coll__graph.md5 b/class_b_t_h_i_d__coll__graph.md5 index 56671f82..b8a6fc7c 100644 --- a/class_b_t_h_i_d__coll__graph.md5 +++ b/class_b_t_h_i_d__coll__graph.md5 @@ -1 +1 @@ -e2f89679fd56e506438c2555a46fcf89 \ No newline at end of file +328440863f58d32544996d4a0a7788ae \ No newline at end of file diff --git a/class_b_t_h_i_d__coll__graph.png b/class_b_t_h_i_d__coll__graph.png index 82ee7f2d..76ed3971 100644 Binary files a/class_b_t_h_i_d__coll__graph.png and b/class_b_t_h_i_d__coll__graph.png differ diff --git a/class_b_t_h_i_d__inherit__graph.md5 b/class_b_t_h_i_d__inherit__graph.md5 index a07e90bb..d99946b7 100644 --- a/class_b_t_h_i_d__inherit__graph.md5 +++ b/class_b_t_h_i_d__inherit__graph.md5 @@ -1 +1 @@ -84cb6c869d9ec98ca739f6ef702e34ea \ No newline at end of file +0461eab4196d51bce1337c7c83a0da9f \ No newline at end of file diff --git a/class_bluetooth_service-members.html b/class_bluetooth_service-members.html index 5e82858f..3697a230 100644 --- a/class_bluetooth_service-members.html +++ b/class_bluetooth_service-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -90,16 +91,25 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

This is the complete list of members for BluetoothService, including all inherited members.

- - - - + + + + + + + + + + + + +
ACLData(uint8_t *ACLData)BluetoothServicevirtual
disconnect()BluetoothServicevirtual
Reset()BluetoothServicevirtual
Run()BluetoothServicevirtual
ACLData(uint8_t *ACLData)=0BluetoothServicepure virtual
attachOnInit(void(*funcOnInit)(void))BluetoothServiceinline
BluetoothService(BTD *p)BluetoothServiceinline
checkHciHandle(uint8_t *buf, uint16_t handle)BluetoothServiceinlineprotected
disconnect()=0BluetoothServicepure virtual
hci_handleBluetoothServiceprotected
identifierBluetoothServiceprotected
l2cap_event_flagBluetoothServiceprotected
onInit()=0BluetoothServiceprotectedpure virtual
pBtdBluetoothServiceprotected
pFuncOnInitBluetoothServiceprotected
Reset()=0BluetoothServicepure virtual
Run()=0BluetoothServicepure virtual
diff --git a/class_bluetooth_service.html b/class_bluetooth_service.html index 60c171a9..8e3da9d3 100644 --- a/class_bluetooth_service.html +++ b/class_bluetooth_service.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: BluetoothService Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -85,9 +86,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
-
BluetoothService Class Reference
+
BluetoothService Class Referenceabstract
@@ -99,24 +102,82 @@ Inheritance diagram for BluetoothService:
[legend]
+
+Collaboration diagram for BluetoothService:
+
+
Collaboration graph
+ + +
[legend]
- - - - - - - - + + + + + + + + + + + + +

Public Member Functions

virtual void ACLData (uint8_t *ACLData)
 
virtual void Run ()
 
virtual void Reset ()
 
virtual void disconnect ()
 
 BluetoothService (BTD *p)
 
virtual void ACLData (uint8_t *ACLData)=0
 
virtual void Run ()=0
 
virtual void Reset ()=0
 
virtual void disconnect ()=0
 
void attachOnInit (void(*funcOnInit)(void))
 
+ + + + + +

+Protected Member Functions

virtual void onInit ()=0
 
bool checkHciHandle (uint8_t *buf, uint16_t handle)
 
+ + + + + + + + + + +

+Protected Attributes

void(* pFuncOnInit )(void)
 
BTDpBtd
 
uint16_t hci_handle
 
uint32_t l2cap_event_flag
 
uint8_t identifier
 

Detailed Description

All Bluetooth services should inherit this class.

-

Definition at line 211 of file BTD.h.

-

Member Function Documentation

- +

Definition at line 563 of file BTD.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
BluetoothService::BluetoothService (BTDp)
+
+inline
+
+ +

Definition at line 565 of file BTD.h.

+ +
+
+

Member Function Documentation

+
@@ -133,7 +194,7 @@ Public Member Functions
-virtual +pure virtual
@@ -144,11 +205,11 @@ Public Member Functions -

Reimplemented in SPP, WII, PS3BT, and BTHID.

+

Implemented in WII, PS3BT, SPP, and BTHID.

- +
@@ -164,17 +225,17 @@ Public Member Functions
-virtual +pure virtual

Used to run the different state machines in the Bluetooth service.

-

Reimplemented in SPP, WII, PS3BT, and BTHID.

+

Implemented in WII, PS3BT, SPP, and BTHID.

- +
@@ -190,17 +251,17 @@ Public Member Functions
-virtual +pure virtual

Used to reset the Bluetooth service.

-

Reimplemented in SPP, WII, PS3BT, and BTHID.

+

Implemented in WII, PS3BT, SPP, and BTHID.

- +
@@ -216,13 +277,224 @@ Public Member Functions
-virtual +pure virtual

Used to disconnect both the L2CAP Channel and the HCI Connection for the Bluetooth service.

-

Reimplemented in SPP, WII, PS3BT, and BTHID.

+

Implemented in SPP, WII, PS3BT, and BTHID.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void BluetoothService::attachOnInit (void(*)(void) funcOnInit)
+
+inline
+
+

Used to call your own function when the device is successfully initialized.

Parameters
+ + +
funcOnInitFunction to call.
+
+
+ +

Definition at line 585 of file BTD.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
virtual void BluetoothService::onInit ()
+
+protectedpure virtual
+
+

Called when a device is successfully initialized. Use attachOnInit(void (*funcOnInit)(void)) to call your own function. This is useful for instance if you want to set the LEDs in a specific way.

+ +

Implemented in WII, PS3BT, SPP, and BTHID.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool BluetoothService::checkHciHandle (uint8_t * buf,
uint16_t handle 
)
+
+inlineprotected
+
+

Used to check if the incoming L2CAP data matches the HCI Handle

+ +

Definition at line 598 of file BTD.h.

+ +
+
+

Member Data Documentation

+ +
+
+ + + + + +
+ + + + +
void(* BluetoothService::pFuncOnInit) (void)
+
+protected
+
+

Pointer to function called in onInit().

+ +

Definition at line 603 of file BTD.h.

+ +
+
+ +
+
+ + + + + +
+ + + + +
BTD* BluetoothService::pBtd
+
+protected
+
+

Pointer to BTD instance.

+ +

Definition at line 606 of file BTD.h.

+ +
+
+ +
+
+ + + + + +
+ + + + +
uint16_t BluetoothService::hci_handle
+
+protected
+
+

The HCI Handle for the connection.

+ +

Definition at line 609 of file BTD.h.

+ +
+
+ +
+
+ + + + + +
+ + + + +
uint32_t BluetoothService::l2cap_event_flag
+
+protected
+
+

L2CAP flags of received Bluetooth events.

+ +

Definition at line 612 of file BTD.h.

+ +
+
+ +
+
+ + + + + +
+ + + + +
uint8_t BluetoothService::identifier
+
+protected
+
+

Identifier for L2CAP commands.

+ +

Definition at line 615 of file BTD.h.

@@ -234,7 +506,7 @@ Public Member Functions diff --git a/class_bluetooth_service__coll__graph.map b/class_bluetooth_service__coll__graph.map new file mode 100644 index 00000000..97b069d6 --- /dev/null +++ b/class_bluetooth_service__coll__graph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/class_bluetooth_service__coll__graph.md5 b/class_bluetooth_service__coll__graph.md5 new file mode 100644 index 00000000..c59d7e12 --- /dev/null +++ b/class_bluetooth_service__coll__graph.md5 @@ -0,0 +1 @@ +63004da77f15c2792f7eb5740b2b02f1 \ No newline at end of file diff --git a/class_bluetooth_service__coll__graph.png b/class_bluetooth_service__coll__graph.png new file mode 100644 index 00000000..acd45b9a Binary files /dev/null and b/class_bluetooth_service__coll__graph.png differ diff --git a/class_bluetooth_service__inherit__graph.md5 b/class_bluetooth_service__inherit__graph.md5 index d459942e..89adea58 100644 --- a/class_bluetooth_service__inherit__graph.md5 +++ b/class_bluetooth_service__inherit__graph.md5 @@ -1 +1 @@ -649bd2daee1f85302b66a7c86467bc90 \ No newline at end of file +ed04eb4acfc3583220d1627fb69bac21 \ No newline at end of file diff --git a/class_bulk_only-members.html b/class_bulk_only-members.html index d25ecd70..8bd04ec0 100644 --- a/class_bulk_only-members.html +++ b/class_bulk_only-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -103,44 +104,45 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); CurrentCapacityBulkOnlyprotected CurrentSectorSizeBulkOnlyprotected dCBWTagBulkOnlyprotected - DEVCLASSOK(uint8_t klass)BulkOnlyinlinevirtual - EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)BulkOnlyvirtual - epDataInIndexBulkOnlyprotectedstatic - epDataOutIndexBulkOnlyprotectedstatic - epInfoBulkOnlyprotected - epInterruptInIndexBulkOnlyprotectedstatic - GetAddress()BulkOnlyinlinevirtual - GetbMaxLUN()BulkOnlyinline - GetbTheLUN()BulkOnlyinline - GetCapacity(uint8_t lun)BulkOnly - GetLastUsbError()BulkOnlyinline - GetSectorSize(uint8_t lun)BulkOnly - Init(uint8_t parent, uint8_t port, bool lowspeed)BulkOnlyvirtual - LockMedia(uint8_t lun, uint8_t lock)BulkOnly - LUNIsGood(uint8_t lun)BulkOnly - LUNOkBulkOnlyprotected - MediaCTL(uint8_t lun, uint8_t ctl)BulkOnly - OnInit()BulkOnlyinlineprotectedvirtual - Poll()BulkOnlyvirtual - PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)BulkOnlyprotected - pUsbBulkOnlyprotected - qNextPollTimeBulkOnlyprotected - Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf)BulkOnly - Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, USBReadParser *prs)BulkOnly - Release()BulkOnlyvirtual - ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual - SCSITransaction10(CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir)BulkOnly - SCSITransaction6(CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir)BulkOnly - VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual - Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t *buf)BulkOnly - WriteOkBulkOnlyprotected - WriteProtected(uint8_t lun)BulkOnly + DEVCLASSOK(uint8_t klass)BulkOnlyinlinevirtual + DEVSUBCLASSOK(uint8_t subklass)USBDeviceConfiginlinevirtual + EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)BulkOnlyvirtual + epDataInIndexBulkOnlyprotectedstatic + epDataOutIndexBulkOnlyprotectedstatic + epInfoBulkOnlyprotected + epInterruptInIndexBulkOnlyprotectedstatic + GetAddress()BulkOnlyinlinevirtual + GetbMaxLUN()BulkOnlyinline + GetbTheLUN()BulkOnlyinline + GetCapacity(uint8_t lun)BulkOnly + GetLastUsbError()BulkOnlyinline + GetSectorSize(uint8_t lun)BulkOnly + Init(uint8_t parent, uint8_t port, bool lowspeed)BulkOnlyvirtual + LockMedia(uint8_t lun, uint8_t lock)BulkOnly + LUNIsGood(uint8_t lun)BulkOnly + LUNOkBulkOnlyprotected + MediaCTL(uint8_t lun, uint8_t ctl)BulkOnly + OnInit()BulkOnlyinlineprotectedvirtual + Poll()BulkOnlyvirtual + PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)BulkOnlyprotected + pUsbBulkOnlyprotected + qNextPollTimeBulkOnlyprotected + Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf)BulkOnly + Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, USBReadParser *prs)BulkOnly + Release()BulkOnlyvirtual + ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual + SCSITransaction10(CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir)BulkOnly + SCSITransaction6(CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir)BulkOnly + VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual + Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t *buf)BulkOnly + WriteOkBulkOnlyprotected + WriteProtected(uint8_t lun)BulkOnly
diff --git a/class_bulk_only.html b/class_bulk_only.html index 8e827102..400eedc1 100644 --- a/class_bulk_only.html +++ b/class_bulk_only.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: BulkOnly Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -120,8 +121,8 @@ Public Member Functions   uint8_t GetbTheLUN ()   -boolean WriteProtected (uint8_t lun) -  +bool WriteProtected (uint8_t lun) +  uint8_t MediaCTL (uint8_t lun, uint8_t ctl)   uint8_t Read (uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf) @@ -138,20 +139,20 @@ Public Member Functions   uint16_t GetSectorSize (uint8_t lun)   -virtual uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed) +uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)   -virtual uint8_t ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed) +uint8_t ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed)   -virtual uint8_t Release () +uint8_t Release ()   -virtual uint8_t Poll () +uint8_t Poll ()   virtual uint8_t GetAddress ()   -virtual void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) +void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)   -virtual boolean DEVCLASSOK (uint8_t klass) -  +virtual bool DEVCLASSOK (uint8_t klass) +  uint8_t SCSITransaction6 (CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir)   uint8_t SCSITransaction10 (CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir) @@ -159,8 +160,10 @@ Public Member Functions - Public Member Functions inherited from USBDeviceConfig virtual void ResetHubPort (uint8_t port)   -virtual boolean VIDPIDOK (uint16_t vid, uint16_t pid) -  +virtual bool VIDPIDOK (uint16_t vid, uint16_t pid) +  +virtual bool DEVSUBCLASSOK (uint8_t subklass) +  @@ -368,12 +371,12 @@ Static Protected Attributes - +

Protected Member Functions

- + @@ -962,13 +965,13 @@ Static Protected Attributes -

Implements UsbConfigXtracter.

+

Reimplemented from UsbConfigXtracter.

Definition at line 543 of file masstorage.cpp.

- +
boolean BulkOnly::WriteProtected bool BulkOnly::WriteProtected ( uint8_t  lun)
@@ -976,7 +979,7 @@ Static Protected Attributes diff --git a/class_bulk_only__coll__graph.md5 b/class_bulk_only__coll__graph.md5 index e993d046..65616e8f 100644 --- a/class_bulk_only__coll__graph.md5 +++ b/class_bulk_only__coll__graph.md5 @@ -1 +1 @@ -3d45c6122208407db0c669272fecf2e2 \ No newline at end of file +f9839364bbfdcee0034202ae5496cf49 \ No newline at end of file diff --git a/class_bulk_only__inherit__graph.md5 b/class_bulk_only__inherit__graph.md5 index d585bee0..ab44521f 100644 --- a/class_bulk_only__inherit__graph.md5 +++ b/class_bulk_only__inherit__graph.md5 @@ -1 +1 @@ -56d5764d63044c2fb0319b525dd7bedc \ No newline at end of file +2b66e1860fb7442508174e207255d1ed \ No newline at end of file diff --git a/class_byte_skipper-members.html b/class_byte_skipper-members.html index cb637311..7672ebd4 100644 --- a/class_byte_skipper-members.html +++ b/class_byte_skipper-members.html @@ -3,15 +3,16 @@ - +USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
- + @@ -990,7 +993,7 @@ Static Protected Attributes
virtual boolean BulkOnly::DEVCLASSOK virtual bool BulkOnly::DEVCLASSOK ( uint8_t  klass)
-

Reimplemented from USBDeviceConfig.

+

Reimplemented from USBDeviceConfig.

Definition at line 535 of file masstorage.h.

@@ -1526,7 +1529,7 @@ Static Protected Attributes
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -98,7 +99,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_byte_skipper.html b/class_byte_skipper.html index e6c1df4a..a4f9a9af 100644 --- a/class_byte_skipper.html +++ b/class_byte_skipper.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: ByteSkipper Class Reference + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -208,7 +209,7 @@ Public Member Functions diff --git a/class_c_d_c_async_oper-members.html b/class_c_d_c_async_oper-members.html index 09c30429..24fa6cf2 100644 --- a/class_c_d_c_async_oper-members.html +++ b/class_c_d_c_async_oper-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -90,13 +91,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

This is the complete list of members for CDCAsyncOper, including all inherited members.

- +
OnInit(ACM *pacm)=0CDCAsyncOperpure virtual
OnInit(ACM *pacm)CDCAsyncOperinlinevirtual
diff --git a/class_c_d_c_async_oper.html b/class_c_d_c_async_oper.html index 4242e0b9..1e175b78 100644 --- a/class_c_d_c_async_oper.html +++ b/class_c_d_c_async_oper.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: CDCAsyncOper Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -87,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); Public Member Functions | List of all members
-
CDCAsyncOper Class Referenceabstract
+
CDCAsyncOper Class Reference
@@ -95,14 +96,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - - + +

Public Member Functions

virtual uint8_t OnInit (ACM *pacm)=0
 
virtual uint8_t OnInit (ACM *pacm)
 

Detailed Description

Definition at line 128 of file cdcacm.h.

Member Function Documentation

- +
@@ -119,11 +120,13 @@ Public Member Functions
-pure virtual +inlinevirtual
+

Definition at line 131 of file cdcacm.h.

+

The documentation for this class was generated from the following file:
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -98,7 +99,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_config_desc_parser.html b/class_config_desc_parser.html index a4a88143..a04ad44b 100644 --- a/class_config_desc_parser.html +++ b/class_config_desc_parser.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: ConfigDescParser< CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK > Class Template Reference + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -113,7 +114,7 @@ Public Member Functions    ConfigDescParser (UsbConfigXtracter *xtractor)   -virtual void Parse (const uint16_t len, const uint8_t *pbuf, const uint16_t &offset) +void Parse (const uint16_t len, const uint8_t *pbuf, const uint16_t &offset)  

Detailed Description

@@ -121,7 +122,7 @@ Public Member Functions class ConfigDescParser< CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK > -

Definition at line 38 of file confdescparser.h.

+

Definition at line 40 of file confdescparser.h.

Constructor & Destructor Documentation

@@ -139,7 +140,7 @@ template<const uint8_t CLASS_ID, const uint8_t SUBCLASS_ID, const uint8_t PRO
-

Definition at line 70 of file confdescparser.h.

+

Definition at line 72 of file confdescparser.h.

@@ -168,7 +169,7 @@ template<const uint8_t CLASS_ID, const uint8_t SUBCLASS_ID, const uint8_t PRO
-

Definition at line 62 of file confdescparser.h.

+

Definition at line 64 of file confdescparser.h.

@@ -214,7 +215,7 @@ template<const uint8_t CLASS_ID, const uint8_t SUBCLASS_ID, const uint8_t PRO

Implements USBReadParser.

-

Definition at line 82 of file confdescparser.h.

+

Definition at line 84 of file confdescparser.h.

@@ -226,7 +227,7 @@ template<const uint8_t CLASS_ID, const uint8_t SUBCLASS_ID, const uint8_t PRO diff --git a/class_config_desc_parser__coll__graph.md5 b/class_config_desc_parser__coll__graph.md5 index d500e5a6..6d67d32a 100644 --- a/class_config_desc_parser__coll__graph.md5 +++ b/class_config_desc_parser__coll__graph.md5 @@ -1 +1 @@ -e7881467fbeaf56de26bf3e709c6ae68 \ No newline at end of file +43e2ececa16e23c2ef0bb98404d9dd99 \ No newline at end of file diff --git a/class_config_desc_parser__inherit__graph.md5 b/class_config_desc_parser__inherit__graph.md5 index d500e5a6..6d67d32a 100644 --- a/class_config_desc_parser__inherit__graph.md5 +++ b/class_config_desc_parser__inherit__graph.md5 @@ -1 +1 @@ -e7881467fbeaf56de26bf3e709c6ae68 \ No newline at end of file +43e2ececa16e23c2ef0bb98404d9dd99 \ No newline at end of file diff --git a/class_f_t_d_i-members.html b/class_f_t_d_i-members.html index 92fc057b..a4cb666f 100644 --- a/class_f_t_d_i-members.html +++ b/class_f_t_d_i-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -91,27 +92,28 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

This is the complete list of members for FTDI, including all inherited members.

- - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +
ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual
DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual
EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)FTDIvirtual
FTDI(USB *pusb, FTDIAsyncOper *pasync)FTDI
GetAddress()FTDIinlinevirtual
Init(uint8_t parent, uint8_t port, bool lowspeed)FTDIvirtual
Poll()FTDIvirtual
RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr)FTDI
Release()FTDIvirtual
ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual
SetBaudRate(uint32_t baud)FTDI
SetData(uint16_t databm)FTDI
SetFlowControl(uint8_t protocol, uint8_t xon=0x11, uint8_t xoff=0x13)FTDI
SetModemControl(uint16_t control)FTDI
SndData(uint16_t nbytes, uint8_t *dataptr)FTDI
VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual
DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual
DEVSUBCLASSOK(uint8_t subklass)USBDeviceConfiginlinevirtual
EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)FTDIvirtual
FTDI(USB *pusb, FTDIAsyncOper *pasync)FTDI
GetAddress()FTDIinlinevirtual
Init(uint8_t parent, uint8_t port, bool lowspeed)FTDIvirtual
Poll()FTDIvirtual
RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr)FTDI
Release()FTDIvirtual
ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual
SetBaudRate(uint32_t baud)FTDI
SetData(uint16_t databm)FTDI
SetFlowControl(uint8_t protocol, uint8_t xon=0x11, uint8_t xoff=0x13)FTDI
SetModemControl(uint16_t control)FTDI
SndData(uint16_t nbytes, uint8_t *dataptr)FTDI
VIDPIDOK(uint16_t vid, uint16_t pid)FTDIinlinevirtual
diff --git a/class_f_t_d_i.html b/class_f_t_d_i.html index dba102aa..f55a8255 100644 --- a/class_f_t_d_i.html +++ b/class_f_t_d_i.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: FTDI Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -123,29 +124,31 @@ Public Member Functions   uint8_t SndData (uint16_t nbytes, uint8_t *dataptr)   -virtual uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed) +uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)   -virtual uint8_t Release () +uint8_t Release ()   -virtual uint8_t Poll () +uint8_t Poll ()   virtual uint8_t GetAddress ()   -virtual void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) +void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)   +virtual bool VIDPIDOK (uint16_t vid, uint16_t pid) +  - Public Member Functions inherited from USBDeviceConfig virtual uint8_t ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed)   virtual void ResetHubPort (uint8_t port)   -virtual boolean VIDPIDOK (uint16_t vid, uint16_t pid) -  -virtual boolean DEVCLASSOK (uint8_t klass) -  +virtual bool DEVCLASSOK (uint8_t klass) +  +virtual bool DEVSUBCLASSOK (uint8_t subklass) + 

Detailed Description

-

Definition at line 89 of file cdcftdi.h.

+

Definition at line 94 of file cdcftdi.h.

Constructor & Destructor Documentation

@@ -190,7 +193,7 @@ Public Member Functions
-

Definition at line 267 of file cdcftdi.cpp.

+

Definition at line 262 of file cdcftdi.cpp.

@@ -208,7 +211,7 @@ Public Member Functions
-

Definition at line 304 of file cdcftdi.cpp.

+

Definition at line 299 of file cdcftdi.cpp.

@@ -242,7 +245,7 @@ Public Member Functions
-

Definition at line 308 of file cdcftdi.cpp.

+

Definition at line 303 of file cdcftdi.cpp.

@@ -260,7 +263,7 @@ Public Member Functions
-

Definition at line 312 of file cdcftdi.cpp.

+

Definition at line 307 of file cdcftdi.cpp.

@@ -288,7 +291,7 @@ Public Member Functions
-

Definition at line 316 of file cdcftdi.cpp.

+

Definition at line 311 of file cdcftdi.cpp.

@@ -316,7 +319,7 @@ Public Member Functions
-

Definition at line 320 of file cdcftdi.cpp.

+

Definition at line 315 of file cdcftdi.cpp.

@@ -360,7 +363,7 @@ Public Member Functions

Reimplemented from USBDeviceConfig.

-

Definition at line 41 of file cdcftdi.cpp.

+

Definition at line 39 of file cdcftdi.cpp.

@@ -387,7 +390,7 @@ Public Member Functions

Reimplemented from USBDeviceConfig.

-

Definition at line 242 of file cdcftdi.cpp.

+

Definition at line 237 of file cdcftdi.cpp.

@@ -414,7 +417,7 @@ Public Member Functions

Reimplemented from USBDeviceConfig.

-

Definition at line 252 of file cdcftdi.cpp.

+

Definition at line 247 of file cdcftdi.cpp.

@@ -441,7 +444,7 @@ Public Member Functions

Reimplemented from USBDeviceConfig.

-

Definition at line 125 of file cdcftdi.h.

+

Definition at line 130 of file cdcftdi.h.

@@ -495,9 +498,47 @@ Public Member Functions
-

Implements UsbConfigXtracter.

+

Reimplemented from UsbConfigXtracter.

-

Definition at line 215 of file cdcftdi.cpp.

+

Definition at line 210 of file cdcftdi.cpp.

+ +
+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual bool FTDI::VIDPIDOK (uint16_t vid,
uint16_t pid 
)
+
+inlinevirtual
+
+ +

Reimplemented from USBDeviceConfig.

+ +

Definition at line 137 of file cdcftdi.h.

@@ -510,7 +551,7 @@ Public Member Functions diff --git a/class_f_t_d_i__coll__graph.md5 b/class_f_t_d_i__coll__graph.md5 index 76857971..8736ae0b 100644 --- a/class_f_t_d_i__coll__graph.md5 +++ b/class_f_t_d_i__coll__graph.md5 @@ -1 +1 @@ -e5e07d3721e783dff0d1e851b88878cf \ No newline at end of file +7639ae03a2a3c77cae9f7ef89dc8dcfd \ No newline at end of file diff --git a/class_f_t_d_i__inherit__graph.md5 b/class_f_t_d_i__inherit__graph.md5 index 76857971..8736ae0b 100644 --- a/class_f_t_d_i__inherit__graph.md5 +++ b/class_f_t_d_i__inherit__graph.md5 @@ -1 +1 @@ -e5e07d3721e783dff0d1e851b88878cf \ No newline at end of file +7639ae03a2a3c77cae9f7ef89dc8dcfd \ No newline at end of file diff --git a/class_f_t_d_i_async_oper-members.html b/class_f_t_d_i_async_oper-members.html index 7389ac60..18109746 100644 --- a/class_f_t_d_i_async_oper-members.html +++ b/class_f_t_d_i_async_oper-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -90,13 +91,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

This is the complete list of members for FTDIAsyncOper, including all inherited members.

- + +
OnInit(FTDI *pftdi)=0FTDIAsyncOperpure virtual
OnInit(FTDI *pftdi)FTDIAsyncOperinlinevirtual
OnRelease(FTDI *pftdi)FTDIAsyncOperinlinevirtual
diff --git a/class_f_t_d_i_async_oper.html b/class_f_t_d_i_async_oper.html index 4296113f..4c7289c1 100644 --- a/class_f_t_d_i_async_oper.html +++ b/class_f_t_d_i_async_oper.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: FTDIAsyncOper Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -87,7 +88,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); Public Member Functions | List of all members
-
FTDIAsyncOper Class Referenceabstract
+
FTDIAsyncOper Class Reference
@@ -95,14 +96,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - - + + + +

Public Member Functions

virtual uint8_t OnInit (FTDI *pftdi)=0
 
virtual uint8_t OnInit (FTDI *pftdi)
 
virtual uint8_t OnRelease (FTDI *pftdi)
 

Detailed Description

Definition at line 79 of file cdcftdi.h.

Member Function Documentation

- +
@@ -119,11 +122,39 @@ Public Member Functions
-pure virtual +inlinevirtual
+

Definition at line 82 of file cdcftdi.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual uint8_t FTDIAsyncOper::OnRelease (FTDIpftdi)
+
+inlinevirtual
+
+ +

Definition at line 85 of file cdcftdi.h.

+

The documentation for this class was generated from the following file:
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -92,40 +93,41 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bAddressHIDprotected
ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual
DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual
EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)=0UsbConfigXtracterpure virtual
epInterruptInIndexHIDprotectedstatic
epInterruptOutIndexHIDprotectedstatic
GetAddress()USBDeviceConfiginlinevirtual
GetHidDescr(uint8_t ep, uint16_t nbytes, uint8_t *dataptr)HID
GetIdle(uint8_t iface, uint8_t reportID, uint8_t *dataptr)HID
GetProtocol(uint8_t iface, uint8_t *dataptr)HID
GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID
GetReportDescr(uint16_t wIndex, USBReadParser *parser=NULL)HID
GetReportParser(uint8_t id)HIDprotectedvirtual
GetUsb()HIDinline
HID(USB *pusb)HIDinline
Init(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual
maxEpPerInterfaceHIDprotectedstatic
maxHidInterfacesHIDprotectedstatic
Poll()USBDeviceConfiginlinevirtual
PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)HIDprotected
PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc)HIDprotected
pUsbHIDprotected
Release()USBDeviceConfiginlinevirtual
ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual
SetIdle(uint8_t iface, uint8_t reportID, uint8_t duration)HID
SetProtocol(uint8_t iface, uint8_t protocol)HID
SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID
SetReportParser(uint8_t id, HIDReportParser *prs)HIDvirtual
totalEndpointsHIDprotectedstatic
VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual
DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual
DEVSUBCLASSOK(uint8_t subklass)USBDeviceConfiginlinevirtual
EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)UsbConfigXtracterinlinevirtual
epInterruptInIndexHIDprotectedstatic
epInterruptOutIndexHIDprotectedstatic
GetAddress()USBDeviceConfiginlinevirtual
GetHidDescr(uint8_t ep, uint16_t nbytes, uint8_t *dataptr)HID
GetIdle(uint8_t iface, uint8_t reportID, uint8_t *dataptr)HID
GetProtocol(uint8_t iface, uint8_t *dataptr)HID
GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID
GetReportDescr(uint16_t wIndex, USBReadParser *parser=NULL)HID
GetReportParser(uint8_t id)HIDinlineprotectedvirtual
GetUsb()HIDinline
HID(USB *pusb)HIDinline
Init(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual
maxEpPerInterfaceHIDprotectedstatic
maxHidInterfacesHIDprotectedstatic
Poll()USBDeviceConfiginlinevirtual
PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)HIDprotected
PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc)HIDprotected
pUsbHIDprotected
Release()USBDeviceConfiginlinevirtual
ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual
SetIdle(uint8_t iface, uint8_t reportID, uint8_t duration)HID
SetProtocol(uint8_t iface, uint8_t protocol)HID
SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID
SetReportParser(uint8_t id, HIDReportParser *prs)HIDinlinevirtual
totalEndpointsHIDprotectedstatic
VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual
diff --git a/class_h_i_d.html b/class_h_i_d.html index 59636a40..dee501bb 100644 --- a/class_h_i_d.html +++ b/class_h_i_d.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: HID Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -147,13 +148,15 @@ Public Member Functions   virtual void ResetHubPort (uint8_t port)   -virtual boolean VIDPIDOK (uint16_t vid, uint16_t pid) -  -virtual boolean DEVCLASSOK (uint8_t klass) -  +virtual bool VIDPIDOK (uint16_t vid, uint16_t pid) +  +virtual bool DEVCLASSOK (uint8_t klass) +  +virtual bool DEVSUBCLASSOK (uint8_t subklass) +  - Public Member Functions inherited from UsbConfigXtracter -virtual void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)=0 -  +virtual void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) +  @@ -284,13 +287,15 @@ Static Protected Attributes

Protected Member Functions

-protectedvirtual +inlineprotectedvirtual

Reimplemented in HIDUniversal.

+

Definition at line 159 of file hid.h.

+
@@ -345,13 +350,15 @@ Static Protected Attributes -virtual +inlinevirtual

Reimplemented in HIDBoot< BOOT_PROTOCOL >, and HIDUniversal.

+

Definition at line 170 of file hid.h.

+
@@ -806,7 +813,7 @@ Static Protected Attributes diff --git a/class_h_i_d__coll__graph.md5 b/class_h_i_d__coll__graph.md5 index b57fdbbe..e5576691 100644 --- a/class_h_i_d__coll__graph.md5 +++ b/class_h_i_d__coll__graph.md5 @@ -1 +1 @@ -95e144b588214fefcf1c4b3b9ba8f1c5 \ No newline at end of file +0bbaf00e03400d0290a9b287d0a16910 \ No newline at end of file diff --git a/class_h_i_d__inherit__graph.md5 b/class_h_i_d__inherit__graph.md5 index 8bfa03ac..ad197148 100644 --- a/class_h_i_d__inherit__graph.md5 +++ b/class_h_i_d__inherit__graph.md5 @@ -1 +1 @@ -6dd916998d818c6a4632c4e2d93efcaa \ No newline at end of file +f301a139f053cfea05fcf52a0b155296 \ No newline at end of file diff --git a/class_h_i_d_boot-members.html b/class_h_i_d_boot-members.html index 0e9ef2bb..558d0079 100644 --- a/class_h_i_d_boot-members.html +++ b/class_h_i_d_boot-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -92,20 +93,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -119,13 +122,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - +
bAddressHIDprotected
ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual
DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual
EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)HIDBoot< BOOT_PROTOCOL >virtual
epInterruptInIndexHIDprotectedstatic
epInterruptOutIndexHIDprotectedstatic
GetAddress()HIDBoot< BOOT_PROTOCOL >inlinevirtual
GetHidDescr(uint8_t ep, uint16_t nbytes, uint8_t *dataptr)HID
GetIdle(uint8_t iface, uint8_t reportID, uint8_t *dataptr)HID
GetProtocol(uint8_t iface, uint8_t *dataptr)HID
GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID
GetReportDescr(uint16_t wIndex, USBReadParser *parser=NULL)HID
GetUsb()HIDinline
HID(USB *pusb)HIDinline
HIDBoot(USB *p)HIDBoot< BOOT_PROTOCOL >
Init(uint8_t parent, uint8_t port, bool lowspeed)HIDBoot< BOOT_PROTOCOL >virtual
DEVCLASSOK(uint8_t klass)HIDBoot< BOOT_PROTOCOL >inlinevirtual
DEVSUBCLASSOK(uint8_t subklass)HIDBoot< BOOT_PROTOCOL >inlinevirtual
EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)HIDBoot< BOOT_PROTOCOL >virtual
epInterruptInIndexHIDprotectedstatic
epInterruptOutIndexHIDprotectedstatic
GetAddress()HIDBoot< BOOT_PROTOCOL >inlinevirtual
GetHidDescr(uint8_t ep, uint16_t nbytes, uint8_t *dataptr)HID
GetIdle(uint8_t iface, uint8_t reportID, uint8_t *dataptr)HID
GetProtocol(uint8_t iface, uint8_t *dataptr)HID
GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID
GetReportDescr(uint16_t wIndex, USBReadParser *parser=NULL)HID
GetUsb()HIDinline
HID(USB *pusb)HIDinline
HIDBoot(USB *p)HIDBoot< BOOT_PROTOCOL >
Init(uint8_t parent, uint8_t port, bool lowspeed)HIDBoot< BOOT_PROTOCOL >virtual
isReady()HIDBoot< BOOT_PROTOCOL >inlinevirtual
maxEpPerInterfaceHIDprotectedstatic
maxHidInterfacesHIDprotectedstatic
Poll()HIDBoot< BOOT_PROTOCOL >virtual
SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID
SetReportParser(uint8_t id, HIDReportParser *prs)HIDBoot< BOOT_PROTOCOL >inlinevirtual
totalEndpointsHIDprotectedstatic
VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual
VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual
diff --git a/class_h_i_d_boot.html b/class_h_i_d_boot.html index 1faa2d75..13c38c0c 100644 --- a/class_h_i_d_boot.html +++ b/class_h_i_d_boot.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: HIDBoot< BOOT_PROTOCOL > Class Template Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -113,16 +114,22 @@ Public Member Functions   virtual bool SetReportParser (uint8_t id, HIDReportParser *prs)   -virtual uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed) +uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)   -virtual uint8_t Release () +uint8_t Release ()   -virtual uint8_t Poll () +uint8_t Poll ()   virtual uint8_t GetAddress ()   +virtual bool isReady () +  virtual void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)   +virtual bool DEVCLASSOK (uint8_t klass) +  +virtual bool DEVSUBCLASSOK (uint8_t subklass) +  - Public Member Functions inherited from HID  HID (USB *pusb)   @@ -149,10 +156,8 @@ Public Member Functions   virtual void ResetHubPort (uint8_t port)   -virtual boolean VIDPIDOK (uint16_t vid, uint16_t pid) -  -virtual boolean DEVCLASSOK (uint8_t klass) -  +virtual bool VIDPIDOK (uint16_t vid, uint16_t pid) +  @@ -183,7 +188,7 @@ Additional Inherited Members class HIDBoot< BOOT_PROTOCOL > -

Definition at line 179 of file hidboot.h.

+

Definition at line 199 of file hidboot.h.

Constructor & Destructor Documentation

@@ -201,7 +206,7 @@ template<const uint8_t BOOT_PROTOCOL>

Additional Inherited Members

-

Definition at line 220 of file hidboot.h.

+

Definition at line 253 of file hidboot.h.

@@ -242,7 +247,7 @@ template<const uint8_t BOOT_PROTOCOL>

Reimplemented from HID.

-

Definition at line 201 of file hidboot.h.

+

Definition at line 221 of file hidboot.h.

@@ -288,7 +293,7 @@ template<const uint8_t BOOT_PROTOCOL>

Reimplemented from USBDeviceConfig.

-

Definition at line 247 of file hidboot.h.

+

Definition at line 280 of file hidboot.h.

@@ -317,7 +322,7 @@ template<const uint8_t BOOT_PROTOCOL>

Reimplemented from USBDeviceConfig.

-

Definition at line 522 of file hidboot.h.

+

Definition at line 555 of file hidboot.h.

@@ -346,7 +351,7 @@ template<const uint8_t BOOT_PROTOCOL>

Reimplemented from USBDeviceConfig.

-

Definition at line 536 of file hidboot.h.

+

Definition at line 569 of file hidboot.h.

@@ -375,7 +380,34 @@ template<const uint8_t BOOT_PROTOCOL>

Reimplemented from USBDeviceConfig.

-

Definition at line 211 of file hidboot.h.

+

Definition at line 231 of file hidboot.h.

+ + + + +
+
+
+template<const uint8_t BOOT_PROTOCOL>
+ + + + + +
+ + + + + + + +
virtual bool HIDBoot< BOOT_PROTOCOL >::isReady ()
+
+inlinevirtual
+
+ +

Definition at line 235 of file hidboot.h.

@@ -431,9 +463,69 @@ template<const uint8_t BOOT_PROTOCOL>
-

Implements UsbConfigXtracter.

+

Reimplemented from UsbConfigXtracter.

-

Definition at line 498 of file hidboot.h.

+

Definition at line 531 of file hidboot.h.

+ +
+ + +
+
+
+template<const uint8_t BOOT_PROTOCOL>
+ + + + + +
+ + + + + + + + +
virtual bool HIDBoot< BOOT_PROTOCOL >::DEVCLASSOK (uint8_t klass)
+
+inlinevirtual
+
+ +

Reimplemented from USBDeviceConfig.

+ +

Definition at line 243 of file hidboot.h.

+ +
+
+ +
+
+
+template<const uint8_t BOOT_PROTOCOL>
+ + + + + +
+ + + + + + + + +
virtual bool HIDBoot< BOOT_PROTOCOL >::DEVSUBCLASSOK (uint8_t subklass)
+
+inlinevirtual
+
+ +

Reimplemented from USBDeviceConfig.

+ +

Definition at line 247 of file hidboot.h.

@@ -445,7 +537,7 @@ template<const uint8_t BOOT_PROTOCOL> diff --git a/class_h_i_d_boot__coll__graph.md5 b/class_h_i_d_boot__coll__graph.md5 index d90f3b69..eaa3c1fb 100644 --- a/class_h_i_d_boot__coll__graph.md5 +++ b/class_h_i_d_boot__coll__graph.md5 @@ -1 +1 @@ -6920cfc35976940c341067e838cfc9bd \ No newline at end of file +bafdede624ab47c8361b847c10219b24 \ No newline at end of file diff --git a/class_h_i_d_boot__inherit__graph.md5 b/class_h_i_d_boot__inherit__graph.md5 index 630b7c89..089c865b 100644 --- a/class_h_i_d_boot__inherit__graph.md5 +++ b/class_h_i_d_boot__inherit__graph.md5 @@ -1 +1 @@ -eb02cf549973a15ded74b4d4aab3ce68 \ No newline at end of file +a12f8110be687fd6090103dc7c427109 \ No newline at end of file diff --git a/class_h_i_d_report_parser-members.html b/class_h_i_d_report_parser-members.html index 4e3c2c16..b60777de 100644 --- a/class_h_i_d_report_parser-members.html +++ b/class_h_i_d_report_parser-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -96,7 +97,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_h_i_d_report_parser.html b/class_h_i_d_report_parser.html index f6d4cbe6..060e4a1b 100644 --- a/class_h_i_d_report_parser.html +++ b/class_h_i_d_report_parser.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: HIDReportParser Class Reference + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -165,7 +166,7 @@ Public Member Functions diff --git a/class_h_i_d_report_parser__inherit__graph.md5 b/class_h_i_d_report_parser__inherit__graph.md5 index 44e50d86..25b71fe2 100644 --- a/class_h_i_d_report_parser__inherit__graph.md5 +++ b/class_h_i_d_report_parser__inherit__graph.md5 @@ -1 +1 @@ -c82eb64e4e9d8248b32e0db32cbfa973 \ No newline at end of file +8be112e5d3300b51cf0649c53a258712 \ No newline at end of file diff --git a/class_h_i_d_universal-members.html b/class_h_i_d_universal-members.html index 8f1fa383..d7c5d8f3 100644 --- a/class_h_i_d_universal-members.html +++ b/class_h_i_d_universal-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -93,48 +94,50 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); bAddressHIDprotected bHasReportIdHIDUniversalprotected ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual - DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual - EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)HIDUniversalvirtual - epInfoHIDUniversalprotected - epInterruptInIndexHIDprotectedstatic - epInterruptOutIndexHIDprotectedstatic - GetAddress()HIDUniversalinlinevirtual - GetHidDescr(uint8_t ep, uint16_t nbytes, uint8_t *dataptr)HID - GetIdle(uint8_t iface, uint8_t reportID, uint8_t *dataptr)HID - GetProtocol(uint8_t iface, uint8_t *dataptr)HID - GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID - GetReportDescr(uint16_t wIndex, USBReadParser *parser=NULL)HID - GetReportParser(uint8_t id)HIDUniversalprotectedvirtual - GetUsb()HIDinline - HID(USB *pusb)HIDinline - hidInterfacesHIDUniversalprotected - HIDUniversal(USB *p)HIDUniversal - Init(uint8_t parent, uint8_t port, bool lowspeed)HIDUniversalvirtual - isReady()HIDUniversalinlinevirtual - maxEpPerInterfaceHIDprotectedstatic - maxHidInterfacesHIDprotectedstatic - OnInitSuccessful()HIDUniversalinlineprotectedvirtual - ParseHIDData(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)HIDUniversalinlineprotectedvirtual - PIDHIDUniversalprotected - Poll()HIDUniversalvirtual - PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)HIDprotected - PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc)HIDprotected - pUsbHIDprotected - Release()HIDUniversalvirtual - ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual - SetIdle(uint8_t iface, uint8_t reportID, uint8_t duration)HID - SetProtocol(uint8_t iface, uint8_t protocol)HID - SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID - SetReportParser(uint8_t id, HIDReportParser *prs)HIDUniversalvirtual + DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual + DEVSUBCLASSOK(uint8_t subklass)USBDeviceConfiginlinevirtual + EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)HIDUniversalvirtual + epInfoHIDUniversalprotected + epInterruptInIndexHIDprotectedstatic + epInterruptOutIndexHIDprotectedstatic + GetAddress()HIDUniversalinlinevirtual + GetHidDescr(uint8_t ep, uint16_t nbytes, uint8_t *dataptr)HID + GetIdle(uint8_t iface, uint8_t reportID, uint8_t *dataptr)HID + GetProtocol(uint8_t iface, uint8_t *dataptr)HID + GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID + GetReportDescr(uint16_t wIndex, USBReadParser *parser=NULL)HID + GetReportParser(uint8_t id)HIDUniversalprotectedvirtual + GetUsb()HIDinline + HID(USB *pusb)HIDinline + hidInterfacesHIDUniversalprotected + HIDUniversal(USB *p)HIDUniversal + Init(uint8_t parent, uint8_t port, bool lowspeed)HIDUniversalvirtual + isReady()HIDUniversalinlinevirtual + maxEpPerInterfaceHIDprotectedstatic + maxHidInterfacesHIDprotectedstatic + OnInitSuccessful()HIDUniversalinlineprotectedvirtual + ParseHIDData(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)HIDUniversalinlineprotectedvirtual + PIDHIDUniversalprotected + Poll()HIDUniversalvirtual + PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)HIDprotected + PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc)HIDprotected + pUsbHIDprotected + Release()HIDUniversalvirtual + ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual + SetIdle(uint8_t iface, uint8_t reportID, uint8_t duration)HID + SetProtocol(uint8_t iface, uint8_t protocol)HID + SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID + SetReportParser(uint8_t id, HIDReportParser *prs)HIDUniversalvirtual + SndRpt(uint16_t nbytes, uint8_t *dataptr)HIDUniversal totalEndpointsHIDprotectedstatic VIDHIDUniversalprotected - VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual + VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual
diff --git a/class_h_i_d_universal.html b/class_h_i_d_universal.html index 60e7df89..296af776 100644 --- a/class_h_i_d_universal.html +++ b/class_h_i_d_universal.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: HIDUniversal Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -114,20 +115,22 @@ Collaboration diagram for HIDUniversal:
Public Member Functions  HIDUniversal (USB *p)   -virtual bool SetReportParser (uint8_t id, HIDReportParser *prs) +bool SetReportParser (uint8_t id, HIDReportParser *prs)   -virtual uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed) +uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)   -virtual uint8_t Release () +uint8_t Release ()   -virtual uint8_t Poll () +uint8_t Poll ()   virtual uint8_t GetAddress ()   virtual bool isReady ()   -virtual void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) +void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)   +uint8_t SndRpt (uint16_t nbytes, uint8_t *dataptr) +  - Public Member Functions inherited from HID  HID (USB *pusb)   @@ -154,14 +157,16 @@ Public Member Functions   virtual void ResetHubPort (uint8_t port)   -virtual boolean VIDPIDOK (uint16_t vid, uint16_t pid) -  -virtual boolean DEVCLASSOK (uint8_t klass) -  +virtual bool VIDPIDOK (uint16_t vid, uint16_t pid) +  +virtual bool DEVCLASSOK (uint8_t klass) +  +virtual bool DEVSUBCLASSOK (uint8_t subklass) +  - + @@ -571,10 +576,38 @@ Additional Inherited Members

Protected Member Functions

virtual HIDReportParserGetReportParser (uint8_t id)
HIDReportParserGetReportParser (uint8_t id)
 
virtual uint8_t OnInitSuccessful ()
 
-

Implements UsbConfigXtracter.

+

Reimplemented from UsbConfigXtracter.

Definition at line 294 of file hiduniversal.cpp.

+
+ + +
+
+ + + + + + + + + + + + + + + + + + +
uint8_t HIDUniversal::SndRpt (uint16_t nbytes,
uint8_t * dataptr 
)
+
+ +

Definition at line 423 of file hiduniversal.cpp.

+

Member Data Documentation

@@ -697,7 +730,7 @@ Additional Inherited Members diff --git a/class_h_i_d_universal__coll__graph.md5 b/class_h_i_d_universal__coll__graph.md5 index 8b57cecf..aa7d2be9 100644 --- a/class_h_i_d_universal__coll__graph.md5 +++ b/class_h_i_d_universal__coll__graph.md5 @@ -1 +1 @@ -1437ba957c63d5d30a95779f4bc8d82e \ No newline at end of file +a460ad006dfb1d3b707394a29d3b88e7 \ No newline at end of file diff --git a/class_h_i_d_universal__inherit__graph.md5 b/class_h_i_d_universal__inherit__graph.md5 index 2f21b994..eaea3795 100644 --- a/class_h_i_d_universal__inherit__graph.md5 +++ b/class_h_i_d_universal__inherit__graph.md5 @@ -1 +1 @@ -e09792a51b247b4f11a36a8a6df5cb8b \ No newline at end of file +539835fca70173164746ed6947c2a429 \ No newline at end of file diff --git a/class_hex_dumper-members.html b/class_hex_dumper-members.html index 67ae5327..c0e29581 100644 --- a/class_hex_dumper-members.html +++ b/class_hex_dumper-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -92,13 +93,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - +
HexDumper()HexDumper< BASE_CLASS, LEN_TYPE, OFFSET_TYPE >inline
Initialize()HexDumper< BASE_CLASS, LEN_TYPE, OFFSET_TYPE >inline
Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset)HexDumper< BASE_CLASS, LEN_TYPE, OFFSET_TYPE >virtual
Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset)HexDumper< BASE_CLASS, LEN_TYPE, OFFSET_TYPE >
diff --git a/class_hex_dumper.html b/class_hex_dumper.html index f1e1acfa..902813ca 100644 --- a/class_hex_dumper.html +++ b/class_hex_dumper.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: HexDumper< BASE_CLASS, LEN_TYPE, OFFSET_TYPE > Class Template Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -96,15 +97,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); Inheritance diagram for HexDumper< BASE_CLASS, LEN_TYPE, OFFSET_TYPE >:
Inheritance graph
- -
[legend]
Collaboration diagram for HexDumper< BASE_CLASS, LEN_TYPE, OFFSET_TYPE >:
Collaboration graph
- -
[legend]
- +

@@ -113,7 +110,7 @@ Public Member Functions

 
void Initialize ()
 
virtual void Parse (const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset)
void Parse (const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset)
 

Detailed Description

@@ -183,9 +180,6 @@ template<class BASE_CLASS, class LEN_TYPE, class OFFSET_TYPE>
template<class BASE_CLASS , class LEN_TYPE , class OFFSET_TYPE >
- - - - - -
@@ -211,11 +205,6 @@ template<class BASE_CLASS , class LEN_TYPE , class OFFSET_TYPE >
void HexDumper< BASE_CLASS, LEN_TYPE, OFFSET_TYPE >::Parse
-
-virtual

Definition at line 43 of file hexdump.h.

@@ -230,7 +219,7 @@ template<class BASE_CLASS , class LEN_TYPE , class OFFSET_TYPE >
diff --git a/class_hex_dumper__coll__graph.md5 b/class_hex_dumper__coll__graph.md5 index 8c6445be..c9f3f213 100644 --- a/class_hex_dumper__coll__graph.md5 +++ b/class_hex_dumper__coll__graph.md5 @@ -1 +1 @@ -6b19c97018ed43d19b0cb24ee29f2b87 \ No newline at end of file +5be5e99ec5970ed3fe98ca3cc812cd40 \ No newline at end of file diff --git a/class_hex_dumper__inherit__graph.md5 b/class_hex_dumper__inherit__graph.md5 index 8c6445be..c9f3f213 100644 --- a/class_hex_dumper__inherit__graph.md5 +++ b/class_hex_dumper__inherit__graph.md5 @@ -1 +1 @@ -6b19c97018ed43d19b0cb24ee29f2b87 \ No newline at end of file +5be5e99ec5970ed3fe98ca3cc812cd40 \ No newline at end of file diff --git a/class_keyboard_report_parser-members.html b/class_keyboard_report_parser-members.html index 2e1d1582..c723ea7e 100644 --- a/class_keyboard_report_parser-members.html +++ b/class_keyboard_report_parser-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -96,23 +97,23 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); getPadKeys()KeyboardReportParserinlineprotectedvirtual getSymKeysLo()KeyboardReportParserinlineprotectedvirtual getSymKeysUp()KeyboardReportParserinlineprotectedvirtual - HandleLockingKeys(HID *hid, uint8_t key)KeyboardReportParserprotectedvirtual + HandleLockingKeys(HID *hid, uint8_t key)KeyboardReportParserinlineprotectedvirtual kbdInfoKeyboardReportParser kbdLedsKeyboardReportParser - kbdLockingKeysKeyboardReportParserprotected + kbdLockingKeysKeyboardReportParserprotected KeyboardReportParser()KeyboardReportParserinline OemToAscii(uint8_t mod, uint8_t key)KeyboardReportParserprotected OnControlKeysChanged(uint8_t before, uint8_t after)KeyboardReportParserinlineprotectedvirtual OnKeyDown(uint8_t mod, uint8_t key)KeyboardReportParserinlineprotectedvirtual OnKeyUp(uint8_t mod, uint8_t key)KeyboardReportParserinlineprotectedvirtual Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)KeyboardReportParservirtual - prevStateKeyboardReportParserprotected + prevStateKeyboardReportParserprotected
diff --git a/class_keyboard_report_parser.html b/class_keyboard_report_parser.html index 99b4b8c2..355d3454 100644 --- a/class_keyboard_report_parser.html +++ b/class_keyboard_report_parser.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: KeyboardReportParser Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -113,15 +114,15 @@ Collaboration diagram for KeyboardReportParser:
Public Member Functions  KeyboardReportParser ()   -virtual void Parse (HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) +void Parse (HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)   - - + + @@ -139,20 +140,20 @@ Protected Member Functions

Protected Member Functions

uint8_t OemToAscii (uint8_t mod, uint8_t key)
 
virtual uint8_t HandleLockingKeys (HID *hid, uint8_t key)
 
virtual uint8_t HandleLockingKeys (HID *hid, uint8_t key)
 
virtual void OnControlKeysChanged (uint8_t before, uint8_t after)
 
virtual void OnKeyDown (uint8_t mod, uint8_t key)
- - - - - - - - - - - - - - + + + + + + + + + + + + + +

Protected Attributes

union {
   KBDINFO   kbdInfo
 
   uint8_t   bInfo [sizeof(KBDINFO)]
 
prevState
 
union {
   KBDLEDS   kbdLeds
 
   uint8_t   bLeds
 
kbdLockingKeys
 
union {
   KBDINFO   kbdInfo
 
   uint8_t   bInfo [sizeof(KBDINFO)]
 
prevState
 
union {
   KBDLEDS   kbdLeds
 
   uint8_t   bLeds
 
kbdLockingKeys
 

Detailed Description

@@ -216,7 +217,7 @@ Protected Attributes
-

Definition at line 186 of file hidboot.cpp.

+

Definition at line 165 of file hidboot.cpp.

@@ -270,7 +271,7 @@ Protected Attributes - +
@@ -278,7 +279,7 @@ Protected Attributes +inlineprotectedvirtual
- + @@ -297,12 +298,12 @@ Protected Attributes
uint8_t KeyboardReportParser::HandleLockingKeys virtual uint8_t KeyboardReportParser::HandleLockingKeys ( HID hid,
-protectedvirtual
-

Definition at line 160 of file hidboot.cpp.

+

Definition at line 151 of file hidboot.h.

@@ -338,7 +339,7 @@ Protected Attributes
-

Definition at line 152 of file hidboot.h.

+

Definition at line 172 of file hidboot.h.

@@ -374,7 +375,7 @@ Protected Attributes
-

Definition at line 155 of file hidboot.h.

+

Definition at line 175 of file hidboot.h.

@@ -410,7 +411,7 @@ Protected Attributes
-

Definition at line 158 of file hidboot.h.

+

Definition at line 178 of file hidboot.h.

@@ -435,7 +436,7 @@ Protected Attributes
-

Definition at line 161 of file hidboot.h.

+

Definition at line 181 of file hidboot.h.

@@ -460,7 +461,7 @@ Protected Attributes
-

Definition at line 165 of file hidboot.h.

+

Definition at line 185 of file hidboot.h.

@@ -485,7 +486,7 @@ Protected Attributes
-

Definition at line 169 of file hidboot.h.

+

Definition at line 189 of file hidboot.h.

@@ -510,7 +511,7 @@ Protected Attributes
-

Definition at line 173 of file hidboot.h.

+

Definition at line 193 of file hidboot.h.

@@ -543,7 +544,7 @@ Protected Attributes - +
@@ -583,7 +584,7 @@ Protected Attributes - +
@@ -604,7 +605,7 @@ Protected Attributes diff --git a/class_keyboard_report_parser__coll__graph.md5 b/class_keyboard_report_parser__coll__graph.md5 index dbd84d99..b3538af0 100644 --- a/class_keyboard_report_parser__coll__graph.md5 +++ b/class_keyboard_report_parser__coll__graph.md5 @@ -1 +1 @@ -de31ab1b6045c46c724624d2f45ecd22 \ No newline at end of file +bb7b1a74ec2625233c79c3d3448ef47a \ No newline at end of file diff --git a/class_keyboard_report_parser__inherit__graph.md5 b/class_keyboard_report_parser__inherit__graph.md5 index 4f094571..5b9658e5 100644 --- a/class_keyboard_report_parser__inherit__graph.md5 +++ b/class_keyboard_report_parser__inherit__graph.md5 @@ -1 +1 @@ -ea9cb8a4a1aab693a56a91401236d24e \ No newline at end of file +c874e74f72d0db473ce869577e6f92d6 \ No newline at end of file diff --git a/class_m_a_x3421e-members.html b/class_m_a_x3421e-members.html index 9e195fe9..3fbaa977 100644 --- a/class_m_a_x3421e-members.html +++ b/class_m_a_x3421e-members.html @@ -3,15 +3,16 @@ - +USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
+
@@ -111,7 +112,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_m_a_x3421e.html b/class_m_a_x3421e.html index f1009de0..fddb42c3 100644 --- a/class_m_a_x3421e.html +++ b/class_m_a_x3421e.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: MAX3421e< SPI_SS, INTR > Class Template Reference + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -140,7 +141,7 @@ Public Member Functions class MAX3421e< SPI_SS, INTR > -

Definition at line 86 of file usbhost.h.

+

Definition at line 109 of file usbhost.h.

Constructor & Destructor Documentation

@@ -157,7 +158,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 119 of file usbhost.h.

+

Definition at line 142 of file usbhost.h.

@@ -188,7 +189,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 130 of file usbhost.h.

+

Definition at line 153 of file usbhost.h.

@@ -224,7 +225,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 155 of file usbhost.h.

+

Definition at line 191 of file usbhost.h.

@@ -244,7 +245,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 188 of file usbhost.h.

+

Definition at line 240 of file usbhost.h.

@@ -264,7 +265,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 197 of file usbhost.h.

+

Definition at line 249 of file usbhost.h.

@@ -300,7 +301,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 223 of file usbhost.h.

+

Definition at line 283 of file usbhost.h.

@@ -319,7 +320,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 264 of file usbhost.h.

+

Definition at line 341 of file usbhost.h.

@@ -338,7 +339,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 275 of file usbhost.h.

+

Definition at line 352 of file usbhost.h.

@@ -357,7 +358,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 289 of file usbhost.h.

+

Definition at line 366 of file usbhost.h.

@@ -377,7 +378,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 326 of file usbhost.h.

+

Definition at line 403 of file usbhost.h.

@@ -405,7 +406,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 101 of file usbhost.h.

+

Definition at line 124 of file usbhost.h.

@@ -433,7 +434,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 105 of file usbhost.h.

+

Definition at line 128 of file usbhost.h.

@@ -452,7 +453,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 370 of file usbhost.h.

+

Definition at line 447 of file usbhost.h.

@@ -488,7 +489,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 424 of file usbhost.h.

+

Definition at line 501 of file usbhost.h.

@@ -508,7 +509,7 @@ template<typename SPI_SS , typename INTR >
-

Definition at line 405 of file usbhost.h.

+

Definition at line 482 of file usbhost.h.

@@ -520,7 +521,7 @@ template<typename SPI_SS , typename INTR > diff --git a/class_m_a_x3421e__inherit__graph.md5 b/class_m_a_x3421e__inherit__graph.md5 index 9c6ebd2d..e9dc0389 100644 --- a/class_m_a_x3421e__inherit__graph.md5 +++ b/class_m_a_x3421e__inherit__graph.md5 @@ -1 +1 @@ -77bb5e0b002d7306a86fd50983493adb \ No newline at end of file +6b7dcdcf5b00fbf00c69a08de5fc301c \ No newline at end of file diff --git a/class_max___l_c_d-members.html b/class_max___l_c_d-members.html index f1de51d5..879f828a 100644 --- a/class_max___l_c_d-members.html +++ b/class_max___l_c_d-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -110,13 +111,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); scrollDisplayLeft()Max_LCD scrollDisplayRight()Max_LCD setCursor(uint8_t, uint8_t)Max_LCD - write(uint8_t)Max_LCDinlinevirtual + write(uint8_t)Max_LCDinline
diff --git a/class_max___l_c_d.html b/class_max___l_c_d.html index 8d360eff..9f899c7a 100644 --- a/class_max___l_c_d.html +++ b/class_max___l_c_d.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Max_LCD Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -96,15 +97,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); Inheritance diagram for Max_LCD:
Inheritance graph
- -
[legend]
Collaboration diagram for Max_LCD:
Collaboration graph
- -
[legend]
- +

@@ -149,7 +146,7 @@ Public Member Functions

 
void command (uint8_t)
 
virtual size_t write (uint8_t)
size_t write (uint8_t)
 

Detailed Description

@@ -569,7 +566,7 @@ Public Member Functions -inlinevirtual +inline
@@ -587,7 +584,7 @@ Public Member Functions diff --git a/class_max___l_c_d__coll__graph.md5 b/class_max___l_c_d__coll__graph.md5 index 687ddba5..8d049f39 100644 --- a/class_max___l_c_d__coll__graph.md5 +++ b/class_max___l_c_d__coll__graph.md5 @@ -1 +1 @@ -25074a74d69adb1d486aa8133e08ae69 \ No newline at end of file +14cf14911886c71d7e91596c82a5010c \ No newline at end of file diff --git a/class_max___l_c_d__inherit__graph.md5 b/class_max___l_c_d__inherit__graph.md5 index 687ddba5..8d049f39 100644 --- a/class_max___l_c_d__inherit__graph.md5 +++ b/class_max___l_c_d__inherit__graph.md5 @@ -1 +1 @@ -25074a74d69adb1d486aa8133e08ae69 \ No newline at end of file +14cf14911886c71d7e91596c82a5010c \ No newline at end of file diff --git a/class_mouse_report_parser-members.html b/class_mouse_report_parser-members.html index ca74649e..25f2e94c 100644 --- a/class_mouse_report_parser-members.html +++ b/class_mouse_report_parser-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -105,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_mouse_report_parser.html b/class_mouse_report_parser.html index d944a1e0..b9be913f 100644 --- a/class_mouse_report_parser.html +++ b/class_mouse_report_parser.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: MouseReportParser Class Reference + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -110,7 +111,7 @@ Collaboration diagram for MouseReportParser:
- +

Public Member Functions

virtual void Parse (HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
void Parse (HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
 
diff --git a/class_mouse_report_parser__coll__graph.md5 b/class_mouse_report_parser__coll__graph.md5 index f830f24d..0d410a43 100644 --- a/class_mouse_report_parser__coll__graph.md5 +++ b/class_mouse_report_parser__coll__graph.md5 @@ -1 +1 @@ -53fbe637398f71f4437285858e2dc022 \ No newline at end of file +405a7d8e938e10b74a7c678fcf2f2523 \ No newline at end of file diff --git a/class_mouse_report_parser__inherit__graph.md5 b/class_mouse_report_parser__inherit__graph.md5 index 621cb958..6dbeddc2 100644 --- a/class_mouse_report_parser__inherit__graph.md5 +++ b/class_mouse_report_parser__inherit__graph.md5 @@ -1 +1 @@ -7e59901244ab319897b579870a1fbeaf \ No newline at end of file +06cbf9c7fbacf4aaec1bcdfdc9d69628 \ No newline at end of file diff --git a/class_multi_byte_value_parser-members.html b/class_multi_byte_value_parser-members.html index 0df75f24..62018755 100644 --- a/class_multi_byte_value_parser-members.html +++ b/class_multi_byte_value_parser-members.html @@ -3,15 +3,16 @@ - +USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@

@@ -404,7 +405,7 @@ Protected Member Functions

- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -99,7 +100,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_multi_byte_value_parser.html b/class_multi_byte_value_parser.html index a22e1879..d1fd3335 100644 --- a/class_multi_byte_value_parser.html +++ b/class_multi_byte_value_parser.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: MultiByteValueParser Class Reference + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -222,7 +223,7 @@ Public Member Functions diff --git a/class_p_l2303-members.html b/class_p_l2303-members.html index 94fdd3e7..31a49975 100644 --- a/class_p_l2303-members.html +++ b/class_p_l2303-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -90,17 +91,25 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

This is the complete list of members for PL2303, including all inherited members.

- - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -109,30 +118,32 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +
ACM(USB *pusb, CDCAsyncOper *pasync)ACM
bAddressACMprotected
bConfNumACMprotected
bControlIfaceACMprotected
bDataIfaceACMprotected
bNumEPACMprotected
bPollEnableACMprotected
ClearCommFeature(uint16_t fid)ACM
ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual
DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual
_enhanced_statusACMprotected
ACM(USB *pusb, CDCAsyncOper *pasync)ACM
autoflowDSR(bool s)ACMinlinevirtual
autoflowRTS(bool s)ACMinlinevirtual
autoflowXON(bool s)ACMinlinevirtual
available(void)ACMinline
bAddressACMprotected
bConfNumACMprotected
bControlIfaceACMprotected
bDataIfaceACMprotected
bNumEPACMprotected
bPollEnableACMprotected
ClearCommFeature(uint16_t fid)ACM
ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual
DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual
DEVSUBCLASSOK(uint8_t subklass)USBDeviceConfiginlinevirtual
EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)ACMvirtual
enhanced_features(void)ACMinlinevirtual
enhanced_status(void)ACMinlinevirtual
epDataInIndexACMprotectedstatic
epDataOutIndexACMprotectedstatic
epInfoACMprotected
GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)ACM
GetLineCoding(LINE_CODING *dataptr)ACM
GetNotif(uint16_t *bytes_rcvd, uint8_t *dataptr)ACM
Init(uint8_t parent, uint8_t port, bool lowspeed)PL2303virtual
isReady()ACMinlinevirtual
pAsyncACMprotected
PL2303(USB *pusb, CDCAsyncOper *pasync)PL2303
Poll()ACMvirtual
PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)ACMprotected
pUsbACMprotected
qNextPollTimeACMprotected
RcvData(uint16_t *nbytesptr, uint8_t *dataptr)ACM
readyACMprotected
Release()ACMvirtual
ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual
SendBreak(uint16_t duration)ACM
SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)ACM
SetControlLineState(uint8_t state)ACM
SetLineCoding(const LINE_CODING *dataptr)ACM
SndData(uint16_t nbytes, uint8_t *dataptr)ACM
VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual
half_duplex(bool s)ACMinlinevirtual
Init(uint8_t parent, uint8_t port, bool lowspeed)PL2303virtual
isReady()ACMinlinevirtual
pAsyncACMprotected
PL2303(USB *pusb, CDCAsyncOper *pasync)PL2303
Poll()ACMvirtual
PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)ACMprotected
pUsbACMprotected
qNextPollTimeACMprotected
RcvData(uint16_t *nbytesptr, uint8_t *dataptr)ACM
readyACMprotected
Release()ACMvirtual
ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual
SendBreak(uint16_t duration)ACM
SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)ACM
SetControlLineState(uint8_t state)ACM
SetLineCoding(const LINE_CODING *dataptr)ACM
SndData(uint16_t nbytes, uint8_t *dataptr)ACM
VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual
wide(bool s)ACMinlinevirtual
diff --git a/class_p_l2303.html b/class_p_l2303.html index 2a24e0ed..3bc9a5cd 100644 --- a/class_p_l2303.html +++ b/class_p_l2303.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PL2303 Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -104,14 +105,14 @@ Collaboration diagram for PL2303:
Collaboration graph
- +
[legend]
- + @@ -136,25 +137,43 @@ Public Member Functions - + - + + + - + + + + + + + + + + + + + + + - - - - + + + + + +

Public Member Functions

 PL2303 (USB *pusb, CDCAsyncOper *pasync)
 
virtual uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)
uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)
 
- Public Member Functions inherited from ACM
 ACM (USB *pusb, CDCAsyncOper *pasync)
 
uint8_t SndData (uint16_t nbytes, uint8_t *dataptr)
 
virtual uint8_t Release ()
uint8_t Release ()
 
virtual uint8_t Poll ()
uint8_t Poll ()
 
bool available (void)
 
virtual uint8_t GetAddress ()
 
virtual bool isReady ()
 
virtual void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
virtual tty_features enhanced_status (void)
 
virtual tty_features enhanced_features (void)
 
virtual void autoflowRTS (bool s)
 
virtual void autoflowDSR (bool s)
 
virtual void autoflowXON (bool s)
 
virtual void half_duplex (bool s)
 
virtual void wide (bool s)
 
void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
 
- Public Member Functions inherited from USBDeviceConfig
virtual uint8_t ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed)
 
virtual void ResetHubPort (uint8_t port)
 
virtual boolean VIDPIDOK (uint16_t vid, uint16_t pid)
 
virtual boolean DEVCLASSOK (uint8_t klass)
 
virtual bool VIDPIDOK (uint16_t vid, uint16_t pid)
 
virtual bool DEVCLASSOK (uint8_t klass)
 
virtual bool DEVSUBCLASSOK (uint8_t subklass)
 
@@ -178,10 +197,12 @@ Additional Inherited Members - - - - + + + + + + @@ -194,7 +215,7 @@ Additional Inherited Members

Additional Inherited Members

 
uint32_t qNextPollTime
 
bool bPollEnable
 
bool ready
 
volatile bool bPollEnable
 
volatile bool ready
 
tty_features _enhanced_status
 
EpInfo epInfo [ACM_MAX_ENDPOINTS]
 
- Static Protected Attributes inherited from ACM

Detailed Description

-

Definition at line 118 of file cdcprolific.h.

+

Definition at line 119 of file cdcprolific.h.

Constructor & Destructor Documentation

@@ -278,7 +299,7 @@ Additional Inherited Members diff --git a/class_p_l2303__coll__graph.map b/class_p_l2303__coll__graph.map index 2f7f8d7d..abad38d3 100644 --- a/class_p_l2303__coll__graph.map +++ b/class_p_l2303__coll__graph.map @@ -1,9 +1,10 @@ - + + diff --git a/class_p_l2303__coll__graph.md5 b/class_p_l2303__coll__graph.md5 index 2bbe6b6f..3fccb2c3 100644 --- a/class_p_l2303__coll__graph.md5 +++ b/class_p_l2303__coll__graph.md5 @@ -1 +1 @@ -c150bc00ab8cc2b5946563b5a0ecbb7e \ No newline at end of file +da3590f8b39ab5267484ef72f2899a2c \ No newline at end of file diff --git a/class_p_l2303__coll__graph.png b/class_p_l2303__coll__graph.png index e9a710f7..fec05578 100644 Binary files a/class_p_l2303__coll__graph.png and b/class_p_l2303__coll__graph.png differ diff --git a/class_p_l2303__inherit__graph.md5 b/class_p_l2303__inherit__graph.md5 index fbefc7d1..8fff62d8 100644 --- a/class_p_l2303__inherit__graph.md5 +++ b/class_p_l2303__inherit__graph.md5 @@ -1 +1 @@ -24eddf3115f9a78b418b7d29835285a2 \ No newline at end of file +dd455d55317b48c08e2327d045dafb04 \ No newline at end of file diff --git a/class_p_s3_b_t-members.html b/class_p_s3_b_t-members.html index 07330cde..f89c85ab 100644 --- a/class_p_s3_b_t-members.html +++ b/class_p_s3_b_t-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -90,8 +91,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

This is the complete list of members for PS3BT, including all inherited members.

- - + + + + @@ -103,16 +106,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - - - + + + + + + + + + - - + + @@ -127,7 +136,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_p_s3_b_t.html b/class_p_s3_b_t.html index 2ff3c550..59c3a777 100644 --- a/class_p_s3_b_t.html +++ b/class_p_s3_b_t.html @@ -3,15 +3,16 @@ - +USB Host Shield 2.0: PS3BT Class Reference + @@ -31,7 +32,7 @@
ACLData(uint8_t *ACLData)PS3BTvirtual
attachOnInit(void(*funcOnInit)(void))PS3BTinline
ACLData(uint8_t *ACLData)PS3BTprotectedvirtual
attachOnInit(void(*funcOnInit)(void))BluetoothServiceinline
BluetoothService(BTD *p)BluetoothServiceinline
checkHciHandle(uint8_t *buf, uint16_t handle)BluetoothServiceinlineprotected
disconnect()PS3BTvirtual
get9DOFValues(SensorEnum a)PS3BT
getAnalogButton(ButtonEnum a)PS3BT
getSensor(SensorEnum a)PS3BT
getStatus(StatusEnum c)PS3BT
getTemperature()PS3BT
moveSetBulb(uint8_t r, uint8_t g, uint8_t b)PS3BT
moveSetBulb(ColorsEnum color)PS3BT
moveSetRumble(uint8_t rumble)PS3BT
hci_handleBluetoothServiceprotected
identifierBluetoothServiceprotected
l2cap_event_flagBluetoothServiceprotected
moveSetBulb(uint8_t r, uint8_t g, uint8_t b)PS3BT
moveSetBulb(ColorsEnum color)PS3BT
moveSetRumble(uint8_t rumble)PS3BT
onInit()PS3BTprotectedvirtual
pBtdBluetoothServiceprotected
pFuncOnInitBluetoothServiceprotected
printStatusString()PS3BT
PS3BT(BTD *pBtd, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0)PS3BT
PS3ConnectedPS3BT
PS3MoveConnectedPS3BT
PS3NavigationConnectedPS3BT
Reset()PS3BTvirtual
Run()PS3BTvirtual
Reset()PS3BTprotectedvirtual
Run()PS3BTprotectedvirtual
setAllOff()PS3BT
setLedOff()PS3BTinline
setLedOff(LEDEnum a)PS3BT
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -105,22 +106,13 @@ Collaboration diagram for PS3BT:
Collaboration graph
- +
[legend]
- + - - - - - - - - - @@ -168,8 +160,11 @@ Public Member Functions - - + + + + +

Public Member Functions

 PS3BT (BTD *pBtd, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0)
 PS3BT (BTD *pBtd, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0)
 
BluetoothService implementation
virtual void ACLData (uint8_t *ACLData)
 
virtual void Run ()
 
virtual void Reset ()
 
virtual void disconnect ()
 
PS3 Controller functions
bool getButtonPress (ButtonEnum b)
 
 
uint32_t getLastMessageTime ()
 
void attachOnInit (void(*funcOnInit)(void))
 
- Public Member Functions inherited from BluetoothService
 BluetoothService (BTD *p)
 
void attachOnInit (void(*funcOnInit)(void))
 
@@ -179,6 +174,36 @@ Public Attributes +

Public Attributes

 
bool PS3NavigationConnected
 
+ + + + + + + + + + + +

+BluetoothService implementation

void disconnect ()
 
void ACLData (uint8_t *ACLData)
 
void Run ()
 
void Reset ()
 
void onInit ()
 
+ + + + + + + + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from BluetoothService
bool checkHciHandle (uint8_t *buf, uint16_t handle)
 
- Protected Attributes inherited from BluetoothService
void(* pFuncOnInit )(void)
 
BTDpBtd
 
uint16_t hci_handle
 
uint32_t l2cap_event_flag
 
uint8_t identifier
 

Detailed Description

This BluetoothService class implements support for all the official PS3 Controllers: Dualshock 3, Navigation or a Motion controller via Bluetooth.

@@ -252,96 +277,6 @@ Public Attributes

Member Function Documentation

- -
-
- - - - - -
- - - - - - - - -
void PS3BT::ACLData (uint8_t * ACLData)
-
-virtual
-
-

Used to pass acldata to the services.

Parameters
- - -
ACLDataIncoming acldata.
-
-
- -

Reimplemented from BluetoothService.

- -

Definition at line 227 of file PS3BT.cpp.

- -
-
- -
-
- - - - - -
- - - - - - - -
void PS3BT::Run ()
-
-virtual
-
-

Used to run part of the state machine.

- -

Reimplemented from BluetoothService.

- -

Definition at line 458 of file PS3BT.cpp.

- -
-
- -
-
- - - - - -
- - - - - - - -
void PS3BT::Reset ()
-
-virtual
-
-

Use this to reset the service.

- -

Reimplemented from BluetoothService.

- -

Definition at line 207 of file PS3BT.cpp.

- -
-
@@ -364,9 +299,9 @@ Public Attributes

Used this to disconnect any of the controllers.

-

Reimplemented from BluetoothService.

+

Implements BluetoothService.

-

Definition at line 220 of file PS3BT.cpp.

+

Definition at line 217 of file PS3BT.cpp.

@@ -393,7 +328,7 @@ Public Attributes
Returns
getButtonPress(ButtonEnum b) will return a true as long as a button is held down, while getButtonClick(ButtonEnum b) will return true once for each button press.
-

Definition at line 52 of file PS3BT.cpp.

+

Definition at line 49 of file PS3BT.cpp.

@@ -420,7 +355,7 @@ Public Attributes
Returns
getButtonPress(ButtonEnum b) will return a true as long as a button is held down, while getButtonClick(ButtonEnum b) will return true once for each button press.
-

Definition at line 56 of file PS3BT.cpp.

+

Definition at line 53 of file PS3BT.cpp.

@@ -445,7 +380,7 @@ Public Attributes
Returns
Analog value in the range of 0-255.
-

Definition at line 63 of file PS3BT.cpp.

+

Definition at line 60 of file PS3BT.cpp.

@@ -470,7 +405,7 @@ Public Attributes
Returns
Return the analog value in the range of 0-255.
-

Definition at line 67 of file PS3BT.cpp.

+

Definition at line 64 of file PS3BT.cpp.

@@ -495,7 +430,7 @@ Public Attributes
Returns
Return the raw sensor value.
-

Definition at line 71 of file PS3BT.cpp.

+

Definition at line 68 of file PS3BT.cpp.

@@ -520,7 +455,7 @@ Public Attributes
Returns
Return the angle in the range of 0-360.
-

Definition at line 88 of file PS3BT.cpp.

+

Definition at line 85 of file PS3BT.cpp.

@@ -545,7 +480,7 @@ Public Attributes
Returns
The value in SI units.
-

Definition at line 115 of file PS3BT.cpp.

+

Definition at line 112 of file PS3BT.cpp.

@@ -570,7 +505,7 @@ Public Attributes
Returns
True if correct and false if not.
-

Definition at line 159 of file PS3BT.cpp.

+

Definition at line 156 of file PS3BT.cpp.

@@ -588,7 +523,7 @@ Public Attributes

Read all the available statuses from the controller and prints it as a nice formated string.

-

Definition at line 163 of file PS3BT.cpp.

+

Definition at line 160 of file PS3BT.cpp.

@@ -606,7 +541,7 @@ Public Attributes

Read the temperature from the Move controller.

Returns
The temperature in degrees Celsius.
-

Definition at line 144 of file PS3BT.cpp.

+

Definition at line 141 of file PS3BT.cpp.

@@ -624,7 +559,7 @@ Public Attributes

Used to set all LEDs and rumble off.

-

Definition at line 523 of file PS3BT.cpp.

+

Definition at line 519 of file PS3BT.cpp.

@@ -642,7 +577,7 @@ Public Attributes

Turn off rumble.

-

Definition at line 534 of file PS3BT.cpp.

+

Definition at line 530 of file PS3BT.cpp.

@@ -666,7 +601,7 @@ Public Attributes -

Definition at line 543 of file PS3BT.cpp.

+

Definition at line 539 of file PS3BT.cpp.

@@ -715,7 +650,7 @@ Public Attributes -

Definition at line 552 of file PS3BT.cpp.

+

Definition at line 548 of file PS3BT.cpp.

@@ -739,7 +674,7 @@ Public Attributes -

Definition at line 560 of file PS3BT.cpp.

+

Definition at line 556 of file PS3BT.cpp.

@@ -765,7 +700,7 @@ Public Attributes

Turn all LEDs off.

-

Definition at line 147 of file PS3BT.h.

+

Definition at line 138 of file PS3BT.h.

@@ -789,7 +724,7 @@ Public Attributes -

Definition at line 565 of file PS3BT.cpp.

+

Definition at line 561 of file PS3BT.cpp.

@@ -813,7 +748,7 @@ Public Attributes -

Definition at line 570 of file PS3BT.cpp.

+

Definition at line 566 of file PS3BT.cpp.

@@ -837,7 +772,7 @@ Public Attributes -

Definition at line 579 of file PS3BT.cpp.

+

Definition at line 575 of file PS3BT.cpp.

@@ -877,7 +812,7 @@ Public Attributes -

Definition at line 605 of file PS3BT.cpp.

+

Definition at line 601 of file PS3BT.cpp.

@@ -901,7 +836,7 @@ Public Attributes -

Definition at line 614 of file PS3BT.cpp.

+

Definition at line 610 of file PS3BT.cpp.

@@ -925,7 +860,7 @@ Public Attributes -

Definition at line 618 of file PS3BT.cpp.

+

Definition at line 614 of file PS3BT.cpp.

@@ -951,11 +886,11 @@ Public Attributes

Used to get the millis() of the last message

-

Definition at line 183 of file PS3BT.h.

+

Definition at line 174 of file PS3BT.h.

- +
@@ -963,27 +898,113 @@ Public Attributes +protectedvirtual
- + - - + +
void PS3BT::attachOnInit void PS3BT::ACLData (void(*)(void) funcOnInit)uint8_t * ACLData)
-inline
-

Used to call your own function when the controller is successfully initialized.

Parameters
+

Used to pass acldata to the services.

Parameters
- +
funcOnInitFunction to call.
ACLDataIncoming acldata.
-

Definition at line 191 of file PS3BT.h.

+

Implements BluetoothService.

+ +

Definition at line 224 of file PS3BT.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void PS3BT::Run ()
+
+protectedvirtual
+
+

Used to run part of the state machine.

+ +

Implements BluetoothService.

+ +

Definition at line 454 of file PS3BT.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void PS3BT::Reset ()
+
+protectedvirtual
+
+

Use this to reset the service.

+ +

Implements BluetoothService.

+ +

Definition at line 204 of file PS3BT.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void PS3BT::onInit ()
+
+protectedvirtual
+
+

Called when the controller is successfully initialized. Use attachOnInit(void (*funcOnInit)(void)) to call your own function. This is useful for instance if you want to set the LEDs in a specific way.

+ +

Implements BluetoothService.

+ +

Definition at line 625 of file PS3BT.cpp.

@@ -999,7 +1020,7 @@ Public Attributes

Variable used to indicate if the normal Playstation controller is successfully connected.

-

Definition at line 193 of file PS3BT.h.

+

Definition at line 176 of file PS3BT.h.

@@ -1014,7 +1035,7 @@ Public Attributes

Variable used to indicate if the Move controller is successfully connected.

-

Definition at line 199 of file PS3BT.h.

+

Definition at line 182 of file PS3BT.h.

@@ -1029,7 +1050,7 @@ Public Attributes

Variable used to indicate if the Navigation controller is successfully connected.

-

Definition at line 201 of file PS3BT.h.

+

Definition at line 184 of file PS3BT.h.

@@ -1042,7 +1063,7 @@ Public Attributes diff --git a/class_p_s3_b_t__coll__graph.map b/class_p_s3_b_t__coll__graph.map index 88ec45a6..2fe4b216 100644 --- a/class_p_s3_b_t__coll__graph.map +++ b/class_p_s3_b_t__coll__graph.map @@ -1,3 +1,9 @@ - + + + + + + + diff --git a/class_p_s3_b_t__coll__graph.md5 b/class_p_s3_b_t__coll__graph.md5 index 12c7deaf..9944a07a 100644 --- a/class_p_s3_b_t__coll__graph.md5 +++ b/class_p_s3_b_t__coll__graph.md5 @@ -1 +1 @@ -06c1c66f64f4c39618a1d5ab9446b806 \ No newline at end of file +7cded78e6e9cacc4756734b2d8e3a17f \ No newline at end of file diff --git a/class_p_s3_b_t__coll__graph.png b/class_p_s3_b_t__coll__graph.png index 8cad5dca..fafb7c64 100644 Binary files a/class_p_s3_b_t__coll__graph.png and b/class_p_s3_b_t__coll__graph.png differ diff --git a/class_p_s3_b_t__inherit__graph.md5 b/class_p_s3_b_t__inherit__graph.md5 index 12c7deaf..c4a47a9b 100644 --- a/class_p_s3_b_t__inherit__graph.md5 +++ b/class_p_s3_b_t__inherit__graph.md5 @@ -1 +1 @@ -06c1c66f64f4c39618a1d5ab9446b806 \ No newline at end of file +af123ea0ba1b2bc2c3a6775f7cb65fa0 \ No newline at end of file diff --git a/class_p_s3_u_s_b-members.html b/class_p_s3_u_s_b-members.html index 2e9a8461..5f4dbafe 100644 --- a/class_p_s3_u_s_b-members.html +++ b/class_p_s3_u_s_b-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -93,51 +94,52 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); attachOnInit(void(*funcOnInit)(void))PS3USBinline bAddressPS3USBprotected ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual - DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual - epInfoPS3USBprotected - GetAddress()PS3USBinlinevirtual - getAnalogButton(ButtonEnum a)PS3USB - getAnalogHat(AnalogHatEnum a)PS3USB - getAngle(AngleEnum a)PS3USB - getBdaddr(uint8_t *bdaddr)PS3USB - getButtonClick(ButtonEnum b)PS3USB - getButtonPress(ButtonEnum b)PS3USB - getMoveBdaddr(uint8_t *bdaddr)PS3USB - getMoveCalibration(uint8_t *data)PS3USB - getSensor(SensorEnum a)PS3USB - getStatus(StatusEnum c)PS3USB - Init(uint8_t parent, uint8_t port, bool lowspeed)PS3USBvirtual - isReady()PS3USBinlinevirtual - moveSetBulb(uint8_t r, uint8_t g, uint8_t b)PS3USB - moveSetBulb(ColorsEnum color)PS3USB - moveSetRumble(uint8_t rumble)PS3USB - Poll()PS3USBvirtual - printStatusString()PS3USB - PS3ConnectedPS3USB - PS3MoveConnectedPS3USB - PS3NavigationConnectedPS3USB - PS3USB(USB *pUsb, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0)PS3USB - pUsbPS3USBprotected - Release()PS3USBvirtual - ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual - setAllOff()PS3USB - setBdaddr(uint8_t *bdaddr)PS3USB - setLedOff()PS3USBinline - setLedOff(LEDEnum a)PS3USB - setLedOn(LEDEnum a)PS3USB - setLedRaw(uint8_t value)PS3USB - setLedToggle(LEDEnum a)PS3USB - setMoveBdaddr(uint8_t *bdaddr)PS3USB - setRumbleOff()PS3USB - setRumbleOn(RumbleEnum mode)PS3USB - setRumbleOn(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower)PS3USB - VIDPIDOK(uint16_t vid, uint16_t pid)PS3USBinlinevirtual + DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual + DEVSUBCLASSOK(uint8_t subklass)USBDeviceConfiginlinevirtual + epInfoPS3USBprotected + GetAddress()PS3USBinlinevirtual + getAnalogButton(ButtonEnum a)PS3USB + getAnalogHat(AnalogHatEnum a)PS3USB + getAngle(AngleEnum a)PS3USB + getBdaddr(uint8_t *bdaddr)PS3USB + getButtonClick(ButtonEnum b)PS3USB + getButtonPress(ButtonEnum b)PS3USB + getMoveBdaddr(uint8_t *bdaddr)PS3USB + getMoveCalibration(uint8_t *data)PS3USB + getSensor(SensorEnum a)PS3USB + getStatus(StatusEnum c)PS3USB + Init(uint8_t parent, uint8_t port, bool lowspeed)PS3USBvirtual + isReady()PS3USBinlinevirtual + moveSetBulb(uint8_t r, uint8_t g, uint8_t b)PS3USB + moveSetBulb(ColorsEnum color)PS3USB + moveSetRumble(uint8_t rumble)PS3USB + Poll()PS3USBvirtual + printStatusString()PS3USB + PS3ConnectedPS3USB + PS3MoveConnectedPS3USB + PS3NavigationConnectedPS3USB + PS3USB(USB *pUsb, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0)PS3USB + pUsbPS3USBprotected + Release()PS3USBvirtual + ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual + setAllOff()PS3USB + setBdaddr(uint8_t *bdaddr)PS3USB + setLedOff()PS3USBinline + setLedOff(LEDEnum a)PS3USB + setLedOn(LEDEnum a)PS3USB + setLedRaw(uint8_t value)PS3USB + setLedToggle(LEDEnum a)PS3USB + setMoveBdaddr(uint8_t *bdaddr)PS3USB + setRumbleOff()PS3USB + setRumbleOn(RumbleEnum mode)PS3USB + setRumbleOn(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower)PS3USB + VIDPIDOK(uint16_t vid, uint16_t pid)PS3USBinlinevirtual
diff --git a/class_p_s3_u_s_b.html b/class_p_s3_u_s_b.html index 7da9a98f..9ca6ce1a 100644 --- a/class_p_s3_u_s_b.html +++ b/class_p_s3_u_s_b.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS3USB Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -124,18 +125,18 @@ Public Member Functions void getMoveCalibration (uint8_t *data)  
USBDeviceConfig implementation
-virtual uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed) +uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)   -virtual uint8_t Release () +uint8_t Release ()   -virtual uint8_t Poll () +uint8_t Poll ()   virtual uint8_t GetAddress ()   virtual bool isReady ()   -virtual boolean VIDPIDOK (uint16_t vid, uint16_t pid) -  +virtual bool VIDPIDOK (uint16_t vid, uint16_t pid) + 
PS3 Controller functions
bool getButtonPress (ButtonEnum b)   @@ -184,8 +185,10 @@ Public Member Functions   virtual void ResetHubPort (uint8_t port)   -virtual boolean DEVCLASSOK (uint8_t klass) -  +virtual bool DEVCLASSOK (uint8_t klass) +  +virtual bool DEVSUBCLASSOK (uint8_t subklass) +  @@ -210,7 +213,7 @@ Protected Attributes

One can only set the color of the bulb, set the rumble, set and get the bluetooth address and calibrate the magnetometer via USB on the Move controller.

Information about the protocol can be found at the wiki: https://github.com/felis/USB_Host_Shield_2.0/wiki/PS3-Information.

-

Definition at line 58 of file PS3USB.h.

+

Definition at line 49 of file PS3USB.h.

Constructor & Destructor Documentation

@@ -411,7 +414,7 @@ Protected Attributes

Reimplemented from USBDeviceConfig.

-

Definition at line 93 of file PS3USB.h.

+

Definition at line 84 of file PS3USB.h.

@@ -437,11 +440,11 @@ Protected Attributes

Used to check if the controller has been initialized.

Returns
True if it's ready.
-

Definition at line 101 of file PS3USB.h.

+

Definition at line 92 of file PS3USB.h.

- +

Public Attributes

@@ -449,7 +452,7 @@ Protected Attributes

Definition at line 45 of file PS4BT.h.

- - - -
-
-
- + @@ -481,9 +484,9 @@ Protected Attributes
Returns
Returns true if the device's VID and PID matches this driver.
-

Reimplemented from USBDeviceConfig.

+

Reimplemented from USBDeviceConfig.

-

Definition at line 111 of file PS3USB.h.

+

Definition at line 102 of file PS3USB.h.

@@ -959,7 +962,7 @@ Protected Attributes

Turn all LEDs off.

-

Definition at line 224 of file PS3USB.h.

+

Definition at line 215 of file PS3USB.h.

@@ -1151,7 +1154,7 @@ Protected Attributes -

Definition at line 263 of file PS3USB.h.

+

Definition at line 254 of file PS3USB.h.

@@ -1167,7 +1170,7 @@ Protected Attributes

Variable used to indicate if the normal playstation controller is successfully connected.

-

Definition at line 265 of file PS3USB.h.

+

Definition at line 256 of file PS3USB.h.

@@ -1182,7 +1185,7 @@ Protected Attributes

Variable used to indicate if the move controller is successfully connected.

-

Definition at line 271 of file PS3USB.h.

+

Definition at line 262 of file PS3USB.h.

@@ -1197,7 +1200,7 @@ Protected Attributes

Variable used to indicate if the navigation controller is successfully connected.

-

Definition at line 273 of file PS3USB.h.

+

Definition at line 264 of file PS3USB.h.

@@ -1220,7 +1223,7 @@ Protected Attributes

Pointer to USB class instance.

-

Definition at line 277 of file PS3USB.h.

+

Definition at line 268 of file PS3USB.h.

@@ -1243,7 +1246,7 @@ Protected Attributes

Device address.

-

Definition at line 279 of file PS3USB.h.

+

Definition at line 270 of file PS3USB.h.

@@ -1266,7 +1269,7 @@ Protected Attributes

Endpoint info structure.

-

Definition at line 281 of file PS3USB.h.

+

Definition at line 272 of file PS3USB.h.

@@ -1279,7 +1282,7 @@ Protected Attributes diff --git a/class_p_s3_u_s_b__coll__graph.md5 b/class_p_s3_u_s_b__coll__graph.md5 index 4a94ee41..1aae81d3 100644 --- a/class_p_s3_u_s_b__coll__graph.md5 +++ b/class_p_s3_u_s_b__coll__graph.md5 @@ -1 +1 @@ -9e8c5435724f7c7e70dfbe754d4e9919 \ No newline at end of file +06f5f28fefcd0973f7f3cf5ab5f01033 \ No newline at end of file diff --git a/class_p_s3_u_s_b__inherit__graph.md5 b/class_p_s3_u_s_b__inherit__graph.md5 index 44086750..b241da78 100644 --- a/class_p_s3_u_s_b__inherit__graph.md5 +++ b/class_p_s3_u_s_b__inherit__graph.md5 @@ -1 +1 @@ -d6728a689bb029a7cd4f4e23b5bf2c3c \ No newline at end of file +77f7ca570be060c1a40a0845510a4a59 \ No newline at end of file diff --git a/class_p_s4_b_t-members.html b/class_p_s4_b_t-members.html index d2fda1c5..47a6641f 100644 --- a/class_p_s4_b_t-members.html +++ b/class_p_s4_b_t-members.html @@ -3,15 +3,16 @@ - +USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
virtual boolean PS3USB::VIDPIDOK virtual bool PS3USB::VIDPIDOK ( uint16_t  vid,
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -90,9 +91,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

This is the complete list of members for PS4BT, including all inherited members.

- - - + + + + + @@ -111,20 +114,24 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - - - - - - - - + + + + + + + + + + + + - + - + @@ -142,7 +149,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_p_s4_b_t.html b/class_p_s4_b_t.html index a77aa2af..56f3a2e1 100644 --- a/class_p_s4_b_t.html +++ b/class_p_s4_b_t.html @@ -3,15 +3,16 @@ - +USB Host Shield 2.0: PS4BT Class Reference + @@ -31,7 +32,7 @@
ACLData(uint8_t *ACLData)BTHIDvirtual
attachOnInit(void(*funcOnInit)(void))PS4BTinline
BTHID(BTD *p, bool pair=false, const char *pin="0000")BTHID
ACLData(uint8_t *ACLData)BTHIDprotectedvirtual
attachOnInit(void(*funcOnInit)(void))BluetoothServiceinline
BluetoothService(BTD *p)BluetoothServiceinline
BTHID(BTD *p, bool pair=false, const char *pin="0000")BTHID
checkHciHandle(uint8_t *buf, uint16_t handle)BluetoothServiceinlineprotected
connected()PS4BTinline
BTHID::connectedBTHID
control_scidBTHIDprotected
getUsbStatus()PS4Parserinline
getX(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline
getY(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline
hci_handleBTHIDprotected
interrupt_scidBTHIDprotected
isTouching(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline
OnInitBTHID()PS4BTinlineprotectedvirtual
pair(void)BTHIDinline
Parse(uint8_t len, uint8_t *buf)PS4Parserprotected
ParseBTHIDData(uint8_t len, uint8_t *buf)PS4BTinlineprotectedvirtual
pBtdBTHIDprotected
hci_handleBluetoothServiceprotected
identifierBluetoothServiceprotected
interrupt_scidBTHIDprotected
isTouching(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline
l2cap_event_flagBluetoothServiceprotected
onInit()BTHIDinlineprotectedvirtual
OnInitBTHID()PS4BTinlineprotectedvirtual
pair(void)BTHIDinline
Parse(uint8_t len, uint8_t *buf)PS4Parserprotected
ParseBTHIDData(uint8_t len, uint8_t *buf)PS4BTinlineprotectedvirtual
pBtdBluetoothServiceprotected
pFuncOnInitBluetoothServiceprotected
PS4BT(BTD *p, bool pair=false, const char *pin="0000")PS4BTinline
PS4Parser()PS4Parserinline
BTHID::Reset()BTHIDvirtual
BTHID::Reset()BTHIDprotectedvirtual
PS4Parser::Reset()PS4Parserinlineprotected
ResetBTHID()PS4BTinlineprotectedvirtual
Run()BTHIDvirtual
Run()BTHIDprotectedvirtual
sendOutputReport(PS4Output *output)PS4BTinlineprotectedvirtual
setAllOff()PS4Parserinline
setLed(uint8_t r, uint8_t g, uint8_t b)PS4Parserinline
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -104,7 +105,7 @@ Collaboration diagram for PS4BT:
Collaboration graph
- +
[legend]
- - @@ -128,16 +127,13 @@ Public Member Functions - - - - - - - - - + + + + + + @@ -198,7 +194,18 @@ Protected Member Functions - + + + + + + + + + + + + @@ -211,14 +218,21 @@ Additional Inherited Members - - - - + + + + + + + + + + +

@@ -113,8 +114,6 @@ Public Member Functions

 
bool connected ()
 
void attachOnInit (void(*funcOnInit)(void))
 
- Public Member Functions inherited from BTHID
 BTHID (BTD *p, bool pair=false, const char *pin="0000")
 
 
void pair (void)
 
void attachOnInit (void(*funcOnInit)(void))
 
virtual void ACLData (uint8_t *ACLData)
 
virtual void Run ()
 
virtual void Reset ()
 
virtual void disconnect ()
void disconnect ()
 
- Public Member Functions inherited from BluetoothService
 BluetoothService (BTD *p)
 
void attachOnInit (void(*funcOnInit)(void))
 
- Public Member Functions inherited from PS4Parser
 PS4Parser ()
 
PS4Parser implementation
virtual void sendOutputReport (PS4Output *output)
 
Overridable functions
- Protected Member Functions inherited from BTHID
void ACLData (uint8_t *ACLData)
 
void Run ()
 
void Reset ()
 
void onInit ()
 
- Protected Member Functions inherited from BluetoothService
bool checkHciHandle (uint8_t *buf, uint16_t handle)
 
- Protected Member Functions inherited from PS4Parser
void Parse (uint8_t len, uint8_t *buf)
 
bool connected
 
- Protected Attributes inherited from BTHID
BTDpBtd
 
uint16_t hci_handle
 
uint8_t control_scid [2]
 
uint8_t interrupt_scid [2]
 
- Protected Attributes inherited from BluetoothService
void(* pFuncOnInit )(void)
 
BTDpBtd
 
uint16_t hci_handle
 
uint32_t l2cap_event_flag
 
uint8_t identifier
 

Detailed Description

This class implements support for the PS4 controller via Bluetooth. It uses the BTHID class for all the Bluetooth communication.

@@ -300,38 +314,6 @@ Additional Inherited Members
- - - - -
- - - - - - - - -
void PS4BT::attachOnInit (void(*)(void) funcOnInit)
-
-inline
-
-

Used to call your own function when the device is successfully initialized.

Parameters
- - -
funcOnInitFunction to call.
-
-
- -

Definition at line 53 of file PS4BT.h.

-
@@ -375,7 +357,7 @@ Additional Inherited Members

Reimplemented from BTHID.

-

Definition at line 64 of file PS4BT.h.

+

Definition at line 56 of file PS4BT.h.

@@ -403,7 +385,7 @@ Additional Inherited Members

Reimplemented from BTHID.

-

Definition at line 73 of file PS4BT.h.

+

Definition at line 65 of file PS4BT.h.

@@ -431,7 +413,7 @@ Additional Inherited Members

Reimplemented from BTHID.

-

Definition at line 83 of file PS4BT.h.

+

Definition at line 75 of file PS4BT.h.

@@ -465,7 +447,7 @@ Additional Inherited Members

Implements PS4Parser.

-

Definition at line 89 of file PS4BT.h.

+

Definition at line 81 of file PS4BT.h.

@@ -477,7 +459,7 @@ Additional Inherited Members diff --git a/class_p_s4_b_t__coll__graph.map b/class_p_s4_b_t__coll__graph.map index 971b5051..9a5d60b0 100644 --- a/class_p_s4_b_t__coll__graph.map +++ b/class_p_s4_b_t__coll__graph.map @@ -1,11 +1,11 @@ - - + + - + diff --git a/class_p_s4_b_t__coll__graph.md5 b/class_p_s4_b_t__coll__graph.md5 index 15bc6a9e..57a44763 100644 --- a/class_p_s4_b_t__coll__graph.md5 +++ b/class_p_s4_b_t__coll__graph.md5 @@ -1 +1 @@ -bd3d43880c0d25a1a94cad2c30ff5cdc \ No newline at end of file +4bb85a2b4d5163f1d591f32b835727dc \ No newline at end of file diff --git a/class_p_s4_b_t__coll__graph.png b/class_p_s4_b_t__coll__graph.png index decf2db2..d96b67a9 100644 Binary files a/class_p_s4_b_t__coll__graph.png and b/class_p_s4_b_t__coll__graph.png differ diff --git a/class_p_s4_b_t__inherit__graph.md5 b/class_p_s4_b_t__inherit__graph.md5 index 732559f1..22e73541 100644 --- a/class_p_s4_b_t__inherit__graph.md5 +++ b/class_p_s4_b_t__inherit__graph.md5 @@ -1 +1 @@ -6968257051e0d345ab838bb416a09380 \ No newline at end of file +405752bfa16040ed3832aa96d3e4fa2f \ No newline at end of file diff --git a/class_p_s4_parser-members.html b/class_p_s4_parser-members.html index f10987a1..ac5d0109 100644 --- a/class_p_s4_parser-members.html +++ b/class_p_s4_parser-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -121,7 +122,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/class_p_s4_parser.html b/class_p_s4_parser.html index fd8e7f47..7f8f1a26 100644 --- a/class_p_s4_parser.html +++ b/class_p_s4_parser.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS4Parser Class Reference + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -1028,7 +1029,7 @@ Protected Member Functions diff --git a/class_p_s4_parser__inherit__graph.md5 b/class_p_s4_parser__inherit__graph.md5 index 3664c5e9..7d6cd78a 100644 --- a/class_p_s4_parser__inherit__graph.md5 +++ b/class_p_s4_parser__inherit__graph.md5 @@ -1 +1 @@ -3640c7e8714d328b9cdd367ff0a243af \ No newline at end of file +b842fe07d690c9e08045bf8e0d96d45b \ No newline at end of file diff --git a/class_p_s4_u_s_b-members.html b/class_p_s4_u_s_b-members.html index e19d7529..d81cdb0d 100644 --- a/class_p_s4_u_s_b-members.html +++ b/class_p_s4_u_s_b-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
- + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -95,75 +96,77 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); bHasReportIdHIDUniversalprotected ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)USBDeviceConfiginlinevirtual connected()PS4USBinline - DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual - EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)HIDUniversalvirtual - epInfoHIDUniversalprotected - epInterruptInIndexHIDprotectedstatic - epInterruptOutIndexHIDprotectedstatic - GetAddress()HIDUniversalinlinevirtual - getAnalogButton(ButtonEnum b)PS4Parser - getAnalogHat(AnalogHatEnum a)PS4Parser - getAngle(AngleEnum a)PS4Parserinline - getAudioStatus()PS4Parserinline - getBatteryLevel()PS4Parserinline - getButtonClick(ButtonEnum b)PS4Parser - getButtonPress(ButtonEnum b)PS4Parser - GetHidDescr(uint8_t ep, uint16_t nbytes, uint8_t *dataptr)HID - GetIdle(uint8_t iface, uint8_t reportID, uint8_t *dataptr)HID - getMicStatus()PS4Parserinline - GetProtocol(uint8_t iface, uint8_t *dataptr)HID - GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID - GetReportDescr(uint16_t wIndex, USBReadParser *parser=NULL)HID - GetReportParser(uint8_t id)HIDUniversalprotectedvirtual - getSensor(SensorEnum s)PS4Parserinline - getTouchCounter(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline - GetUsb()HIDinline - getUsbStatus()PS4Parserinline - getX(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline - getY(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline - HID(USB *pusb)HIDinline - hidInterfacesHIDUniversalprotected - HIDUniversal(USB *p)HIDUniversal - Init(uint8_t parent, uint8_t port, bool lowspeed)HIDUniversalvirtual - isReady()HIDUniversalinlinevirtual - isTouching(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline - maxEpPerInterfaceHIDprotectedstatic - maxHidInterfacesHIDprotectedstatic - OnInitSuccessful()PS4USBinlineprotectedvirtual - Parse(uint8_t len, uint8_t *buf)PS4Parserprotected - ParseHIDData(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)PS4USBinlineprotectedvirtual - PIDHIDUniversalprotected - Poll()HIDUniversalvirtual - PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)HIDprotected - PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc)HIDprotected - PS4Parser()PS4Parserinline - PS4USB(USB *p)PS4USBinline - pUsbHIDprotected - Release()HIDUniversalvirtual - Reset()PS4Parserinlineprotected - ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual - sendOutputReport(PS4Output *output)PS4USBinlineprotectedvirtual - setAllOff()PS4Parserinline - SetIdle(uint8_t iface, uint8_t reportID, uint8_t duration)HID - setLed(uint8_t r, uint8_t g, uint8_t b)PS4Parserinline - setLed(ColorsEnum color)PS4Parserinline - setLedFlash(uint8_t flashOn, uint8_t flashOff)PS4Parserinline - setLedOff()PS4Parserinline - SetProtocol(uint8_t iface, uint8_t protocol)HID - SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID - SetReportParser(uint8_t id, HIDReportParser *prs)HIDUniversalvirtual - setRumbleOff()PS4Parserinline - setRumbleOn(RumbleEnum mode)PS4Parserinline - setRumbleOn(uint8_t bigRumble, uint8_t smallRumble)PS4Parserinline + DEVCLASSOK(uint8_t klass)USBDeviceConfiginlinevirtual + DEVSUBCLASSOK(uint8_t subklass)USBDeviceConfiginlinevirtual + EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)HIDUniversalvirtual + epInfoHIDUniversalprotected + epInterruptInIndexHIDprotectedstatic + epInterruptOutIndexHIDprotectedstatic + GetAddress()HIDUniversalinlinevirtual + getAnalogButton(ButtonEnum b)PS4Parser + getAnalogHat(AnalogHatEnum a)PS4Parser + getAngle(AngleEnum a)PS4Parserinline + getAudioStatus()PS4Parserinline + getBatteryLevel()PS4Parserinline + getButtonClick(ButtonEnum b)PS4Parser + getButtonPress(ButtonEnum b)PS4Parser + GetHidDescr(uint8_t ep, uint16_t nbytes, uint8_t *dataptr)HID + GetIdle(uint8_t iface, uint8_t reportID, uint8_t *dataptr)HID + getMicStatus()PS4Parserinline + GetProtocol(uint8_t iface, uint8_t *dataptr)HID + GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID + GetReportDescr(uint16_t wIndex, USBReadParser *parser=NULL)HID + GetReportParser(uint8_t id)HIDUniversalprotectedvirtual + getSensor(SensorEnum s)PS4Parserinline + getTouchCounter(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline + GetUsb()HIDinline + getUsbStatus()PS4Parserinline + getX(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline + getY(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline + HID(USB *pusb)HIDinline + hidInterfacesHIDUniversalprotected + HIDUniversal(USB *p)HIDUniversal + Init(uint8_t parent, uint8_t port, bool lowspeed)HIDUniversalvirtual + isReady()HIDUniversalinlinevirtual + isTouching(uint8_t finger=0, uint8_t xyId=0)PS4Parserinline + maxEpPerInterfaceHIDprotectedstatic + maxHidInterfacesHIDprotectedstatic + OnInitSuccessful()PS4USBinlineprotectedvirtual + Parse(uint8_t len, uint8_t *buf)PS4Parserprotected + ParseHIDData(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)PS4USBinlineprotectedvirtual + PIDHIDUniversalprotected + Poll()HIDUniversalvirtual + PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)HIDprotected + PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc)HIDprotected + PS4Parser()PS4Parserinline + PS4USB(USB *p)PS4USBinline + pUsbHIDprotected + Release()HIDUniversalvirtual + Reset()PS4Parserinlineprotected + ResetHubPort(uint8_t port)USBDeviceConfiginlinevirtual + sendOutputReport(PS4Output *output)PS4USBinlineprotectedvirtual + setAllOff()PS4Parserinline + SetIdle(uint8_t iface, uint8_t reportID, uint8_t duration)HID + setLed(uint8_t r, uint8_t g, uint8_t b)PS4Parserinline + setLed(ColorsEnum color)PS4Parserinline + setLedFlash(uint8_t flashOn, uint8_t flashOff)PS4Parserinline + setLedOff()PS4Parserinline + SetProtocol(uint8_t iface, uint8_t protocol)HID + SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)HID + SetReportParser(uint8_t id, HIDReportParser *prs)HIDUniversalvirtual + setRumbleOff()PS4Parserinline + setRumbleOn(RumbleEnum mode)PS4Parserinline + setRumbleOn(uint8_t bigRumble, uint8_t smallRumble)PS4Parserinline + SndRpt(uint16_t nbytes, uint8_t *dataptr)HIDUniversal totalEndpointsHIDprotectedstatic VIDHIDUniversalprotected - VIDPIDOK(uint16_t vid, uint16_t pid)USBDeviceConfiginlinevirtual + VIDPIDOK(uint16_t vid, uint16_t pid)PS4USBinlineprotectedvirtual
diff --git a/class_p_s4_u_s_b.html b/class_p_s4_u_s_b.html index 3b12d617..fe7fff48 100644 --- a/class_p_s4_u_s_b.html +++ b/class_p_s4_u_s_b.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS4USB Class Reference + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -118,20 +119,22 @@ Public Member Functions - Public Member Functions inherited from HIDUniversal  HIDUniversal (USB *p)   -virtual bool SetReportParser (uint8_t id, HIDReportParser *prs) +bool SetReportParser (uint8_t id, HIDReportParser *prs)   -virtual uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed) +uint8_t Init (uint8_t parent, uint8_t port, bool lowspeed)   -virtual uint8_t Release () +uint8_t Release ()   -virtual uint8_t Poll () +uint8_t Poll ()   virtual uint8_t GetAddress ()   virtual bool isReady ()   -virtual void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) +void EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)   +uint8_t SndRpt (uint16_t nbytes, uint8_t *dataptr) +  - Public Member Functions inherited from HID  HID (USB *pusb)   @@ -158,10 +161,10 @@ Public Member Functions   virtual void ResetHubPort (uint8_t port)   -virtual boolean VIDPIDOK (uint16_t vid, uint16_t pid) -  -virtual boolean DEVCLASSOK (uint8_t klass) -  +virtual bool DEVCLASSOK (uint8_t klass) +  +virtual bool DEVSUBCLASSOK (uint8_t subklass) +  - Public Member Functions inherited from PS4Parser  PS4Parser ()   @@ -220,8 +223,11 @@ Protected Member Functions
PS4Parser implementation
virtual void sendOutputReport (PS4Output *output)   +
USBDeviceConfig implementation
+virtual bool VIDPIDOK (uint16_t vid, uint16_t pid) +  - Protected Member Functions inherited from HIDUniversal -virtual HIDReportParserGetReportParser (uint8_t id) +HIDReportParserGetReportParser (uint8_t id)   - Protected Member Functions inherited from HID void PrintEndpointDescriptor (const USB_ENDPOINT_DESCRIPTOR *ep_ptr) @@ -479,6 +485,52 @@ Additional Inherited Members

Definition at line 90 of file PS4USB.h.

+
+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual bool PS4USB::VIDPIDOK (uint16_t vid,
uint16_t pid 
)
+
+inlineprotectedvirtual
+
+

Used by the USB core to check what this driver support.

Parameters
+ + + +
vidThe device's VID.
pidThe device's PID.
+
+
+
Returns
Returns true if the device's VID and PID matches this driver.
+ +

Reimplemented from USBDeviceConfig.

+ +

Definition at line 122 of file PS4USB.h.

+

The documentation for this class was generated from the following file: @@ -138,7 +146,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_f.html b/functions_func_f.html index 47a84869..37fd4fd0 100644 --- a/functions_func_f.html +++ b/functions_func_f.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@ - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -123,7 +124,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

- f -

- + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -137,6 +138,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , USBDeviceConfig , USBHub , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -154,6 +156,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , PS4Parser , WII , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -189,6 +192,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , PSBuzz , WII , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -199,6 +203,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , PSBuzz , WII , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -397,7 +402,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_h.html b/functions_func_h.html index d897663e..dd6165ba 100644 --- a/functions_func_h.html +++ b/functions_func_h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
- + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -122,8 +123,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');  

- h -

- + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
@@ -146,8 +147,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : USBDeviceConfig , USBHub , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB +, XR21B1411
  • Initialize() : ByteSkipper @@ -172,9 +175,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : ACM , ADK , BTD +, HIDBoot< BOOT_PROTOCOL > , HIDUniversal , PS3USB , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB
  • @@ -187,7 +192,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_k.html b/functions_func_k.html index 1acbc832..005d5283 100644 --- a/functions_func_k.html +++ b/functions_func_k.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
    - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -131,7 +132,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_l.html b/functions_func_l.html index 263ee348..b23f7865 100644 --- a/functions_func_l.html +++ b/functions_func_l.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
    - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -161,7 +162,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_m.html b/functions_func_m.html index 6f1d1203..65de91a7 100644 --- a/functions_func_m.html +++ b/functions_func_m.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
    - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -148,7 +149,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_n.html b/functions_func_n.html index 34a5022f..ec762e69 100644 --- a/functions_func_n.html +++ b/functions_func_n.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
    - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -140,7 +141,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_o.html b/functions_func_o.html index 52fbd1db..ab5d0eeb 100644 --- a/functions_func_o.html +++ b/functions_func_o.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
    - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -128,10 +129,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • OnControlKeysChanged() : KeyboardReportParser
  • +
  • onInit() +: BluetoothService +, BTHID +
  • OnInit() : BulkOnly -, CDCAsyncOper -, FTDIAsyncOper +, CDCAsyncOper +, FTDIAsyncOper +
  • +
  • onInit() +: PS3BT +, SPP +, WII
  • OnInitBTHID() : BTHID @@ -163,6 +173,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • OnMouseMove() : MouseReportParser
  • +
  • OnRelease() +: FTDIAsyncOper +
  • OnRightButtonDown() : MouseReportParser
  • @@ -181,7 +194,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_p.html b/functions_func_p.html index 80362ba2..1d886f65 100644 --- a/functions_func_p.html +++ b/functions_func_p.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
    - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -177,6 +178,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , USBDeviceConfig , USBHub , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -278,7 +280,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_r.html b/functions_func_r.html index 934512ef..db88fdbe 100644 --- a/functions_func_r.html +++ b/functions_func_r.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
    - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -133,15 +134,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • read() : SPP
  • +
  • read_register() +: XR21B1411 +
  • readPollInterval() : BTD
  • +
  • registerBluetoothService() +: BTD +
  • RegisterDeviceClass() : USB
  • -
  • registerServiceClass() -: BTD -
  • regRd() : MAX3421e< SPI_SS, INTR >
  • @@ -160,6 +164,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , USBDeviceConfig , USBHub , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -173,7 +178,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : ReportDescParserBase
  • Reset() -: BluetoothService +: BluetoothService , BTHID
  • reset() @@ -201,7 +206,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Max_LCD
  • Run() -: BluetoothService +: BluetoothService , BTHID , PS3BT , SPP @@ -213,7 +218,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_s.html b/functions_func_s.html index 73d726d4..2592b270 100644 --- a/functions_func_s.html +++ b/functions_func_s.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
  • - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -294,7 +295,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • setRumbleOn() : PS3BT , PS3USB -, PS4Parser +, PS4Parser , WII , XBOXOLD , XBOXRECV @@ -320,6 +321,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , ADK , FTDI
  • +
  • SndRpt() +: HIDUniversal +
  • SPP() : SPP
  • @@ -329,7 +333,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_t.html b/functions_func_t.html index 12e9d56b..ea54ffba 100644 --- a/functions_func_t.html +++ b/functions_func_t.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
    - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -132,7 +133,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_u.html b/functions_func_u.html index e573eca8..fdd921dc 100644 --- a/functions_func_u.html +++ b/functions_func_u.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
    - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -134,7 +135,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_v.html b/functions_func_v.html index 247a7fd4..ecce6d8c 100644 --- a/functions_func_v.html +++ b/functions_func_v.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@
    - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -126,14 +127,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : MAX3421e< SPI_SS, INTR >
  • VIDPIDOK() -: ADK -, BTD -, PS3USB -, PSBuzz -, USBDeviceConfig -, XBOXOLD -, XBOXRECV -, XBOXUSB +: ADK +, BTD +, FTDI +, PS3USB +, PS4USB +, PSBuzz +, USBDeviceConfig +, XBOXOLD +, XBOXONE +, XBOXRECV +, XBOXUSB +, XR21B1411
  • @@ -141,7 +146,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_w.html b/functions_func_w.html index 5b4da08a..0a33d47d 100644 --- a/functions_func_w.html +++ b/functions_func_w.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@ - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -122,6 +123,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');  

    - w -

    @@ -141,7 +148,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_x.html b/functions_func_x.html index e3f813ee..7a27072a 100644 --- a/functions_func_x.html +++ b/functions_func_x.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Functions + @@ -31,7 +32,7 @@ - + @@ -109,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -125,19 +126,25 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • XBOXOLD() : XBOXOLD
  • +
  • XBOXONE() +: XBOXONE +
  • XBOXRECV() : XBOXRECV
  • XBOXUSB() : XBOXUSB
  • +
  • XR21B1411() +: XR21B1411 +
  • diff --git a/functions_g.html b/functions_g.html index 9642cd46..54e6e073 100644 --- a/functions_g.html +++ b/functions_g.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@ - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -166,6 +168,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , USBDeviceConfig , USBHub , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -181,8 +184,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : PS3BT , PS3USB , PS4Parser -, WII +, WII , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -218,6 +222,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , PSBuzz , WII , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -228,6 +233,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , PSBuzz , WII , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -465,7 +471,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_h.html b/functions_h.html index d2b236d8..b6d6ecad 100644 --- a/functions_h.html +++ b/functions_h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -124,8 +126,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    Here is a list of all class members with links to the classes they belong to:

    - h -

    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -127,6 +129,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • iConfiguration : USB_CONFIGURATION_DESCRIPTOR
  • +
  • identifier +: BluetoothService +
  • idProduct : USB_DEVICE_DESCRIPTOR
  • @@ -175,8 +180,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : USBDeviceConfig , USBHub , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB +, XR21B1411
  • Initialize() : ByteSkipper @@ -210,9 +217,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : ACM , ADK , BTD +, HIDBoot< BOOT_PROTOCOL > , HIDUniversal , PS3USB , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB
  • @@ -234,7 +243,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_k.html b/functions_k.html index 41937143..b08042a5 100644 --- a/functions_k.html +++ b/functions_k.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -131,7 +133,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : KeyboardReportParser
  • kbdLockingKeys -: KeyboardReportParser +: KeyboardReportParser
  • KeyboardReportParser() : KeyboardReportParser @@ -145,7 +147,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_l.html b/functions_l.html index 911a4e30..d7839109 100644 --- a/functions_l.html +++ b/functions_l.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
  • - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -151,6 +153,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • l2cap_disconnection_response() : BTD
  • +
  • l2cap_event_flag +: BluetoothService +
  • l2cap_information_response() : BTD
  • @@ -239,7 +244,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_m.html b/functions_m.html index 2b601c07..96a938a9 100644 --- a/functions_m.html +++ b/functions_m.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -211,7 +213,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_n.html b/functions_n.html index 125d0f61..52dd48d6 100644 --- a/functions_n.html +++ b/functions_n.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -148,7 +150,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_o.html b/functions_o.html index d3308ed5..60cc19af 100644 --- a/functions_o.html +++ b/functions_o.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -130,10 +132,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • OnControlKeysChanged() : KeyboardReportParser
  • +
  • onInit() +: BluetoothService +, BTHID +
  • OnInit() : BulkOnly -, CDCAsyncOper -, FTDIAsyncOper +, CDCAsyncOper +, FTDIAsyncOper +
  • +
  • onInit() +: PS3BT +, SPP +, WII
  • OnInitBTHID() : BTHID @@ -165,6 +176,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • OnMouseMove() : MouseReportParser
  • +
  • OnRelease() +: FTDIAsyncOper +
  • OnRightButtonDown() : MouseReportParser
  • @@ -200,7 +214,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_p.html b/functions_p.html index 102e3709..44c5b335 100644 --- a/functions_p.html +++ b/functions_p.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -174,7 +176,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : ACM
  • pBtd -: BTHID +: BluetoothService
  • peek() : SPP @@ -182,6 +184,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • PeripheralQualifier : InquiryResponse
  • +
  • pFuncOnInit +: BluetoothService +
  • pfUsage : ReportDescParserBase
  • @@ -209,6 +214,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , USBDeviceConfig , USBHub , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -216,7 +222,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : HubDescriptor
  • prevState -: KeyboardReportParser +: KeyboardReportParser
  • PrintAlphanumDisplayPageUsage() : ReportDescParserBase @@ -339,6 +345,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , HID , PS3USB , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB
  • @@ -351,7 +358,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_q.html b/functions_q.html index 2301eac7..1a4ace9d 100644 --- a/functions_q.html +++ b/functions_q.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -135,7 +137,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_r.html b/functions_r.html index fd272c9f..e69f145a 100644 --- a/functions_r.html +++ b/functions_r.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -153,11 +155,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • read() : SPP
  • +
  • read_register() +: XR21B1411 +
  • readPollInterval() : BTD
  • ready -: ACM +: ACM , ADK
  • recipient @@ -166,12 +171,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • red : PSBUZZButtons
  • +
  • registerBluetoothService() +: BTD +
  • RegisterDeviceClass() : USB
  • -
  • registerServiceClass() -: BTD -
  • regRd() : MAX3421e< SPI_SS, INTR >
  • @@ -193,6 +198,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , USBDeviceConfig , USBHub , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -218,7 +224,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : ReportDescParserBase
  • ReqType_u -: SETUP_PKT +: SETUP_PKT
  • Res : InquiryResponse @@ -231,7 +237,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : InquiryResponse
  • Reset() -: BluetoothService +: BluetoothService , BTHID
  • reset() @@ -280,7 +286,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : ReportDescParserBase
  • Run() -: BluetoothService +: BluetoothService , BTHID , PS3BT , SPP @@ -292,7 +298,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_s.html b/functions_s.html index fbde0278..14da2732 100644 --- a/functions_s.html +++ b/functions_s.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
  • - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -351,6 +353,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , ADK , FTDI +
  • SndRpt() +: HIDUniversal +
  • SoftReset : InquiryResponse
  • @@ -381,7 +386,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_t.html b/functions_t.html index 5d0ab450..f520b4b4 100644 --- a/functions_t.html +++ b/functions_t.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -182,6 +184,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • TTThinkTime : HubDescriptor
  • +
  • tty +: tty_features +
  • type : SETUP_PKT
  • @@ -191,7 +196,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_type.html b/functions_type.html index e7d78d8f..2b1fa5f9 100644 --- a/functions_type.html +++ b/functions_type.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Typedefs + @@ -31,7 +32,7 @@
    - + @@ -83,7 +84,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -95,7 +96,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); @@ -103,7 +104,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_u.html b/functions_u.html index 3ef6b8c5..2e9dca9d 100644 --- a/functions_u.html +++ b/functions_u.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -131,7 +133,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : BASICCDB
  • UsagePageFunc -: ReportDescParserBase +: ReportDescParserBase
  • usagePageFunctions : ReportDescParserBase @@ -157,7 +159,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_v.html b/functions_v.html index 4eab2f70..6a3dc7c1 100644 --- a/functions_v.html +++ b/functions_v.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
  • - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -150,14 +152,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : HIDUniversal
  • VIDPIDOK() -: ADK -, BTD -, PS3USB -, PSBuzz -, USBDeviceConfig -, XBOXOLD -, XBOXRECV -, XBOXUSB +: ADK +, BTD +, FTDI +, PS3USB +, PS4USB +, PSBuzz +, USBDeviceConfig +, XBOXOLD +, XBOXONE +, XBOXRECV +, XBOXUSB +, XR21B1411
  • vrTitles0 : ReportDescParserBase @@ -174,7 +180,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars.html b/functions_vars.html index 2f8528c5..98c55914 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
  • - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -123,100 +125,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
      -

    - a -

    @@ -224,7 +135,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_a.html b/functions_vars_a.html new file mode 100644 index 00000000..c7525240 --- /dev/null +++ b/functions_vars_a.html @@ -0,0 +1,241 @@ + + + + + + +USB Host Shield 2.0: Class Members - Variables + + + + + + + + + + + +
    +
    + + + + + + +
    +
    USB Host Shield 2.0 +
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    +  + +

    - a -

    +
    + + + + diff --git a/functions_vars_b.html b/functions_vars_b.html index 494f323e..8db4e403 100644 --- a/functions_vars_b.html +++ b/functions_vars_b.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -144,6 +146,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , HID , PS3USB , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB @@ -479,7 +482,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : LINE_CODING
  • bPollEnable -: ACM +: ACM , BulkOnly
  • bPwrOn2PwrGood @@ -532,7 +535,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • btn : PS4Data -, PSBUZZButtons +, PSBUZZButtons
  • bType : HidItemPrefix @@ -543,7 +546,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_c.html b/functions_vars_c.html index 2e04f501..dcaa3483 100644 --- a/functions_vars_c.html +++ b/functions_vars_c.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
  • - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -222,7 +224,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_d.html b/functions_vars_d.html index 995d6b64..204ba679 100644 --- a/functions_vars_d.html +++ b/functions_vars_d.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -195,7 +197,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_e.html b/functions_vars_e.html index ef33c223..45c95b87 100644 --- a/functions_vars_e.html +++ b/functions_vars_e.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -127,6 +129,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • ENCSERV : InquiryResponse
  • +
  • enhanced +: tty_features +
  • epAddr : EpInfo
  • @@ -159,6 +164,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • epInfo : XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB
  • @@ -179,7 +185,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_f.html b/functions_vars_f.html index 9aba5d2d..dd51fbc5 100644 --- a/functions_vars_f.html +++ b/functions_vars_f.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -125,7 +127,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

    - f -

    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -196,7 +198,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_h.html b/functions_vars_h.html index c726d792..f3363d80 100644 --- a/functions_vars_h.html +++ b/functions_vars_h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -124,12 +126,15 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');  

    - h -

    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -127,6 +129,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • iConfiguration : USB_CONFIGURATION_DESCRIPTOR
  • +
  • identifier +: BluetoothService +
  • idProduct : USB_DEVICE_DESCRIPTOR
  • @@ -175,7 +180,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_k.html b/functions_vars_k.html index e0599bcc..cee9e1ba 100644 --- a/functions_vars_k.html +++ b/functions_vars_k.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -131,7 +133,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : KeyboardReportParser
  • kbdLockingKeys -: KeyboardReportParser +: KeyboardReportParser
  • Keys : KBDINFO @@ -142,7 +144,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_l.html b/functions_vars_l.html index 6a991b69..8a44453c 100644 --- a/functions_vars_l.html +++ b/functions_vars_l.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
  • - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -130,6 +132,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • l2 : PS4Buttons
  • +
  • l2cap_event_flag +: BluetoothService +
  • l2capConnectionClaimed : BTD
  • @@ -206,7 +211,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_m.html b/functions_vars_m.html index 5eb7db3a..bad23287 100644 --- a/functions_vars_m.html +++ b/functions_vars_m.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -185,7 +187,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_n.html b/functions_vars_n.html index 27d548a7..fa6b3d06 100644 --- a/functions_vars_n.html +++ b/functions_vars_n.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -136,7 +138,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_o.html b/functions_vars_o.html index d29517c2..3413c9e9 100644 --- a/functions_vars_o.html +++ b/functions_vars_o.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -147,7 +149,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_p.html b/functions_vars_p.html index 3882b490..1d5b1149 100644 --- a/functions_vars_p.html +++ b/functions_vars_p.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -134,11 +136,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : ACM
  • pBtd -: BTHID +: BluetoothService
  • PeripheralQualifier : InquiryResponse
  • +
  • pFuncOnInit +: BluetoothService +
  • pfUsage : ReportDescParserBase
  • @@ -155,7 +160,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : HubDescriptor
  • prevState -: KeyboardReportParser +: KeyboardReportParser
  • ProductID : InquiryResponse @@ -186,6 +191,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , HID , PS3USB , XBOXOLD +, XBOXONE , XBOXRECV , XBOXUSB
  • @@ -198,7 +204,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_q.html b/functions_vars_q.html index dc33ac16..7281e801 100644 --- a/functions_vars_q.html +++ b/functions_vars_q.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -135,7 +137,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_r.html b/functions_vars_r.html index 50ace537..c763c593 100644 --- a/functions_vars_r.html +++ b/functions_vars_r.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -143,7 +145,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : PS4Buttons
  • ready -: ACM +: ACM , ADK
  • recipient @@ -168,7 +170,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : PS4Buttons
  • ReqType_u -: SETUP_PKT +: SETUP_PKT
  • Res : InquiryResponse @@ -207,7 +209,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_s.html b/functions_vars_s.html index 74597112..d9f434d1 100644 --- a/functions_vars_s.html +++ b/functions_vars_s.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
  • - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -180,7 +182,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_t.html b/functions_vars_t.html index d39d8e39..4e5b7210 100644 --- a/functions_vars_t.html +++ b/functions_vars_t.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -178,6 +180,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • TTThinkTime : HubDescriptor
  • +
  • tty +: tty_features +
  • type : SETUP_PKT
  • @@ -187,7 +192,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_u.html b/functions_vars_u.html index 5a739d2e..84720ce5 100644 --- a/functions_vars_u.html +++ b/functions_vars_u.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -148,7 +150,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_v.html b/functions_vars_v.html index aa9b745d..0e9746db 100644 --- a/functions_vars_v.html +++ b/functions_vars_v.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -161,7 +163,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_w.html b/functions_vars_w.html index 885da766..36498fa8 100644 --- a/functions_vars_w.html +++ b/functions_vars_w.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -131,6 +133,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : HID_CLASS_DESCRIPTOR_LEN_AND_TYPE , USB_HID_DESCRIPTOR +
  • wide +: tty_features +
  • WideBus16Bit : InquiryResponse
  • @@ -164,7 +169,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : USB_CONFIGURATION_DESCRIPTOR
  • wVal_u -: SETUP_PKT +: SETUP_PKT
  • wValue : CLASS_NOTIFICATION @@ -182,7 +187,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_x.html b/functions_vars_x.html index 9e30c351..1f6cd951 100644 --- a/functions_vars_x.html +++ b/functions_vars_x.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
  • - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -134,6 +136,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • XboxConnected : XBOXOLD
  • +
  • XboxOneConnected +: XBOXONE +
  • XboxReceiverConnected : XBOXRECV
  • @@ -146,7 +151,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars_y.html b/functions_vars_y.html index 57f99169..dd9b85d7 100644 --- a/functions_vars_y.html +++ b/functions_vars_y.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members - Variables + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -142,7 +144,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_w.html b/functions_w.html index bdc2926b..8344b3a6 100644 --- a/functions_w.html +++ b/functions_w.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -131,6 +133,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : HID_CLASS_DESCRIPTOR_LEN_AND_TYPE , USB_HID_DESCRIPTOR +
  • wide() +: ACM +, tty_features +
  • WideBus16Bit : InquiryResponse
  • @@ -167,17 +173,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Max_LCD , SPP +
  • write_register() +: XR21B1411 +
  • WriteOk : BulkOnly
  • WriteProtected() -: BulkOnly +: BulkOnly
  • wTotalLength : USB_CONFIGURATION_DESCRIPTOR
  • wVal_u -: SETUP_PKT +: SETUP_PKT
  • wValue : CLASS_NOTIFICATION @@ -195,7 +204,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_x.html b/functions_x.html index f752de5e..b8b2fc61 100644 --- a/functions_x.html +++ b/functions_x.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
  • - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -137,6 +139,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • XBOXOLD() : XBOXOLD
  • +
  • XBOXONE() +: XBOXONE +
  • +
  • XboxOneConnected +: XBOXONE +
  • XboxReceiverConnected : XBOXRECV
  • @@ -146,6 +154,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • XBOXUSB() : XBOXUSB
  • +
  • XR21B1411() +: XR21B1411 +
  • xy : PS4Data
  • @@ -155,7 +166,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_y.html b/functions_y.html index 2c55995b..3a6252f8 100644 --- a/functions_y.html +++ b/functions_y.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Members + @@ -31,7 +32,7 @@
    - + @@ -79,7 +80,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); +
    @@ -142,7 +144,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals.html b/globals.html index 1bf86055..382602f1 100644 --- a/globals.html +++ b/globals.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -131,13 +132,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • __HIDUSAGETITLEARRAYS_H__ : hidusagetitlearrays.cpp
  • +
  • __PGMSPACE_H_ +: version_helper.h +
  • +
  • _SFR_BYTE +: version_helper.h +
  • diff --git a/globals_a.html b/globals_a.html index d1a57df8..087ea679 100644 --- a/globals_a.html +++ b/globals_a.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@ - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -218,7 +219,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_b.html b/globals_b.html index f8ea314c..20f2b337 100644 --- a/globals_b.html +++ b/globals_b.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -567,22 +568,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : BTD.h
  • bmREQ_HID_IN -: PS3USB.h +: hid.h
  • bmREQ_HID_OUT -: XBOXUSB.h -, XBOXOLD.h -, BTD.h -, PS3USB.h +: hid.h
  • -
  • bmREQ_HIDIN -: hid.h -
  • -
  • bmREQ_HIDOUT -: hid.h -
  • -
  • bmREQ_HIDREPORT -: hid.h +
  • bmREQ_HID_REPORT +: hid.h
  • bmREQ_MASSIN : masstorage.h @@ -728,7 +720,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_c.html b/globals_c.html index 230792df..17bd7a9a 100644 --- a/globals_c.html +++ b/globals_c.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
  • - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -320,7 +321,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_d.html b/globals_d.html index ae2e2ae3..5b317cb9 100644 --- a/globals_d.html +++ b/globals_d.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -224,7 +225,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs.html b/globals_defs.html index 02a638d7..437cc0dc 100644 --- a/globals_defs.html +++ b/globals_defs.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -129,13 +130,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • __HIDUSAGETITLEARRAYS_H__ : hidusagetitlearrays.cpp
  • +
  • __PGMSPACE_H_ +: version_helper.h +
  • +
  • _SFR_BYTE +: version_helper.h +
  • diff --git a/globals_defs_a.html b/globals_defs_a.html index cc73daea..f9ab5465 100644 --- a/globals_defs_a.html +++ b/globals_defs_a.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@ - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -183,7 +184,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_b.html b/globals_defs_b.html index f843a6d7..71e19c58 100644 --- a/globals_defs_b.html +++ b/globals_defs_b.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -541,22 +542,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : BTD.h
  • bmREQ_HID_IN -: PS3USB.h +: hid.h
  • bmREQ_HID_OUT -: XBOXUSB.h -, PS3USB.h -, XBOXOLD.h -, BTD.h +: hid.h
  • -
  • bmREQ_HIDIN -: hid.h -
  • -
  • bmREQ_HIDOUT -: hid.h -
  • -
  • bmREQ_HIDREPORT -: hid.h +
  • bmREQ_HID_REPORT +: hid.h
  • bmREQ_MASSIN : masstorage.h @@ -699,7 +691,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_c.html b/globals_defs_c.html index bfaa436e..ef27095c 100644 --- a/globals_defs_c.html +++ b/globals_defs_c.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
  • - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -288,7 +289,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_d.html b/globals_defs_d.html index 8cbf41c6..7a7833e5 100644 --- a/globals_defs_d.html +++ b/globals_defs_d.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -177,7 +178,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_e.html b/globals_defs_e.html index 0b0eed92..bb4ca217 100644 --- a/globals_defs_e.html +++ b/globals_defs_e.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -135,17 +136,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • EP_DESCR_LEN : usb_ch9.h
  • -
  • EP_INTERRUPT -: XBOXUSB.h -, PS3USB.h -, XBOXOLD.h -, XBOXRECV.h -
  • EP_MAXPKTSIZE -: PS3USB.h -, XBOXOLD.h -, XBOXRECV.h +: XBOXRECV.h , XBOXUSB.h +, PS3USB.h +, XBOXOLD.h +, XBOXONE.h
  • epMUL : hidboot.h @@ -231,7 +227,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_f.html b/globals_defs_f.html index 528b0679..fbae9eff 100644 --- a/globals_defs_f.html +++ b/globals_defs_f.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
  • - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -123,12 +124,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');  

    - f -

    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -156,7 +157,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_h.html b/globals_defs_h.html index 7cc87b85..30266a61 100644 --- a/globals_defs_h.html +++ b/globals_defs_h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -294,7 +295,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • HID_REQUEST_GET_REPORT : hid.h -, PS3USB.h
  • HID_REQUEST_SET_IDLE : hid.h @@ -303,11 +303,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : hid.h
  • HID_REQUEST_SET_REPORT -: PS3USB.h -, XBOXOLD.h -, XBOXUSB.h -, hid.h -, BTD.h +: hid.h
  • HID_RPT_PROTOCOL : hid.h @@ -459,7 +455,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_i.html b/globals_defs_i.html index ccc2f0b6..ff1c9ad2 100644 --- a/globals_defs_i.html +++ b/globals_defs_i.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
  • - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -141,7 +142,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_j.html b/globals_defs_j.html index 6ed691aa..62300476 100644 --- a/globals_defs_j.html +++ b/globals_defs_j.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -125,8 +126,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

    - j -

    @@ -134,7 +138,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_k.html b/globals_defs_k.html index 2ed6380b..e497ceb3 100644 --- a/globals_defs_k.html +++ b/globals_defs_k.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@ - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -189,7 +190,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_l.html b/globals_defs_l.html index c0daa67e..deec21dd 100644 --- a/globals_defs_l.html +++ b/globals_defs_l.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -354,7 +355,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_m.html b/globals_defs_m.html index b0b65724..563e5fdb 100644 --- a/globals_defs_m.html +++ b/globals_defs_m.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -281,6 +282,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • MAX_REPORT_PARSERS : hid.h
  • +
  • memchr_P +: version_helper.h +
  • +
  • memcmp_P +: version_helper.h +
  • +
  • memcpy_P +: version_helper.h +
  • +
  • memmem_P +: version_helper.h +
  • +
  • memrchr_P +: version_helper.h +
  • MODE_FS_HOST : max3421e.h
  • @@ -302,7 +318,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_n.html b/globals_defs_n.html index 2432c5cd..3e0201e6 100644 --- a/globals_defs_n.html +++ b/globals_defs_n.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -162,7 +163,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_o.html b/globals_defs_o.html index 68f3eb70..7c6ad86e 100644 --- a/globals_defs_o.html +++ b/globals_defs_o.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -144,7 +145,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_p.html b/globals_defs_p.html index 890e595b..0a615949 100644 --- a/globals_defs_p.html +++ b/globals_defs_p.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -132,6 +133,48 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • PENDING : BTD.h
  • +
  • PGM_P +: version_helper.h +
  • +
  • pgm_read_byte +: version_helper.h +
  • +
  • pgm_read_byte_far +: version_helper.h +
  • +
  • pgm_read_byte_near +: version_helper.h +
  • +
  • pgm_read_dword +: version_helper.h +
  • +
  • pgm_read_dword_far +: version_helper.h +
  • +
  • pgm_read_dword_near +: version_helper.h +
  • +
  • pgm_read_float +: version_helper.h +
  • +
  • pgm_read_float_far +: version_helper.h +
  • +
  • pgm_read_float_near +: version_helper.h +
  • +
  • pgm_read_pointer +: version_helper.h +
  • +
  • pgm_read_word +: version_helper.h +
  • +
  • pgm_read_word_far +: version_helper.h +
  • +
  • pgm_read_word_near +: version_helper.h +
  • PL_MAX_ENDPOINTS : cdcprolific.h
  • @@ -141,6 +184,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • PL_VID : cdcprolific.h
  • +
  • printf_P +: version_helper.h +
  • PROLIFIC_REV_1 : cdcprolific.h
  • @@ -169,8 +215,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : PS3USB.h
  • PS3_PID -: BTD.h -, PS3USB.h +: PS3USB.h +, BTD.h
  • PS3_REPORT_BUFFER_SIZE : PS3Enums.h @@ -180,12 +226,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , PS3USB.h
  • PS3MOVE_PID -: BTD.h -, PS3USB.h +: PS3USB.h +, BTD.h
  • PS3NAVIGATION_PID -: BTD.h -, PS3USB.h +: PS3USB.h +, BTD.h
  • PS4_PID : PS4USB.h @@ -199,13 +245,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • PSBUZZ_VID : PSBuzz.h
  • +
  • PSTR +: version_helper.h +
  • diff --git a/globals_defs_r.html b/globals_defs_r.html index 6e693d83..a014c9a5 100644 --- a/globals_defs_r.html +++ b/globals_defs_r.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@ - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -228,7 +229,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_s.html b/globals_defs_s.html index 82641ad4..2b2a64fb 100644 --- a/globals_defs_s.html +++ b/globals_defs_s.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -384,15 +385,81 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • SET_RS : max_LCD.cpp
  • +
  • snprintf_P +: version_helper.h +
  • SPECIAL_MASK : cdcprolific.h
  • SPECIAL_SHIFT : cdcprolific.h
  • +
  • sprintf_P +: version_helper.h +
  • STATE_ALL : cdcprolific.h
  • +
  • strcasecmp_P +: version_helper.h +
  • +
  • strcasestr_P +: version_helper.h +
  • +
  • strcat_P +: version_helper.h +
  • +
  • strchr_P +: version_helper.h +
  • +
  • strchrnul_P +: version_helper.h +
  • +
  • strcmp_P +: version_helper.h +
  • +
  • strcpy_P +: version_helper.h +
  • +
  • strlcat_P +: version_helper.h +
  • +
  • strlcpy_P +: version_helper.h +
  • +
  • strlen_P +: version_helper.h +
  • +
  • strncasecmp_P +: version_helper.h +
  • +
  • strncat_P +: version_helper.h +
  • +
  • strncmp_P +: version_helper.h +
  • +
  • strncpy_P +: version_helper.h +
  • +
  • strnlen_P +: version_helper.h +
  • +
  • strpbrk_P +: version_helper.h +
  • +
  • strrchr_P +: version_helper.h +
  • +
  • strsep_P +: version_helper.h +
  • +
  • strspn_P +: version_helper.h +
  • +
  • strstr_P +: version_helper.h +
  • SUCCESSFUL : BTD.h
  • @@ -405,7 +472,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_t.html b/globals_defs_t.html index 14bc2b5b..c49c3893 100644 --- a/globals_defs_t.html +++ b/globals_defs_t.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -231,7 +232,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_u.html b/globals_defs_u.html index b1813854..dfbad129 100644 --- a/globals_defs_u.html +++ b/globals_defs_u.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -123,9 +124,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');  

    - u -

    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -141,13 +142,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • VENDOR_WRITE_REQUEST_TYPE : cdcprolific.h
  • +
  • vfprintf_P +: version_helper.h +
  • +
  • vsnprintf_P +: version_helper.h +
  • +
  • vsprintf_P +: version_helper.h +
  • diff --git a/globals_defs_w.html b/globals_defs_w.html index d340e376..cf873690 100644 --- a/globals_defs_w.html +++ b/globals_defs_w.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@ - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -159,7 +160,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_defs_x.html b/globals_defs_x.html index 67581488..4d985b21 100644 --- a/globals_defs_x.html +++ b/globals_defs_x.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -125,11 +126,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

    - x -

    diff --git a/globals_e.html b/globals_e.html index 83b0d3f0..a0f97e2f 100644 --- a/globals_e.html +++ b/globals_e.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@ - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -152,17 +153,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • EP_DESCR_LEN : usb_ch9.h
  • -
  • EP_INTERRUPT -: XBOXOLD.h -, XBOXRECV.h -, XBOXUSB.h -, PS3USB.h -
  • EP_MAXPKTSIZE -: PS3USB.h -, XBOXOLD.h +: XBOXOLD.h +, XBOXONE.h , XBOXRECV.h , XBOXUSB.h +, PS3USB.h
  • epMUL : hidboot.h @@ -251,7 +247,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_enum.html b/globals_enum.html index d9bc462f..8f2ef7c9 100644 --- a/globals_enum.html +++ b/globals_enum.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
  • - + @@ -82,7 +83,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -141,7 +142,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_eval.html b/globals_eval.html index d4f46980..6a81fb70 100644 --- a/globals_eval.html +++ b/globals_eval.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -108,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -600,12 +601,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • Y : controllerEnums.h
  • -
  • YELLOW -: controllerEnums.h -
  • Yellow : controllerEnums.h
  • +
  • YELLOW +: controllerEnums.h +
  • @@ -625,7 +626,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_f.html b/globals_f.html index 098c3081..990e91a2 100644 --- a/globals_f.html +++ b/globals_f.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -125,6 +126,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    Here is a list of all file members with links to the files they belong to:

    - f -

    - + @@ -82,7 +83,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -138,7 +139,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_g.html b/globals_g.html index 6f0df6f5..8890987c 100644 --- a/globals_g.html +++ b/globals_g.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -182,7 +183,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_h.html b/globals_h.html index 3362ade5..9e8fca0a 100644 --- a/globals_h.html +++ b/globals_h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -305,7 +306,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • HID_REQUEST_GET_REPORT : hid.h -, PS3USB.h
  • HID_REQUEST_SET_IDLE : hid.h @@ -314,11 +314,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : hid.h
  • HID_REQUEST_SET_REPORT -: BTD.h -, hid.h -, PS3USB.h -, XBOXOLD.h -, XBOXUSB.h +: hid.h
  • HID_RPT_PROTOCOL : hid.h @@ -476,7 +472,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_i.html b/globals_i.html index 5fdd9d83..894c83e7 100644 --- a/globals_i.html +++ b/globals_i.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
  • - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -143,7 +144,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_j.html b/globals_j.html index 85bc8c8a..8310b841 100644 --- a/globals_j.html +++ b/globals_j.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -127,8 +128,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

    - j -

    @@ -136,7 +140,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_k.html b/globals_k.html index 2aabeb5a..de9934f3 100644 --- a/globals_k.html +++ b/globals_k.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@ - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -206,7 +207,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_l.html b/globals_l.html index 623f5feb..de8168c2 100644 --- a/globals_l.html +++ b/globals_l.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -419,7 +420,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_m.html b/globals_m.html index 0b53acfd..9d8e48e5 100644 --- a/globals_m.html +++ b/globals_m.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -286,6 +287,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • MAX_REPORT_PARSERS : hid.h
  • +
  • memchr_P +: version_helper.h +
  • +
  • memcmp_P +: version_helper.h +
  • +
  • memcpy_P +: version_helper.h +
  • +
  • memmem_P +: version_helper.h +
  • +
  • memrchr_P +: version_helper.h +
  • MINUS : controllerEnums.h
  • @@ -343,7 +359,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_n.html b/globals_n.html index c7af4d4e..10afc0b1 100644 --- a/globals_n.html +++ b/globals_n.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -167,7 +168,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_o.html b/globals_o.html index 7518e49b..a54ed16e 100644 --- a/globals_o.html +++ b/globals_o.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -161,7 +162,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_p.html b/globals_p.html index 349aede6..0df06e93 100644 --- a/globals_p.html +++ b/globals_p.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -134,6 +135,48 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • PENDING : BTD.h
  • +
  • PGM_P +: version_helper.h +
  • +
  • pgm_read_byte +: version_helper.h +
  • +
  • pgm_read_byte_far +: version_helper.h +
  • +
  • pgm_read_byte_near +: version_helper.h +
  • +
  • pgm_read_dword +: version_helper.h +
  • +
  • pgm_read_dword_far +: version_helper.h +
  • +
  • pgm_read_dword_near +: version_helper.h +
  • +
  • pgm_read_float +: version_helper.h +
  • +
  • pgm_read_float_far +: version_helper.h +
  • +
  • pgm_read_float_near +: version_helper.h +
  • +
  • pgm_read_pointer +: version_helper.h +
  • +
  • pgm_read_word +: version_helper.h +
  • +
  • pgm_read_word_far +: version_helper.h +
  • +
  • pgm_read_word_near +: version_helper.h +
  • Pitch : controllerEnums.h
  • @@ -158,6 +201,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • PrintBin() : printhex.h
  • +
  • printf_P +: version_helper.h +
  • PrintHex() : printhex.h
  • @@ -168,6 +214,33 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : usbhub.cpp , usbhub.h +
  • prog_char +: version_helper.h +
  • +
  • prog_int16_t +: version_helper.h +
  • +
  • prog_int32_t +: version_helper.h +
  • +
  • prog_int8_t +: version_helper.h +
  • +
  • prog_uchar +: version_helper.h +
  • +
  • prog_uint16_t +: version_helper.h +
  • +
  • prog_uint32_t +: version_helper.h +
  • +
  • prog_uint8_t +: version_helper.h +
  • +
  • prog_void +: version_helper.h +
  • PROLIFIC_REV_1 : cdcprolific.h
  • @@ -247,6 +320,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • PSETUP_PKT : UsbCore.h
  • +
  • PSTR +: version_helper.h +
  • pstrCRLF : hidusagestr.h
  • @@ -1606,12 +1682,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • pstrUsageHeadphone : hidusagestr.h
  • -
  • pstrUsageHeadSet -: hidusagestr.h -
  • pstrUsageHeadset : hidusagestr.h
  • +
  • pstrUsageHeadSet +: hidusagestr.h +
  • pstrUsageHeadTracker : hidusagestr.h
  • @@ -2825,7 +2901,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : hidusagestr.h
  • PTP_ARRAY_EL_FUNC -: parsetools.h +: parsetools.h
  • Purble : controllerEnums.h @@ -2836,7 +2912,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_r.html b/globals_r.html index e53b8a53..5b408081 100644 --- a/globals_r.html +++ b/globals_r.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
  • - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -284,7 +285,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_s.html b/globals_s.html index 472e147c..fb683010 100644 --- a/globals_s.html +++ b/globals_s.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -404,12 +405,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • SLOWBLINK : xboxEnums.h
  • +
  • snprintf_P +: version_helper.h +
  • SPECIAL_MASK : cdcprolific.h
  • SPECIAL_SHIFT : cdcprolific.h
  • +
  • sprintf_P +: version_helper.h +
  • SQUARE : controllerEnums.h
  • @@ -422,6 +429,66 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • StatusEnum : PS3Enums.h
  • +
  • strcasecmp_P +: version_helper.h +
  • +
  • strcasestr_P +: version_helper.h +
  • +
  • strcat_P +: version_helper.h +
  • +
  • strchr_P +: version_helper.h +
  • +
  • strchrnul_P +: version_helper.h +
  • +
  • strcmp_P +: version_helper.h +
  • +
  • strcpy_P +: version_helper.h +
  • +
  • strlcat_P +: version_helper.h +
  • +
  • strlcpy_P +: version_helper.h +
  • +
  • strlen_P +: version_helper.h +
  • +
  • strncasecmp_P +: version_helper.h +
  • +
  • strncat_P +: version_helper.h +
  • +
  • strncmp_P +: version_helper.h +
  • +
  • strncpy_P +: version_helper.h +
  • +
  • strnlen_P +: version_helper.h +
  • +
  • strpbrk_P +: version_helper.h +
  • +
  • strrchr_P +: version_helper.h +
  • +
  • strsep_P +: version_helper.h +
  • +
  • strspn_P +: version_helper.h +
  • +
  • strstr_P +: version_helper.h +
  • SUCCESSFUL : BTD.h
  • @@ -437,7 +504,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_t.html b/globals_t.html index c27027e0..f842cc48 100644 --- a/globals_t.html +++ b/globals_t.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -260,7 +261,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_type.html b/globals_type.html index e501b039..7f103252 100644 --- a/globals_type.html +++ b/globals_type.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -82,7 +83,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -111,11 +112,38 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • MAX3421E : UsbCore.h
  • +
  • prog_char +: version_helper.h +
  • +
  • prog_int16_t +: version_helper.h +
  • +
  • prog_int32_t +: version_helper.h +
  • +
  • prog_int8_t +: version_helper.h +
  • +
  • prog_uchar +: version_helper.h +
  • +
  • prog_uint16_t +: version_helper.h +
  • +
  • prog_uint32_t +: version_helper.h +
  • +
  • prog_uint8_t +: version_helper.h +
  • +
  • prog_void +: version_helper.h +
  • PSETUP_PKT : UsbCore.h
  • PTP_ARRAY_EL_FUNC -: parsetools.h +: parsetools.h
  • TEL_CALL_STATE_REP_CPBL_FUNC_DESCR : cdcacm.h @@ -124,7 +152,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : cdcacm.h
  • UsbDeviceHandleFunc -: address.h +: address.h
  • @@ -132,7 +160,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_u.html b/globals_u.html index d5d0227a..a9543a28 100644 --- a/globals_u.html +++ b/globals_u.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@ - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -125,9 +126,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    Here is a list of all file members with links to the files they belong to:

    - u -

    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -152,13 +153,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • VENDOR_WRITE_REQUEST_TYPE : cdcprolific.h
  • +
  • vfprintf_P +: version_helper.h +
  • +
  • vsnprintf_P +: version_helper.h +
  • +
  • vsprintf_P +: version_helper.h +
  • diff --git a/globals_vars.html b/globals_vars.html index 582c1fbf..16fa3c0b 100644 --- a/globals_vars.html +++ b/globals_vars.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@ - + @@ -91,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -2702,7 +2703,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_vars_r.html b/globals_vars_r.html index 1a327094..0239bef0 100644 --- a/globals_vars_r.html +++ b/globals_vars_r.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -91,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -113,7 +114,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_vars_u.html b/globals_vars_u.html index cb6c81f0..5c428f46 100644 --- a/globals_vars_u.html +++ b/globals_vars_u.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -91,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -116,7 +117,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_vars_w.html b/globals_vars_w.html index 70901d94..83c4155f 100644 --- a/globals_vars_w.html +++ b/globals_vars_w.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -91,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -119,7 +120,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_vars_x.html b/globals_vars_x.html index 32860729..e4d43fec 100644 --- a/globals_vars_x.html +++ b/globals_vars_x.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -91,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -119,7 +120,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_w.html b/globals_w.html index 27bd6dfd..6e2fe578 100644 --- a/globals_w.html +++ b/globals_w.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -176,7 +177,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/globals_x.html b/globals_x.html index 2316da65..66725aac 100644 --- a/globals_x.html +++ b/globals_x.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@
    - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -136,12 +137,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • XBOX_CONTROL_PIPE : XBOXOLD.h +, XBOXONE.h , XBOXRECV.h , XBOXUSB.h
  • XBOX_INPUT_PIPE -: XBOXUSB.h -, XBOXOLD.h +: XBOXOLD.h +, XBOXONE.h +, XBOXUSB.h
  • XBOX_INPUT_PIPE_1 : XBOXRECV.h @@ -159,9 +162,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : xboxEnums.h
  • XBOX_MAX_ENDPOINTS -: XBOXUSB.h -, XBOXOLD.h +: XBOXOLD.h +, XBOXONE.h , XBOXRECV.h +, XBOXUSB.h
  • XBOX_OLD_PID1 : XBOXOLD.h @@ -175,8 +179,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • XBOX_OLD_PID4 : XBOXOLD.h
  • +
  • XBOX_ONE_PID +: XBOXONE.h +
  • XBOX_OUTPUT_PIPE : XBOXOLD.h +, XBOXONE.h , XBOXUSB.h
  • XBOX_OUTPUT_PIPE_1 @@ -192,12 +200,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : XBOXRECV.h
  • XBOX_REPORT_BUFFER_SIZE -: XBOXUSB.h +: XBOXONE.h +, XBOXUSB.h
  • XBOX_VID -: XBOXRECV.h +: XBOXOLD.h +, XBOXONE.h +, XBOXRECV.h , XBOXUSB.h -, XBOXOLD.h
  • XBOX_WIRED_PID : XBOXUSB.h @@ -206,8 +216,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : XBOXUSB.h
  • XBOX_WIRELESS_RECEIVER_PID -: XBOXUSB.h -, XBOXRECV.h +: XBOXRECV.h +, XBOXUSB.h
  • XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID : XBOXRECV.h @@ -225,13 +235,178 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • XOOM : adk.h
  • +
  • XR_MAX_ENDPOINTS +: cdc_XR21B1411.h +
  • +
  • XR_READ_REQUEST_TYPE +: cdc_XR21B1411.h +
  • +
  • XR_REG_ACM_FLOW_CTL +: cdc_XR21B1411.h +
  • +
  • XR_REG_ACM_GPIO_DIR +: cdc_XR21B1411.h +
  • +
  • XR_REG_ACM_GPIO_INT +: cdc_XR21B1411.h +
  • +
  • XR_REG_ACM_GPIO_MODE +: cdc_XR21B1411.h +
  • +
  • XR_REG_CUSTOM_DRIVER +: cdc_XR21B1411.h +
  • +
  • XR_REG_CUSTOM_DRIVER_ACTIVE +: cdc_XR21B1411.h +
  • +
  • XR_REG_CUSTOMISED_INT +: cdc_XR21B1411.h +
  • +
  • XR_REG_ERROR_STATUS +: cdc_XR21B1411.h +
  • +
  • XR_REG_ERROR_STATUS_BREAK +: cdc_XR21B1411.h +
  • +
  • XR_REG_ERROR_STATUS_ERROR +: cdc_XR21B1411.h +
  • +
  • XR_REG_ERROR_STATUS_FRAME +: cdc_XR21B1411.h +
  • +
  • XR_REG_ERROR_STATUS_MASK +: cdc_XR21B1411.h +
  • +
  • XR_REG_ERROR_STATUS_OVERRUN +: cdc_XR21B1411.h +
  • +
  • XR_REG_ERROR_STATUS_PARITY +: cdc_XR21B1411.h +
  • +
  • XR_REG_FLOW_CTL +: cdc_XR21B1411.h +
  • +
  • XR_REG_FLOW_CTL_HALF_DPLX +: cdc_XR21B1411.h +
  • +
  • XR_REG_FLOW_CTL_HW +: cdc_XR21B1411.h +
  • +
  • XR_REG_FLOW_CTL_MMMRX +: cdc_XR21B1411.h +
  • +
  • XR_REG_FLOW_CTL_MMMRXTX +: cdc_XR21B1411.h +
  • +
  • XR_REG_FLOW_CTL_MODE_MASK +: cdc_XR21B1411.h +
  • +
  • XR_REG_FLOW_CTL_NONE +: cdc_XR21B1411.h +
  • +
  • XR_REG_FLOW_CTL_SW +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_CLR +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_DIR +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_INT +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_MASK +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_MODE +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_MODE_ATE +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_MODE_ATE_ADDRESS +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_MODE_FC_DTRDSR +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_MODE_FC_RTSCTS +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_MODE_GPIO +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_SET +: cdc_XR21B1411.h +
  • +
  • XR_REG_GPIO_STATUS +: cdc_XR21B1411.h +
  • +
  • XR_REG_LOOPBACK +: cdc_XR21B1411.h +
  • +
  • XR_REG_PIN_PULLDOWN_ENABLE +: cdc_XR21B1411.h +
  • +
  • XR_REG_PIN_PULLUP_ENABLE +: cdc_XR21B1411.h +
  • +
  • XR_REG_RX_FIFO_COUNT +: cdc_XR21B1411.h +
  • +
  • XR_REG_RX_FIFO_LATENCY +: cdc_XR21B1411.h +
  • +
  • XR_REG_RX_FIFO_LATENCY_ENABLE +: cdc_XR21B1411.h +
  • +
  • XR_REG_RX_FIFO_RESET +: cdc_XR21B1411.h +
  • +
  • XR_REG_TX_BREAK +: cdc_XR21B1411.h +
  • +
  • XR_REG_TX_FIFO_COUNT +: cdc_XR21B1411.h +
  • +
  • XR_REG_TX_FIFO_RESET +: cdc_XR21B1411.h +
  • +
  • XR_REG_UART_ENABLE +: cdc_XR21B1411.h +
  • +
  • XR_REG_UART_ENABLE_RX +: cdc_XR21B1411.h +
  • +
  • XR_REG_UART_ENABLE_TX +: cdc_XR21B1411.h +
  • +
  • XR_REG_WIDE_MODE +: cdc_XR21B1411.h +
  • +
  • XR_REG_WIDE_MODE_ENABLE +: cdc_XR21B1411.h +
  • +
  • XR_REG_XCVR_EN_DELAY +: cdc_XR21B1411.h +
  • +
  • XR_REG_XOFF_CHAR +: cdc_XR21B1411.h +
  • +
  • XR_REG_XON_CHAR +: cdc_XR21B1411.h +
  • +
  • XR_WRITE_REQUEST_TYPE +: cdc_XR21B1411.h +
  • diff --git a/globals_y.html b/globals_y.html index bf024928..d332d8fa 100644 --- a/globals_y.html +++ b/globals_y.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@ - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -128,19 +129,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • Y : controllerEnums.h
  • -
  • Yellow -: controllerEnums.h -
  • YELLOW : controllerEnums.h
  • +
  • Yellow +: controllerEnums.h +
  • diff --git a/globals_z.html b/globals_z.html index 2fbd6fb8..322b0dd4 100644 --- a/globals_z.html +++ b/globals_z.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: File Members + @@ -31,7 +32,7 @@ - + @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -140,7 +141,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/graph_legend.html b/graph_legend.html index 8aed3bc9..308b189a 100644 --- a/graph_legend.html +++ b/graph_legend.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Graph Legend + @@ -31,7 +32,7 @@
    - + @@ -65,7 +66,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -80,40 +81,40 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

    This page explains how to interpret the graphs that are generated by doxygen.

    -

    Consider the following example:

    /*! Invisible class because of truncation */
    -
    class Invisible { };
    -
    -
    /*! Truncated class, inheritance relation is hidden */
    -
    class Truncated : public Invisible { };
    -
    -
    /* Class not documented with doxygen comments */
    -
    class Undocumented { };
    -
    -
    /*! Class that is inherited using public inheritance */
    -
    class PublicBase : public Truncated { };
    -
    -
    /*! A template class */
    -
    template<class T> class Templ { };
    -
    -
    /*! Class that is inherited using protected inheritance */
    -
    class ProtectedBase { };
    -
    -
    /*! Class that is inherited using private inheritance */
    -
    class PrivateBase { };
    -
    -
    /*! Class that is used by the Inherited class */
    -
    class Used { };
    -
    -
    /*! Super class that inherits a number of other classes */
    -
    class Inherited : public PublicBase,
    -
    protected ProtectedBase,
    -
    private PrivateBase,
    -
    public Undocumented,
    -
    public Templ<int>
    -
    {
    -
    private:
    -
    Used *m_usedClass;
    -
    };
    +

    Consider the following example:

    1 /*! Invisible class because of truncation */
    +
    2 class Invisible { };
    +
    3 
    +
    4 /*! Truncated class, inheritance relation is hidden */
    +
    5 class Truncated : public Invisible { };
    +
    6 
    +
    7 /* Class not documented with doxygen comments */
    +
    8 class Undocumented { };
    +
    9 
    +
    10 /*! Class that is inherited using public inheritance */
    +
    11 class PublicBase : public Truncated { };
    +
    12 
    +
    13 /*! A template class */
    +
    14 template<class T> class Templ { };
    +
    15 
    +
    16 /*! Class that is inherited using protected inheritance */
    +
    17 class ProtectedBase { };
    +
    18 
    +
    19 /*! Class that is inherited using private inheritance */
    +
    20 class PrivateBase { };
    +
    21 
    +
    22 /*! Class that is used by the Inherited class */
    +
    23 class Used { };
    +
    24 
    +
    25 /*! Super class that inherits a number of other classes */
    +
    26 class Inherited : public PublicBase,
    +
    27  protected ProtectedBase,
    +
    28  private PrivateBase,
    +
    29  public Undocumented,
    +
    30  public Templ<int>
    +
    31 {
    +
    32  private:
    +
    33  Used *m_usedClass;
    +
    34 };

    This will result in the following graph:

    @@ -147,7 +148,7 @@ A yellow dashed arrow denotes a relation between a template instance and the tem diff --git a/hexdump_8h.html b/hexdump_8h.html index cab6f6a4..c3d5b01b 100644 --- a/hexdump_8h.html +++ b/hexdump_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hexdump.h File Reference + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
    +
    @@ -125,7 +126,7 @@ Variables diff --git a/hexdump_8h_source.html b/hexdump_8h_source.html index 49a6fb20..bc6947cb 100644 --- a/hexdump_8h_source.html +++ b/hexdump_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hexdump.h Source File + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -127,7 +128,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    36  byteTotal = 0;
    37  };
    38 
    -
    39  virtual void Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset);
    +
    39  void Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset);
    40 };
    41 
    42 template <class BASE_CLASS, class LEN_TYPE, class OFFSET_TYPE>
    @@ -136,13 +137,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    45  for(LEN_TYPE j = 0; j < len; j++, byteCount++, byteTotal++) {
    46  if(!byteCount) {
    47  PrintHex<OFFSET_TYPE > (byteTotal, 0x80);
    -
    48  E_Notify(PSTR(": "), 0x80);
    +
    48  E_Notify(PSTR(": "), 0x80);
    49  }
    50  PrintHex<uint8_t > (pbuf[j], 0x80);
    -
    51  E_Notify(PSTR(" "), 0x80);
    +
    51  E_Notify(PSTR(" "), 0x80);
    52 
    53  if(byteCount == 15) {
    -
    54  E_Notify(PSTR("\r\n"), 0x80);
    +
    54  E_Notify(PSTR("\r\n"), 0x80);
    55  byteCount = 0xFF;
    56  }
    57  }
    @@ -153,15 +154,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    int UsbDEBUGlvl
    Definition: message.cpp:22
    void Initialize()
    Definition: hexdump.h:34
    +
    #define PSTR(str)
    void E_Notify(char const *msg, int lvl)
    Definition: message.cpp:34
    HexDumper()
    Definition: hexdump.h:31
    -
    virtual void Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset)
    Definition: hexdump.h:43
    +
    void Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset)
    Definition: hexdump.h:43
    diff --git a/hid_8cpp.html b/hid_8cpp.html index f3e645fb..621a4e8d 100644 --- a/hid_8cpp.html +++ b/hid_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hid.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -104,7 +105,7 @@ Include dependency graph for hid.cpp:
    diff --git a/hid_8cpp__incl.md5 b/hid_8cpp__incl.md5 index ebd987a6..5717c5ed 100644 --- a/hid_8cpp__incl.md5 +++ b/hid_8cpp__incl.md5 @@ -1 +1 @@ -bbd5085fd941c995891b2435bdf87f40 \ No newline at end of file +03c94cb8befed052703cc30b5194045a \ No newline at end of file diff --git a/hid_8cpp_source.html b/hid_8cpp_source.html index 1fb8ade7..54ec5b1a 100644 --- a/hid_8cpp_source.html +++ b/hid_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hid.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -115,7 +116,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    24  const uint8_t constBufLen = 64;
    25  uint8_t buf[constBufLen];
    26 
    -
    27  uint8_t rcode = pUsb->ctrlReq(bAddress, ep, bmREQ_HIDREPORT, USB_REQUEST_GET_DESCRIPTOR, 0x00,
    +
    27  uint8_t rcode = pUsb->ctrlReq(bAddress, ep, bmREQ_HID_REPORT, USB_REQUEST_GET_DESCRIPTOR, 0x00,
    28  HID_DESCRIPTOR_REPORT, 0x0000, 128, constBufLen, buf, (USBReadParser*)parser);
    29 
    30  //return ((rcode != hrSTALL) ? rcode : 0);
    @@ -126,7 +127,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    35  const uint8_t constBufLen = 64;
    36  uint8_t buf[constBufLen];
    37 
    -
    38  uint8_t rcode = pUsb->ctrlReq(bAddress, 0x00, bmREQ_HIDREPORT, USB_REQUEST_GET_DESCRIPTOR, 0x00,
    +
    38  uint8_t rcode = pUsb->ctrlReq(bAddress, 0x00, bmREQ_HID_REPORT, USB_REQUEST_GET_DESCRIPTOR, 0x00,
    39  HID_DESCRIPTOR_REPORT, wIndex, 128, constBufLen, buf, (USBReadParser*)parser);
    40 
    41  //return ((rcode != hrSTALL) ? rcode : 0);
    @@ -139,66 +140,66 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    48 //}
    49 
    50 uint8_t HID::SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr) {
    -
    51  return ( pUsb->ctrlReq(bAddress, ep, bmREQ_HIDOUT, HID_REQUEST_SET_REPORT, report_id, report_type, iface, nbytes, nbytes, dataptr, NULL));
    +
    51  return ( pUsb->ctrlReq(bAddress, ep, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, report_id, report_type, iface, nbytes, nbytes, dataptr, NULL));
    52 }
    53 
    54 uint8_t HID::GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr) {
    -
    55  return ( pUsb->ctrlReq(bAddress, ep, bmREQ_HIDIN, HID_REQUEST_GET_REPORT, report_id, report_type, iface, nbytes, nbytes, dataptr, NULL));
    +
    55  return ( pUsb->ctrlReq(bAddress, ep, bmREQ_HID_IN, HID_REQUEST_GET_REPORT, report_id, report_type, iface, nbytes, nbytes, dataptr, NULL));
    56 }
    57 
    58 uint8_t HID::GetIdle(uint8_t iface, uint8_t reportID, uint8_t* dataptr) {
    -
    59  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_HIDIN, HID_REQUEST_GET_IDLE, reportID, 0, iface, 0x0001, 0x0001, dataptr, NULL));
    +
    59  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_HID_IN, HID_REQUEST_GET_IDLE, reportID, 0, iface, 0x0001, 0x0001, dataptr, NULL));
    60 }
    61 
    62 uint8_t HID::SetIdle(uint8_t iface, uint8_t reportID, uint8_t duration) {
    -
    63  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_HIDOUT, HID_REQUEST_SET_IDLE, reportID, duration, iface, 0x0000, 0x0000, NULL, NULL));
    +
    63  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_HID_OUT, HID_REQUEST_SET_IDLE, reportID, duration, iface, 0x0000, 0x0000, NULL, NULL));
    64 }
    65 
    66 uint8_t HID::SetProtocol(uint8_t iface, uint8_t protocol) {
    -
    67  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_HIDOUT, HID_REQUEST_SET_PROTOCOL, protocol, 0x00, iface, 0x0000, 0x0000, NULL, NULL));
    +
    67  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_HID_OUT, HID_REQUEST_SET_PROTOCOL, protocol, 0x00, iface, 0x0000, 0x0000, NULL, NULL));
    68 }
    69 
    70 uint8_t HID::GetProtocol(uint8_t iface, uint8_t* dataptr) {
    -
    71  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_HIDIN, HID_REQUEST_GET_PROTOCOL, 0x00, 0x00, iface, 0x0001, 0x0001, dataptr, NULL));
    +
    71  return ( pUsb->ctrlReq(bAddress, 0, bmREQ_HID_IN, HID_REQUEST_GET_PROTOCOL, 0x00, 0x00, iface, 0x0001, 0x0001, dataptr, NULL));
    72 }
    73 
    -
    75  Notify(PSTR("Endpoint descriptor:"), 0x80);
    -
    76  Notify(PSTR("\r\nLength:\t\t"), 0x80);
    +
    75  Notify(PSTR("Endpoint descriptor:"), 0x80);
    +
    76  Notify(PSTR("\r\nLength:\t\t"), 0x80);
    77  D_PrintHex<uint8_t > (ep_ptr->bLength, 0x80);
    -
    78  Notify(PSTR("\r\nType:\t\t"), 0x80);
    +
    78  Notify(PSTR("\r\nType:\t\t"), 0x80);
    79  D_PrintHex<uint8_t > (ep_ptr->bDescriptorType, 0x80);
    -
    80  Notify(PSTR("\r\nAddress:\t"), 0x80);
    +
    80  Notify(PSTR("\r\nAddress:\t"), 0x80);
    81  D_PrintHex<uint8_t > (ep_ptr->bEndpointAddress, 0x80);
    -
    82  Notify(PSTR("\r\nAttributes:\t"), 0x80);
    +
    82  Notify(PSTR("\r\nAttributes:\t"), 0x80);
    83  D_PrintHex<uint8_t > (ep_ptr->bmAttributes, 0x80);
    -
    84  Notify(PSTR("\r\nMaxPktSize:\t"), 0x80);
    +
    84  Notify(PSTR("\r\nMaxPktSize:\t"), 0x80);
    85  D_PrintHex<uint16_t > (ep_ptr->wMaxPacketSize, 0x80);
    -
    86  Notify(PSTR("\r\nPoll Intrv:\t"), 0x80);
    +
    86  Notify(PSTR("\r\nPoll Intrv:\t"), 0x80);
    87  D_PrintHex<uint8_t > (ep_ptr->bInterval, 0x80);
    88 }
    89 
    -
    91  Notify(PSTR("\r\n\r\nHID Descriptor:\r\n"), 0x80);
    -
    92  Notify(PSTR("bDescLength:\t\t"), 0x80);
    +
    91  Notify(PSTR("\r\n\r\nHID Descriptor:\r\n"), 0x80);
    +
    92  Notify(PSTR("bDescLength:\t\t"), 0x80);
    93  D_PrintHex<uint8_t > (pDesc->bLength, 0x80);
    94 
    -
    95  Notify(PSTR("\r\nbDescriptorType:\t"), 0x80);
    +
    95  Notify(PSTR("\r\nbDescriptorType:\t"), 0x80);
    96  D_PrintHex<uint8_t > (pDesc->bDescriptorType, 0x80);
    97 
    -
    98  Notify(PSTR("\r\nbcdHID:\t\t\t"), 0x80);
    +
    98  Notify(PSTR("\r\nbcdHID:\t\t\t"), 0x80);
    99  D_PrintHex<uint16_t > (pDesc->bcdHID, 0x80);
    100 
    -
    101  Notify(PSTR("\r\nbCountryCode:\t\t"), 0x80);
    +
    101  Notify(PSTR("\r\nbCountryCode:\t\t"), 0x80);
    102  D_PrintHex<uint8_t > (pDesc->bCountryCode, 0x80);
    103 
    -
    104  Notify(PSTR("\r\nbNumDescriptors:\t"), 0x80);
    +
    104  Notify(PSTR("\r\nbNumDescriptors:\t"), 0x80);
    105  D_PrintHex<uint8_t > (pDesc->bNumDescriptors, 0x80);
    106 
    -
    107  Notify(PSTR("\r\nbDescrType:\t\t"), 0x80);
    +
    107  Notify(PSTR("\r\nbDescrType:\t\t"), 0x80);
    108  D_PrintHex<uint8_t > (pDesc->bDescrType, 0x80);
    109 
    -
    110  Notify(PSTR("\r\nwDescriptorLength:\t"), 0x80);
    +
    110  Notify(PSTR("\r\nwDescriptorLength:\t"), 0x80);
    111  D_PrintHex<uint16_t > (pDesc->wDescriptorLength, 0x80);
    112 }
    #define HID_DESCRIPTOR_REPORT
    Definition: hid.h:78
    @@ -206,13 +207,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint8_t GetIdle(uint8_t iface, uint8_t reportID, uint8_t *dataptr)
    Definition: hid.cpp:58
    uint8_t SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)
    Definition: hid.cpp:50
    -
    #define bmREQ_HIDOUT
    Definition: hid.h:63
    +
    #define HID_REQUEST_SET_REPORT
    Definition: hid.h:72
    uint8_t GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)
    Definition: hid.cpp:54
    #define USB_REQUEST_GET_DESCRIPTOR
    Definition: usb_ch9.h:37
    #define HID_REQUEST_SET_IDLE
    Definition: hid.h:73
    +
    #define bmREQ_HID_OUT
    Definition: hid.h:63
    uint8_t bLength
    Definition: usb_ch9.h:152
    uint8_t bAddress
    Definition: hid.h:146
    uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
    Definition: Usb.cpp:126
    @@ -222,22 +224,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint8_t SetProtocol(uint8_t iface, uint8_t protocol)
    Definition: hid.cpp:66
    uint8_t GetReportDescr(uint16_t wIndex, USBReadParser *parser=NULL)
    Definition: hid.cpp:34
    -
    #define bmREQ_HIDREPORT
    Definition: hid.h:65
    uint16_t wDescriptorLength
    Definition: usb_ch9.h:158
    uint8_t bCountryCode
    Definition: usb_ch9.h:155
    #define HID_REQUEST_SET_PROTOCOL
    Definition: hid.h:74
    uint16_t wMaxPacketSize
    Definition: usb_ch9.h:146
    -
    #define HID_REQUEST_SET_REPORT
    Definition: BTD.h:39
    #define HID_REQUEST_GET_REPORT
    Definition: hid.h:69
    uint8_t bNumDescriptors
    Definition: usb_ch9.h:156
    +
    #define bmREQ_HID_REPORT
    Definition: hid.h:65
    uint8_t bEndpointAddress
    Definition: usb_ch9.h:144
    - +
    uint8_t bDescriptorType
    Definition: usb_ch9.h:153
    +
    #define PSTR(str)
    void PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc)
    Definition: hid.cpp:90
    +
    #define bmREQ_HID_IN
    Definition: hid.h:64
    USB * pUsb
    Definition: hid.h:145
    uint8_t SetIdle(uint8_t iface, uint8_t reportID, uint8_t duration)
    Definition: hid.cpp:62
    -
    #define bmREQ_HIDIN
    Definition: hid.h:64
    void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
    Definition: hid.cpp:74
    uint16_t bcdHID
    Definition: usb_ch9.h:154
    #define HID_REQUEST_GET_PROTOCOL
    Definition: hid.h:71
    @@ -247,7 +249,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/hid_8h.html b/hid_8h.html index e09cb66b..29d5220a 100644 --- a/hid_8h.html +++ b/hid_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hid.h File Reference + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -106,7 +107,7 @@ This graph shows which files directly or indirectly include this file:
    - +

    Go to the source code of this file.

    @@ -188,12 +189,12 @@ Macros   #define TAG_LOCAL_USAGEMAX   0x20   -#define bmREQ_HIDOUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE -  -#define bmREQ_HIDIN   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE -  -#define bmREQ_HIDREPORT   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_INTERFACE -  +#define bmREQ_HID_OUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE +  +#define bmREQ_HID_IN   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE +  +#define bmREQ_HID_REPORT   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_INTERFACE +  #define HID_REQUEST_GET_REPORT   0x01   #define HID_REQUEST_GET_IDLE   0x02 @@ -712,12 +713,12 @@ Macros - +
    @@ -726,12 +727,12 @@ Macros
    - +
    @@ -740,12 +741,12 @@ Macros
    - +
    @@ -1235,7 +1236,7 @@ Macros diff --git a/hid_8h__dep__incl.map b/hid_8h__dep__incl.map index 2efd26b4..be0cca6c 100644 --- a/hid_8h__dep__incl.map +++ b/hid_8h__dep__incl.map @@ -1,15 +1,29 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hid_8h__dep__incl.md5 b/hid_8h__dep__incl.md5 index 11dd4e14..ea74fb29 100644 --- a/hid_8h__dep__incl.md5 +++ b/hid_8h__dep__incl.md5 @@ -1 +1 @@ -c1b8478deaa54c22ebe0efb6ce5e6d38 \ No newline at end of file +84c62dd49b6032d3aba037e31041d9a8 \ No newline at end of file diff --git a/hid_8h__dep__incl.png b/hid_8h__dep__incl.png index b5ce56f3..7be016bf 100644 Binary files a/hid_8h__dep__incl.png and b/hid_8h__dep__incl.png differ diff --git a/hid_8h__incl.md5 b/hid_8h__incl.md5 index da673a5f..9d53c4d8 100644 --- a/hid_8h__incl.md5 +++ b/hid_8h__incl.md5 @@ -1 +1 @@ -6d27fc3b520a7c0dbdf2423698cb1bcc \ No newline at end of file +c44d7b747550391bc1eeca321343a16f \ No newline at end of file diff --git a/hid_8h_source.html b/hid_8h_source.html index cf97cafd..8ab494b6 100644 --- a/hid_8h_source.html +++ b/hid_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hid.h Source File + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
    +
    @@ -111,8 +112,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    20 #include "Usb.h"
    21 #include "hidusagestr.h"
    22 
    -
    23 #define MAX_REPORT_PARSERS 2
    -
    24 #define HID_MAX_HID_CLASS_DESCRIPTORS 5
    +
    23 #define MAX_REPORT_PARSERS 2
    +
    24 #define HID_MAX_HID_CLASS_DESCRIPTORS 5
    25 
    26 #define DATA_SIZE_MASK 0x03
    27 #define TYPE_MASK 0x0C
    @@ -151,9 +152,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    60 #define TAG_LOCAL_USAGEMAX 0x20
    61 
    62 /* HID requests */
    -
    63 #define bmREQ_HIDOUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
    -
    64 #define bmREQ_HIDIN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
    -
    65 #define bmREQ_HIDREPORT USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_INTERFACE
    +
    63 #define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
    +
    64 #define bmREQ_HID_IN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
    +
    65 #define bmREQ_HID_REPORT USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_INTERFACE
    66 
    67 /* HID constants. Not part of chapter 9 */
    68 /* Class-Specific Requests */
    @@ -199,10 +200,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    108 #define bmHID_MAIN_ITEM_COLLECTION 0xa0 // Main item Collection tag value
    109 #define bmHID_MAIN_ITEM_END_COLLECTION 0xce // Main item End Collection tag value
    110 
    -
    111 #define HID_MAIN_ITEM_COLLECTION_PHYSICAL 0
    +
    111 #define HID_MAIN_ITEM_COLLECTION_PHYSICAL 0
    112 #define HID_MAIN_ITEM_COLLECTION_APPLICATION 1
    -
    113 #define HID_MAIN_ITEM_COLLECTION_LOGICAL 2
    -
    114 #define HID_MAIN_ITEM_COLLECTION_REPORT 3
    +
    113 #define HID_MAIN_ITEM_COLLECTION_LOGICAL 2
    +
    114 #define HID_MAIN_ITEM_COLLECTION_REPORT 3
    115 #define HID_MAIN_ITEM_COLLECTION_NAMED_ARRAY 4
    116 #define HID_MAIN_ITEM_COLLECTION_USAGE_SWITCH 5
    117 #define HID_MAIN_ITEM_COLLECTION_USAGE_MODIFIER 6
    @@ -242,44 +243,45 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    151 
    152  static const uint8_t maxHidInterfaces = 3;
    153  static const uint8_t maxEpPerInterface = 2;
    -
    154  static const uint8_t totalEndpoints = (maxHidInterfaces * maxEpPerInterface + 1);
    +
    154  static const uint8_t totalEndpoints = (maxHidInterfaces * maxEpPerInterface + 1);
    155 
    157  void PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc);
    158 
    -
    159  virtual HIDReportParser* GetReportParser(uint8_t id);
    +
    159  virtual HIDReportParser* GetReportParser(uint8_t id) {};
    160 
    161 public:
    162 
    -
    163  HID(USB *pusb) : pUsb(pusb) {
    +
    163  HID(USB *pusb) : pUsb(pusb) {
    164  };
    165 
    166  const USB* GetUsb() {
    167  return pUsb;
    168  };
    -
    169  virtual bool SetReportParser(uint8_t id, HIDReportParser *prs);
    -
    170 
    -
    171  uint8_t SetProtocol(uint8_t iface, uint8_t protocol);
    -
    172  uint8_t GetProtocol(uint8_t iface, uint8_t* dataptr);
    -
    173  uint8_t GetIdle(uint8_t iface, uint8_t reportID, uint8_t* dataptr);
    -
    174  uint8_t SetIdle(uint8_t iface, uint8_t reportID, uint8_t duration);
    -
    175 
    -
    176  uint8_t GetReportDescr(uint16_t wIndex, USBReadParser *parser = NULL);
    -
    177 
    -
    178  uint8_t GetHidDescr(uint8_t ep, uint16_t nbytes, uint8_t* dataptr);
    -
    179  uint8_t GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr);
    -
    180  uint8_t SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr);
    -
    181 };
    -
    182 
    -
    183 #endif // __HID_H__
    +
    169 
    +
    170  virtual bool SetReportParser(uint8_t id, HIDReportParser *prs) {};
    +
    171 
    +
    172  uint8_t SetProtocol(uint8_t iface, uint8_t protocol);
    +
    173  uint8_t GetProtocol(uint8_t iface, uint8_t* dataptr);
    +
    174  uint8_t GetIdle(uint8_t iface, uint8_t reportID, uint8_t* dataptr);
    +
    175  uint8_t SetIdle(uint8_t iface, uint8_t reportID, uint8_t duration);
    +
    176 
    +
    177  uint8_t GetReportDescr(uint16_t wIndex, USBReadParser *parser = NULL);
    +
    178 
    +
    179  uint8_t GetHidDescr(uint8_t ep, uint16_t nbytes, uint8_t* dataptr);
    +
    180  uint8_t GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr);
    +
    181  uint8_t SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr);
    +
    182 };
    +
    183 
    +
    184 #endif // __HID_H__
    uint8_t GetIdle(uint8_t iface, uint8_t reportID, uint8_t *dataptr)
    Definition: hid.cpp:58
    -
    virtual HIDReportParser * GetReportParser(uint8_t id)
    +
    virtual HIDReportParser * GetReportParser(uint8_t id)
    Definition: hid.h:159
    uint8_t SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)
    Definition: hid.cpp:50
    uint8_t GetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)
    Definition: hid.cpp:54
    uint8_t bmIsConstantOrData
    Definition: hid.h:126
    static const uint8_t epInterruptOutIndex
    Definition: hid.h:150
    - +
    uint8_t bAddress
    Definition: hid.h:146
    uint8_t bmIsArrayOrVariable
    Definition: hid.h:127
    @@ -297,8 +299,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    Definition: hid.h:143
    HID(USB *pusb)
    Definition: hid.h:163
    uint8_t bmIsNullOrNoNull
    Definition: hid.h:132
    - -
    virtual bool SetReportParser(uint8_t id, HIDReportParser *prs)
    + +
    virtual bool SetReportParser(uint8_t id, HIDReportParser *prs)
    Definition: hid.h:170
    virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)=0
    void PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc)
    Definition: hid.cpp:90
    @@ -310,7 +312,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); -
    Definition: UsbCore.h:190
    +
    Definition: UsbCore.h:197
    uint8_t bmIsNoPreferedOrPrefered
    Definition: hid.h:131
    static const uint8_t totalEndpoints
    Definition: hid.h:154
    uint8_t bmIsRelativeOrAbsolute
    Definition: hid.h:128
    @@ -322,7 +324,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/hidboot_8cpp.html b/hidboot_8cpp.html index a84d1af3..c0cc8828 100644 --- a/hidboot_8cpp.html +++ b/hidboot_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidboot.cpp File Reference + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -104,7 +105,7 @@ Include dependency graph for hidboot.cpp:
    diff --git a/hidboot_8cpp__incl.md5 b/hidboot_8cpp__incl.md5 index 4a84fd5f..3178c9e8 100644 --- a/hidboot_8cpp__incl.md5 +++ b/hidboot_8cpp__incl.md5 @@ -1 +1 @@ -0c189f333bf0da28d707e488d907562e \ No newline at end of file +3f878238886edaa1e92d4597e28ac4a8 \ No newline at end of file diff --git a/hidboot_8cpp_source.html b/hidboot_8cpp_source.html index 4a266a37..efdd6f85 100644 --- a/hidboot_8cpp_source.html +++ b/hidboot_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidboot.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -220,115 +221,91 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    129  if (buf[2] == 1)
    130  return;
    131 
    -
    132  //KBDINFO *pki = (KBDINFO*)buf;
    +
    132  //KBDINFO *pki = (KBDINFO*)buf;
    133 
    -
    134  // provide event for changed control key state
    -
    135  if (prevState.bInfo[0x00] != buf[0x00]) {
    -
    136  OnControlKeysChanged(prevState.bInfo[0x00], buf[0x00]);
    -
    137  }
    +
    134  // provide event for changed control key state
    +
    135  if (prevState.bInfo[0x00] != buf[0x00]) {
    +
    136  OnControlKeysChanged(prevState.bInfo[0x00], buf[0x00]);
    +
    137  }
    138 
    139  for (uint8_t i = 2; i < 8; i++) {
    140  bool down = false;
    141  bool up = false;
    142 
    143  for (uint8_t j = 2; j < 8; j++) {
    -
    144  if (buf[i] == prevState.bInfo[j] && buf[i] != 1)
    +
    144  if (buf[i] == prevState.bInfo[j] && buf[i] != 1)
    145  down = true;
    -
    146  if (buf[j] == prevState.bInfo[i] && prevState.bInfo[i] != 1)
    +
    146  if (buf[j] == prevState.bInfo[i] && prevState.bInfo[i] != 1)
    147  up = true;
    148  }
    149  if (!down) {
    -
    150  HandleLockingKeys(hid, buf[i]);
    +
    150  HandleLockingKeys(hid, buf[i]);
    151  OnKeyDown(*buf, buf[i]);
    152  }
    153  if (!up)
    -
    154  OnKeyUp(prevState.bInfo[0], prevState.bInfo[i]);
    +
    154  OnKeyUp(prevState.bInfo[0], prevState.bInfo[i]);
    155  }
    156  for (uint8_t i = 0; i < 8; i++)
    -
    157  prevState.bInfo[i] = buf[i];
    +
    157  prevState.bInfo[i] = buf[i];
    158 };
    159 
    -
    160 uint8_t KeyboardReportParser::HandleLockingKeys(HID *hid, uint8_t key) {
    -
    161  uint8_t old_keys = kbdLockingKeys.bLeds;
    -
    162 
    -
    163  switch (key) {
    - -
    165  kbdLockingKeys.kbdLeds.bmNumLock = ~kbdLockingKeys.kbdLeds.bmNumLock;
    -
    166  break;
    - -
    168  kbdLockingKeys.kbdLeds.bmCapsLock = ~kbdLockingKeys.kbdLeds.bmCapsLock;
    -
    169  break;
    - -
    171  kbdLockingKeys.kbdLeds.bmScrollLock = ~kbdLockingKeys.kbdLeds.bmScrollLock;
    -
    172  break;
    -
    173  }
    +
    160 const uint8_t KeyboardReportParser::numKeys[10] PROGMEM = {'!', '@', '#', '$', '%', '^', '&', '*', '(', ')'};
    +
    161 const uint8_t KeyboardReportParser::symKeysUp[12] PROGMEM = {'_', '+', '{', '}', '|', '~', ':', '"', '~', '<', '>', '?'};
    +
    162 const uint8_t KeyboardReportParser::symKeysLo[12] PROGMEM = {'-', '=', '[', ']', '\\', ' ', ';', '\'', '`', ',', '.', '/'};
    +
    163 const uint8_t KeyboardReportParser::padKeys[5] PROGMEM = {'/', '*', '-', '+', 0x13};
    +
    164 
    +
    165 uint8_t KeyboardReportParser::OemToAscii(uint8_t mod, uint8_t key) {
    +
    166  uint8_t shift = (mod & 0x22);
    +
    167 
    +
    168  // [a-z]
    +
    169  if (VALUE_WITHIN(key, 0x04, 0x1d)) {
    +
    170  // Upper case letters
    +
    171  if ((kbdLockingKeys.kbdLeds.bmCapsLock == 0 && shift) ||
    +
    172  (kbdLockingKeys.kbdLeds.bmCapsLock == 1 && shift == 0))
    +
    173  return (key - 4 + 'A');
    174 
    -
    175  if (old_keys != kbdLockingKeys.bLeds && hid)
    -
    176  return (hid->SetReport(0, 0/*hid->GetIface()*/, 2, 0, 1, &kbdLockingKeys.bLeds));
    -
    177 
    -
    178  return 0;
    -
    179 }
    -
    180 
    -
    181 const uint8_t KeyboardReportParser::numKeys[10] PROGMEM = {'!', '@', '#', '$', '%', '^', '&', '*', '(', ')'};
    -
    182 const uint8_t KeyboardReportParser::symKeysUp[12] PROGMEM = {'_', '+', '{', '}', '|', '~', ':', '"', '~', '<', '>', '?'};
    -
    183 const uint8_t KeyboardReportParser::symKeysLo[12] PROGMEM = {'-', '=', '[', ']', '\\', ' ', ';', '\'', '`', ',', '.', '/'};
    -
    184 const uint8_t KeyboardReportParser::padKeys[5] PROGMEM = {'/', '*', '-', '+', 0x13};
    -
    185 
    -
    186 uint8_t KeyboardReportParser::OemToAscii(uint8_t mod, uint8_t key) {
    -
    187  uint8_t shift = (mod & 0x22);
    -
    188 
    -
    189  // [a-z]
    -
    190  if (VALUE_WITHIN(key, 0x04, 0x1d)) {
    -
    191  // Upper case letters
    -
    192  if ((kbdLockingKeys.kbdLeds.bmCapsLock == 0 && (mod & 2)) ||
    -
    193  (kbdLockingKeys.kbdLeds.bmCapsLock == 1 && (mod & 2) == 0))
    -
    194  return (key - 4 + 'A');
    -
    195 
    -
    196  // Lower case letters
    -
    197  else
    -
    198  return (key - 4 + 'a');
    -
    199  }// Numbers
    -
    200  else if (VALUE_WITHIN(key, 0x1e, 0x27)) {
    -
    201  if (shift)
    -
    202  return ((uint8_t)pgm_read_byte(&getNumKeys()[key - 0x1e]));
    -
    203  else
    -
    204  return ((key == UHS_HID_BOOT_KEY_ZERO) ? '0' : key - 0x1e + '1');
    -
    205  }// Keypad Numbers
    -
    206  else if(VALUE_WITHIN(key, 0x59, 0x61)) {
    -
    207  if(kbdLockingKeys.kbdLeds.bmNumLock == 1)
    -
    208  return (key - 0x59 + '1');
    -
    209  } else if(VALUE_WITHIN(key, 0x2d, 0x38))
    -
    210  return ((shift) ? (uint8_t)pgm_read_byte(&getSymKeysUp()[key - 0x2d]) : (uint8_t)pgm_read_byte(&getSymKeysLo()[key - 0x2d]));
    -
    211  else if(VALUE_WITHIN(key, 0x54, 0x58))
    -
    212  return (uint8_t)pgm_read_byte(&getPadKeys()[key - 0x54]);
    -
    213  else {
    -
    214  switch(key) {
    -
    215  case UHS_HID_BOOT_KEY_SPACE: return (0x20);
    -
    216  case UHS_HID_BOOT_KEY_ENTER: return (0x13);
    -
    217  case UHS_HID_BOOT_KEY_ZERO2: return ((kbdLockingKeys.kbdLeds.bmNumLock == 1) ? '0': 0);
    -
    218  case UHS_HID_BOOT_KEY_PERIOD: return ((kbdLockingKeys.kbdLeds.bmNumLock == 1) ? '.': 0);
    -
    219  }
    -
    220  }
    -
    221  return ( 0);
    -
    222 }
    +
    175  // Lower case letters
    +
    176  else
    +
    177  return (key - 4 + 'a');
    +
    178  }// Numbers
    +
    179  else if (VALUE_WITHIN(key, 0x1e, 0x27)) {
    +
    180  if (shift)
    +
    181  return ((uint8_t)pgm_read_byte(&getNumKeys()[key - 0x1e]));
    +
    182  else
    +
    183  return ((key == UHS_HID_BOOT_KEY_ZERO) ? '0' : key - 0x1e + '1');
    +
    184  }// Keypad Numbers
    +
    185  else if(VALUE_WITHIN(key, 0x59, 0x61)) {
    +
    186  if(kbdLockingKeys.kbdLeds.bmNumLock == 1)
    +
    187  return (key - 0x59 + '1');
    +
    188  } else if(VALUE_WITHIN(key, 0x2d, 0x38))
    +
    189  return ((shift) ? (uint8_t)pgm_read_byte(&getSymKeysUp()[key - 0x2d]) : (uint8_t)pgm_read_byte(&getSymKeysLo()[key - 0x2d]));
    +
    190  else if(VALUE_WITHIN(key, 0x54, 0x58))
    +
    191  return (uint8_t)pgm_read_byte(&getPadKeys()[key - 0x54]);
    +
    192  else {
    +
    193  switch(key) {
    +
    194  case UHS_HID_BOOT_KEY_SPACE: return (0x20);
    +
    195  case UHS_HID_BOOT_KEY_ENTER: return (0x13);
    +
    196  case UHS_HID_BOOT_KEY_ZERO2: return ((kbdLockingKeys.kbdLeds.bmNumLock == 1) ? '0': 0);
    +
    197  case UHS_HID_BOOT_KEY_PERIOD: return ((kbdLockingKeys.kbdLeds.bmNumLock == 1) ? '.': 0);
    +
    198  }
    +
    199  }
    +
    200  return ( 0);
    +
    201 }
    #define UHS_HID_BOOT_KEY_PERIOD
    Definition: hidboot.h:29
    uint8_t bmRightButton
    Definition: hidboot.h:43
    -
    virtual const uint8_t * getSymKeysLo()
    Definition: hidboot.h:169
    +
    virtual const uint8_t * getSymKeysLo()
    Definition: hidboot.h:189
    virtual void OnRightButtonDown(MOUSEINFO *mi)
    Definition: hidboot.h:75
    -
    virtual void OnKeyDown(uint8_t mod, uint8_t key)
    Definition: hidboot.h:155
    -
    uint8_t SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)
    Definition: hid.cpp:50
    +
    virtual void OnKeyDown(uint8_t mod, uint8_t key)
    Definition: hidboot.h:175
    +
    virtual uint8_t HandleLockingKeys(HID *hid, uint8_t key)
    Definition: hidboot.h:151
    virtual void OnMiddleButtonUp(MOUSEINFO *mi)
    Definition: hidboot.h:78
    -
    virtual uint8_t HandleLockingKeys(HID *hid, uint8_t key)
    Definition: hidboot.cpp:160
    -
    virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    Definition: hidboot.cpp:19
    +
    void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    Definition: hidboot.cpp:19
    #define UHS_HID_BOOT_KEY_ZERO2
    Definition: hidboot.h:28
    -
    #define UHS_HID_BOOT_KEY_SCROLL_LOCK
    Definition: hidboot.h:26
    -
    union KeyboardReportParser::@14 kbdLockingKeys
    -
    union KeyboardReportParser::@13 prevState
    +
    #define pgm_read_byte(addr)
    #define UHS_HID_BOOT_KEY_ZERO
    Definition: hidboot.h:22
    -
    virtual void OnKeyUp(uint8_t mod, uint8_t key)
    Definition: hidboot.h:158
    -
    virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    Definition: hidboot.cpp:127
    -
    virtual const uint8_t * getSymKeysUp()
    Definition: hidboot.h:165
    +
    virtual void OnKeyUp(uint8_t mod, uint8_t key)
    Definition: hidboot.h:178
    +
    void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    Definition: hidboot.cpp:127
    +
    virtual const uint8_t * getSymKeysUp()
    Definition: hidboot.h:185
    uint8_t bmMiddleButton
    Definition: hidboot.h:44
    virtual void OnLeftButtonUp(MOUSEINFO *mi)
    Definition: hidboot.h:66
    #define UHS_HID_BOOT_KEY_SPACE
    Definition: hidboot.h:24
    @@ -338,23 +315,23 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    Definition: hid.h:143
    #define VALUE_WITHIN(v, l, h)
    Definition: macros.h:28
    virtual void OnMiddleButtonDown(MOUSEINFO *mi)
    Definition: hidboot.h:81
    -
    #define UHS_HID_BOOT_KEY_NUM_LOCK
    Definition: hidboot.h:27
    #define UHS_HID_BOOT_KEY_ENTER
    Definition: hidboot.h:23
    +
    union KeyboardReportParser::@17 prevState
    int8_t dX
    Definition: hidboot.h:47
    -
    virtual void OnControlKeysChanged(uint8_t before, uint8_t after)
    Definition: hidboot.h:152
    +
    virtual void OnControlKeysChanged(uint8_t before, uint8_t after)
    Definition: hidboot.h:172
    virtual void OnLeftButtonDown(MOUSEINFO *mi)
    Definition: hidboot.h:69
    -
    virtual const uint8_t * getNumKeys()
    Definition: hidboot.h:161
    -
    virtual const uint8_t * getPadKeys()
    Definition: hidboot.h:173
    +
    virtual const uint8_t * getNumKeys()
    Definition: hidboot.h:181
    +
    union KeyboardReportParser::@18 kbdLockingKeys
    +
    virtual const uint8_t * getPadKeys()
    Definition: hidboot.h:193
    int8_t dY
    Definition: hidboot.h:48
    uint8_t bmLeftButton
    Definition: hidboot.h:42
    -
    #define UHS_HID_BOOT_KEY_CAPS_LOCK
    Definition: hidboot.h:25
    -
    uint8_t OemToAscii(uint8_t mod, uint8_t key)
    Definition: hidboot.cpp:186
    +
    uint8_t OemToAscii(uint8_t mod, uint8_t key)
    Definition: hidboot.cpp:165
    diff --git a/hidboot_8h.html b/hidboot_8h.html index 017a0d27..7022e171 100644 --- a/hidboot_8h.html +++ b/hidboot_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidboot.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -324,7 +325,7 @@ Macros diff --git a/hidboot_8h__dep__incl.md5 b/hidboot_8h__dep__incl.md5 index fde1084f..4ec250d7 100644 --- a/hidboot_8h__dep__incl.md5 +++ b/hidboot_8h__dep__incl.md5 @@ -1 +1 @@ -6ab61eb2435ebc69d824293cce425db4 \ No newline at end of file +eb017a1dbabb14c916b6c609ad0b5f09 \ No newline at end of file diff --git a/hidboot_8h__incl.md5 b/hidboot_8h__incl.md5 index 1abb40d3..caa29a41 100644 --- a/hidboot_8h__incl.md5 +++ b/hidboot_8h__incl.md5 @@ -1 +1 @@ -a189a867cd61aacdf2d7e1bed35f13d7 \ No newline at end of file +64945fd12fafd7f11121e63e28020a79 \ No newline at end of file diff --git a/hidboot_8h_source.html b/hidboot_8h_source.html index c630b806..aa8779d6 100644 --- a/hidboot_8h_source.html +++ b/hidboot_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidboot.h Source File + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -147,7 +148,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    56  } prevState;
    57 
    58 public:
    -
    59  virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf);
    +
    59  void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf);
    60 
    61 protected:
    62 
    @@ -220,510 +221,544 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    129  union {
    131  uint8_t bInfo[sizeof (KBDINFO)];
    -
    132  } prevState;
    +
    132  } prevState;
    133 
    134  union {
    136  uint8_t bLeds;
    -
    137  } kbdLockingKeys;
    +
    137  } kbdLockingKeys;
    138 
    139  uint8_t OemToAscii(uint8_t mod, uint8_t key);
    140 
    141 public:
    142 
    -
    144  kbdLockingKeys.bLeds = 0;
    +
    144  kbdLockingKeys.bLeds = 0;
    145  };
    146 
    -
    147  virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf);
    +
    147  void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf);
    148 
    149 protected:
    -
    150  virtual uint8_t HandleLockingKeys(HID* hid, uint8_t key);
    -
    151 
    -
    152  virtual void OnControlKeysChanged(uint8_t before, uint8_t after) {
    -
    153  };
    -
    154 
    -
    155  virtual void OnKeyDown(uint8_t mod, uint8_t key) {
    -
    156  };
    -
    157 
    -
    158  virtual void OnKeyUp(uint8_t mod, uint8_t key) {
    -
    159  };
    -
    160 
    -
    161  virtual const uint8_t *getNumKeys() {
    -
    162  return numKeys;
    -
    163  };
    -
    164 
    -
    165  virtual const uint8_t *getSymKeysUp() {
    -
    166  return symKeysUp;
    -
    167  };
    +
    150 
    +
    151  virtual uint8_t HandleLockingKeys(HID* hid, uint8_t key) {
    +
    152  uint8_t old_keys = kbdLockingKeys.bLeds;
    +
    153 
    +
    154  switch(key) {
    + +
    156  kbdLockingKeys.kbdLeds.bmNumLock = ~kbdLockingKeys.kbdLeds.bmNumLock;
    +
    157  break;
    + +
    159  kbdLockingKeys.kbdLeds.bmCapsLock = ~kbdLockingKeys.kbdLeds.bmCapsLock;
    +
    160  break;
    + +
    162  kbdLockingKeys.kbdLeds.bmScrollLock = ~kbdLockingKeys.kbdLeds.bmScrollLock;
    +
    163  break;
    +
    164  }
    +
    165 
    +
    166  if(old_keys != kbdLockingKeys.bLeds && hid)
    +
    167  return (hid->SetReport(0, 0/*hid->GetIface()*/, 2, 0, 1, &kbdLockingKeys.bLeds));
    168 
    -
    169  virtual const uint8_t *getSymKeysLo() {
    -
    170  return symKeysLo;
    -
    171  };
    -
    172 
    -
    173  virtual const uint8_t *getPadKeys() {
    -
    174  return padKeys;
    -
    175  };
    -
    176 };
    +
    169  return 0;
    +
    170  };
    +
    171 
    +
    172  virtual void OnControlKeysChanged(uint8_t before, uint8_t after) {
    +
    173  };
    +
    174 
    +
    175  virtual void OnKeyDown(uint8_t mod, uint8_t key) {
    +
    176  };
    177 
    -
    178 template <const uint8_t BOOT_PROTOCOL>
    -
    179 class HIDBoot : public HID //public USBDeviceConfig, public UsbConfigXtracter
    -
    180 {
    -
    181  EpInfo epInfo[totalEndpoints(BOOT_PROTOCOL)];
    -
    182  HIDReportParser *pRptParser[epMUL(BOOT_PROTOCOL)];
    -
    183 
    -
    184  uint8_t bConfNum; // configuration number
    -
    185  uint8_t bIfaceNum; // Interface Number
    -
    186  uint8_t bNumIface; // number of interfaces in the configuration
    -
    187  uint8_t bNumEP; // total number of EP in the configuration
    -
    188  uint32_t qNextPollTime; // next poll time
    -
    189  bool bPollEnable; // poll enable flag
    -
    190  uint8_t bInterval; // largest interval
    -
    191 
    -
    192  void Initialize();
    -
    193 
    -
    194  virtual HIDReportParser* GetReportParser(uint8_t id) {
    -
    195  return pRptParser[id];
    -
    196  };
    +
    178  virtual void OnKeyUp(uint8_t mod, uint8_t key) {
    +
    179  };
    +
    180 
    +
    181  virtual const uint8_t *getNumKeys() {
    +
    182  return numKeys;
    +
    183  };
    +
    184 
    +
    185  virtual const uint8_t *getSymKeysUp() {
    +
    186  return symKeysUp;
    +
    187  };
    +
    188 
    +
    189  virtual const uint8_t *getSymKeysLo() {
    +
    190  return symKeysLo;
    +
    191  };
    +
    192 
    +
    193  virtual const uint8_t *getPadKeys() {
    +
    194  return padKeys;
    +
    195  };
    +
    196 };
    197 
    -
    198 public:
    -
    199  HIDBoot(USB *p);
    -
    200 
    -
    201  virtual bool SetReportParser(uint8_t id, HIDReportParser *prs) {
    -
    202  pRptParser[id] = prs;
    -
    203  return true;
    -
    204  };
    -
    205 
    -
    206  // USBDeviceConfig implementation
    -
    207  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
    -
    208  virtual uint8_t Release();
    -
    209  virtual uint8_t Poll();
    -
    210 
    -
    211  virtual uint8_t GetAddress() {
    -
    212  return bAddress;
    -
    213  };
    -
    214 
    -
    215  // UsbConfigXtracter implementation
    -
    216  virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
    -
    217 };
    -
    218 
    -
    219 template <const uint8_t BOOT_PROTOCOL>
    - -
    221 HID(p),
    -
    222 qNextPollTime(0),
    -
    223 bPollEnable(false) {
    -
    224  Initialize();
    +
    198 template <const uint8_t BOOT_PROTOCOL>
    +
    199 class HIDBoot : public HID //public USBDeviceConfig, public UsbConfigXtracter
    +
    200 {
    +
    201  EpInfo epInfo[totalEndpoints(BOOT_PROTOCOL)];
    +
    202  HIDReportParser *pRptParser[epMUL(BOOT_PROTOCOL)];
    +
    203 
    +
    204  uint8_t bConfNum; // configuration number
    +
    205  uint8_t bIfaceNum; // Interface Number
    +
    206  uint8_t bNumIface; // number of interfaces in the configuration
    +
    207  uint8_t bNumEP; // total number of EP in the configuration
    +
    208  uint32_t qNextPollTime; // next poll time
    +
    209  bool bPollEnable; // poll enable flag
    +
    210  uint8_t bInterval; // largest interval
    +
    211 
    +
    212  void Initialize();
    +
    213 
    +
    214  virtual HIDReportParser* GetReportParser(uint8_t id) {
    +
    215  return pRptParser[id];
    +
    216  };
    +
    217 
    +
    218 public:
    +
    219  HIDBoot(USB *p);
    +
    220 
    +
    221  virtual bool SetReportParser(uint8_t id, HIDReportParser *prs) {
    +
    222  pRptParser[id] = prs;
    +
    223  return true;
    +
    224  };
    225 
    -
    226  for(int i = 0; i < epMUL(BOOT_PROTOCOL); i++) {
    -
    227  pRptParser[i] = NULL;
    -
    228  }
    -
    229  if(pUsb)
    -
    230  pUsb->RegisterDeviceClass(this);
    -
    231 }
    -
    232 
    -
    233 template <const uint8_t BOOT_PROTOCOL>
    - -
    235  for(int i = 0; i < totalEndpoints(BOOT_PROTOCOL); i++) {
    -
    236  epInfo[i].epAddr = 0;
    -
    237  epInfo[i].maxPktSize = (i) ? 0 : 8;
    -
    238  epInfo[i].epAttribs = 0;
    -
    239  epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
    -
    240  }
    -
    241  bNumEP = 1;
    -
    242  bNumIface = 0;
    -
    243  bConfNum = 0;
    -
    244 }
    -
    245 
    -
    246 template <const uint8_t BOOT_PROTOCOL>
    -
    247 uint8_t HIDBoot<BOOT_PROTOCOL>::Init(uint8_t parent, uint8_t port, bool lowspeed) {
    -
    248  const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR);
    -
    249 
    -
    250  uint8_t buf[constBufSize];
    -
    251  uint8_t rcode;
    -
    252  UsbDevice *p = NULL;
    -
    253  EpInfo *oldep_ptr = NULL;
    -
    254  uint8_t len = 0;
    -
    255  //uint16_t cd_len = 0;
    -
    256 
    -
    257  uint8_t num_of_conf; // number of configurations
    -
    258  //uint8_t num_of_intf; // number of interfaces
    -
    259 
    -
    260  AddressPool &addrPool = pUsb->GetAddressPool();
    -
    261 
    -
    262  USBTRACE("BM Init\r\n");
    -
    263  //USBTRACE2("totalEndpoints:", (uint8_t) (totalEndpoints(BOOT_PROTOCOL)));
    -
    264  //USBTRACE2("epMUL:", epMUL(BOOT_PROTOCOL));
    +
    226  // USBDeviceConfig implementation
    +
    227  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
    +
    228  uint8_t Release();
    +
    229  uint8_t Poll();
    +
    230 
    +
    231  virtual uint8_t GetAddress() {
    +
    232  return bAddress;
    +
    233  };
    +
    234 
    +
    235  virtual bool isReady() {
    +
    236  return bPollEnable;
    +
    237  };
    +
    238 
    +
    239  // UsbConfigXtracter implementation
    +
    240  // Method should be defined here if virtual.
    +
    241  virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
    +
    242 
    +
    243  virtual bool DEVCLASSOK(uint8_t klass) {
    +
    244  return (klass == USB_CLASS_HID);
    +
    245  }
    +
    246 
    +
    247  virtual bool DEVSUBCLASSOK(uint8_t subklass) {
    +
    248  return (subklass == BOOT_PROTOCOL);
    +
    249  }
    +
    250 };
    +
    251 
    +
    252 template <const uint8_t BOOT_PROTOCOL>
    + +
    254 HID(p),
    +
    255 qNextPollTime(0),
    +
    256 bPollEnable(false) {
    +
    257  Initialize();
    +
    258 
    +
    259  for(int i = 0; i < epMUL(BOOT_PROTOCOL); i++) {
    +
    260  pRptParser[i] = NULL;
    +
    261  }
    +
    262  if(pUsb)
    +
    263  pUsb->RegisterDeviceClass(this);
    +
    264 }
    265 
    -
    266  if(bAddress)
    - -
    268 
    -
    269  bInterval = 0;
    -
    270  // Get pointer to pseudo device with address 0 assigned
    -
    271  p = addrPool.GetUsbDevicePtr(0);
    -
    272 
    -
    273  if(!p)
    - -
    275 
    -
    276  if(!p->epinfo) {
    -
    277  USBTRACE("epinfo\r\n");
    - -
    279  }
    -
    280 
    -
    281  // Save old pointer to EP_RECORD of address 0
    -
    282  oldep_ptr = p->epinfo;
    -
    283 
    -
    284  // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence
    -
    285  p->epinfo = epInfo;
    -
    286 
    -
    287  p->lowspeed = lowspeed;
    -
    288 
    -
    289  // Get device descriptor
    -
    290  rcode = pUsb->getDevDescr(0, 0, 8, (uint8_t*)buf);
    -
    291 
    -
    292  if(!rcode)
    -
    293  len = (buf[0] > constBufSize) ? constBufSize : buf[0];
    +
    266 template <const uint8_t BOOT_PROTOCOL>
    + +
    268  for(int i = 0; i < totalEndpoints(BOOT_PROTOCOL); i++) {
    +
    269  epInfo[i].epAddr = 0;
    +
    270  epInfo[i].maxPktSize = (i) ? 0 : 8;
    +
    271  epInfo[i].epAttribs = 0;
    +
    272  epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
    +
    273  }
    +
    274  bNumEP = 1;
    +
    275  bNumIface = 0;
    +
    276  bConfNum = 0;
    +
    277 }
    +
    278 
    +
    279 template <const uint8_t BOOT_PROTOCOL>
    +
    280 uint8_t HIDBoot<BOOT_PROTOCOL>::Init(uint8_t parent, uint8_t port, bool lowspeed) {
    +
    281  const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR);
    +
    282 
    +
    283  uint8_t buf[constBufSize];
    +
    284  uint8_t rcode;
    +
    285  UsbDevice *p = NULL;
    +
    286  EpInfo *oldep_ptr = NULL;
    +
    287  uint8_t len = 0;
    +
    288  //uint16_t cd_len = 0;
    +
    289 
    +
    290  uint8_t num_of_conf; // number of configurations
    +
    291  //uint8_t num_of_intf; // number of interfaces
    +
    292 
    +
    293  AddressPool &addrPool = pUsb->GetAddressPool();
    294 
    -
    295  if(rcode) {
    -
    296  // Restore p->epinfo
    -
    297  p->epinfo = oldep_ptr;
    +
    295  USBTRACE("BM Init\r\n");
    +
    296  //USBTRACE2("totalEndpoints:", (uint8_t) (totalEndpoints(BOOT_PROTOCOL)));
    +
    297  //USBTRACE2("epMUL:", epMUL(BOOT_PROTOCOL));
    298 
    -
    299  goto FailGetDevDescr;
    -
    300  }
    +
    299  if(bAddress)
    +
    301 
    -
    302  // Restore p->epinfo
    -
    303  p->epinfo = oldep_ptr;
    -
    304 
    -
    305  // Allocate new address according to device class
    -
    306  bAddress = addrPool.AllocAddress(parent, false, port);
    -
    307 
    -
    308  if(!bAddress)
    - -
    310 
    -
    311  // Extract Max Packet Size from the device descriptor
    -
    312  epInfo[0].maxPktSize = (uint8_t)((USB_DEVICE_DESCRIPTOR*)buf)->bMaxPacketSize0;
    +
    302  bInterval = 0;
    +
    303  // Get pointer to pseudo device with address 0 assigned
    +
    304  p = addrPool.GetUsbDevicePtr(0);
    +
    305 
    +
    306  if(!p)
    + +
    308 
    +
    309  if(!p->epinfo) {
    +
    310  USBTRACE("epinfo\r\n");
    + +
    312  }
    313 
    -
    314  // Assign new address to the device
    -
    315  rcode = pUsb->setAddr(0, 0, bAddress);
    +
    314  // Save old pointer to EP_RECORD of address 0
    +
    315  oldep_ptr = p->epinfo;
    316 
    -
    317  if(rcode) {
    -
    318  p->lowspeed = false;
    -
    319  addrPool.FreeAddress(bAddress);
    -
    320  bAddress = 0;
    -
    321  USBTRACE2("setAddr:", rcode);
    -
    322  return rcode;
    -
    323  }
    -
    324  //delay(2); //per USB 2.0 sect.9.2.6.3
    -
    325 
    -
    326  USBTRACE2("Addr:", bAddress);
    +
    317  // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence
    +
    318  p->epinfo = epInfo;
    +
    319 
    +
    320  p->lowspeed = lowspeed;
    +
    321 
    +
    322  // Get device descriptor
    +
    323  rcode = pUsb->getDevDescr(0, 0, 8, (uint8_t*)buf);
    +
    324 
    +
    325  if(!rcode)
    +
    326  len = (buf[0] > constBufSize) ? constBufSize : buf[0];
    327 
    -
    328  p->lowspeed = false;
    -
    329 
    -
    330  p = addrPool.GetUsbDevicePtr(bAddress);
    +
    328  if(rcode) {
    +
    329  // Restore p->epinfo
    +
    330  p->epinfo = oldep_ptr;
    331 
    -
    332  if(!p)
    - +
    332  goto FailGetDevDescr;
    +
    333  }
    334 
    -
    335  p->lowspeed = lowspeed;
    -
    336 
    -
    337  if(len)
    -
    338  rcode = pUsb->getDevDescr(bAddress, 0, len, (uint8_t*)buf);
    -
    339 
    -
    340  if(rcode)
    -
    341  goto FailGetDevDescr;
    -
    342 
    -
    343  num_of_conf = ((USB_DEVICE_DESCRIPTOR*)buf)->bNumConfigurations;
    -
    344 
    -
    345  USBTRACE2("NC:", num_of_conf);
    +
    335  // Restore p->epinfo
    +
    336  p->epinfo = oldep_ptr;
    +
    337 
    +
    338  // Allocate new address according to device class
    +
    339  bAddress = addrPool.AllocAddress(parent, false, port);
    +
    340 
    +
    341  if(!bAddress)
    + +
    343 
    +
    344  // Extract Max Packet Size from the device descriptor
    +
    345  epInfo[0].maxPktSize = (uint8_t)((USB_DEVICE_DESCRIPTOR*)buf)->bMaxPacketSize0;
    346 
    -
    347  // GCC will optimize unused stuff away.
    - -
    349  USBTRACE("HID_PROTOCOL_KEYBOARD AND MOUSE\r\n");
    - - - - -
    354  CP_MASK_COMPARE_ALL > confDescrParser(this);
    -
    355  confDescrParser.SetOR(); // Use the OR variant.
    -
    356  for(uint8_t i = 0; i < num_of_conf; i++) {
    -
    357  pUsb->getConfDescr(bAddress, 0, i, &confDescrParser);
    -
    358  if(bNumEP == (uint8_t)(totalEndpoints(BOOT_PROTOCOL)))
    -
    359  break;
    -
    360  }
    -
    361  } else {
    -
    362  // GCC will optimize unused stuff away.
    -
    363  if(BOOT_PROTOCOL & HID_PROTOCOL_KEYBOARD) {
    -
    364  USBTRACE("HID_PROTOCOL_KEYBOARD\r\n");
    -
    365  for(uint8_t i = 0; i < num_of_conf; i++) {
    - - - - -
    370  CP_MASK_COMPARE_ALL> confDescrParserA(this);
    -
    371 
    -
    372  pUsb->getConfDescr(bAddress, 0, i, &confDescrParserA);
    -
    373  if(bNumEP == (uint8_t)(totalEndpoints(BOOT_PROTOCOL)))
    -
    374  break;
    -
    375  }
    -
    376  }
    +
    347  // Assign new address to the device
    +
    348  rcode = pUsb->setAddr(0, 0, bAddress);
    +
    349 
    +
    350  if(rcode) {
    +
    351  p->lowspeed = false;
    +
    352  addrPool.FreeAddress(bAddress);
    +
    353  bAddress = 0;
    +
    354  USBTRACE2("setAddr:", rcode);
    +
    355  return rcode;
    +
    356  }
    +
    357  //delay(2); //per USB 2.0 sect.9.2.6.3
    +
    358 
    +
    359  USBTRACE2("Addr:", bAddress);
    +
    360 
    +
    361  p->lowspeed = false;
    +
    362 
    +
    363  p = addrPool.GetUsbDevicePtr(bAddress);
    +
    364 
    +
    365  if(!p)
    + +
    367 
    +
    368  p->lowspeed = lowspeed;
    +
    369 
    +
    370  if(len)
    +
    371  rcode = pUsb->getDevDescr(bAddress, 0, len, (uint8_t*)buf);
    +
    372 
    +
    373  if(rcode)
    +
    374  goto FailGetDevDescr;
    +
    375 
    +
    376  num_of_conf = ((USB_DEVICE_DESCRIPTOR*)buf)->bNumConfigurations;
    377 
    -
    378  // GCC will optimize unused stuff away.
    -
    379  if(BOOT_PROTOCOL & HID_PROTOCOL_MOUSE) {
    -
    380  USBTRACE("HID_PROTOCOL_MOUSE\r\n");
    -
    381  for(uint8_t i = 0; i < num_of_conf; i++) {
    - - - - -
    386  CP_MASK_COMPARE_ALL> confDescrParserB(this);
    -
    387 
    -
    388  pUsb->getConfDescr(bAddress, 0, i, &confDescrParserB);
    -
    389  if(bNumEP == ((uint8_t)(totalEndpoints(BOOT_PROTOCOL))))
    -
    390  break;
    -
    391 
    -
    392  }
    +
    378  USBTRACE2("NC:", num_of_conf);
    +
    379 
    +
    380  // GCC will optimize unused stuff away.
    + +
    382  USBTRACE("HID_PROTOCOL_KEYBOARD AND MOUSE\r\n");
    + + + + +
    387  CP_MASK_COMPARE_ALL > confDescrParser(this);
    +
    388  confDescrParser.SetOR(); // Use the OR variant.
    +
    389  for(uint8_t i = 0; i < num_of_conf; i++) {
    +
    390  pUsb->getConfDescr(bAddress, 0, i, &confDescrParser);
    +
    391  if(bNumEP == (uint8_t)(totalEndpoints(BOOT_PROTOCOL)))
    +
    392  break;
    393  }
    -
    394  }
    -
    395  USBTRACE2("bNumEP:", bNumEP);
    -
    396 
    -
    397  if(bNumEP != (uint8_t)(totalEndpoints(BOOT_PROTOCOL))) {
    - -
    399  goto Fail;
    -
    400  }
    -
    401 
    -
    402  // Assign epInfo to epinfo pointer
    -
    403  rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo);
    -
    404  //USBTRACE2("setEpInfoEntry returned ", rcode);
    -
    405  USBTRACE2("Cnf:", bConfNum);
    -
    406 
    -
    407  delay(1000);
    -
    408 
    -
    409  // Set Configuration Value
    -
    410  rcode = pUsb->setConf(bAddress, 0, bConfNum);
    -
    411 
    -
    412  if(rcode)
    -
    413  goto FailSetConfDescr;
    -
    414 
    -
    415  delay(1000);
    -
    416 
    -
    417  USBTRACE2("bIfaceNum:", bIfaceNum);
    -
    418  USBTRACE2("bNumIface:", bNumIface);
    -
    419 
    -
    420  // Yes, mouse wants SetProtocol and SetIdle too!
    -
    421  for(uint8_t i = 0; i < epMUL(BOOT_PROTOCOL); i++) {
    -
    422  USBTRACE2("\r\nInterface:", i);
    -
    423  rcode = SetProtocol(i, HID_BOOT_PROTOCOL);
    -
    424  if(rcode) goto FailSetProtocol;
    -
    425  USBTRACE2("PROTOCOL SET HID_BOOT rcode:", rcode);
    -
    426  rcode = SetIdle(i, 0, 0);
    -
    427  USBTRACE2("SET_IDLE rcode:", rcode);
    -
    428  // if(rcode) goto FailSetIdle; This can fail.
    -
    429  // Get the RPIPE and just throw it away.
    - -
    431  rcode = GetReportDescr(i, &sink);
    -
    432  USBTRACE2("RPIPE rcode:", rcode);
    +
    394  } else {
    +
    395  // GCC will optimize unused stuff away.
    +
    396  if(BOOT_PROTOCOL & HID_PROTOCOL_KEYBOARD) {
    +
    397  USBTRACE("HID_PROTOCOL_KEYBOARD\r\n");
    +
    398  for(uint8_t i = 0; i < num_of_conf; i++) {
    + + + + +
    403  CP_MASK_COMPARE_ALL> confDescrParserA(this);
    +
    404 
    +
    405  pUsb->getConfDescr(bAddress, 0, i, &confDescrParserA);
    +
    406  if(bNumEP == (uint8_t)(totalEndpoints(BOOT_PROTOCOL)))
    +
    407  break;
    +
    408  }
    +
    409  }
    +
    410 
    +
    411  // GCC will optimize unused stuff away.
    +
    412  if(BOOT_PROTOCOL & HID_PROTOCOL_MOUSE) {
    +
    413  USBTRACE("HID_PROTOCOL_MOUSE\r\n");
    +
    414  for(uint8_t i = 0; i < num_of_conf; i++) {
    + + + + +
    419  CP_MASK_COMPARE_ALL> confDescrParserB(this);
    +
    420 
    +
    421  pUsb->getConfDescr(bAddress, 0, i, &confDescrParserB);
    +
    422  if(bNumEP == ((uint8_t)(totalEndpoints(BOOT_PROTOCOL))))
    +
    423  break;
    +
    424 
    +
    425  }
    +
    426  }
    +
    427  }
    +
    428  USBTRACE2("bNumEP:", bNumEP);
    +
    429 
    +
    430  if(bNumEP != (uint8_t)(totalEndpoints(BOOT_PROTOCOL))) {
    + +
    432  goto Fail;
    433  }
    434 
    -
    435  // Get RPIPE and throw it away.
    -
    436 
    -
    437  if(BOOT_PROTOCOL & HID_PROTOCOL_KEYBOARD) {
    -
    438  // Wake keyboard interface by twinkling up to 5 LEDs that are in the spec.
    -
    439  // kana, compose, scroll, caps, num
    -
    440  rcode = 0x20; // Reuse rcode.
    -
    441  while(rcode) {
    -
    442  rcode >>= 1;
    -
    443  // Ignore any error returned, we don't care if LED is not supported
    -
    444  SetReport(0, 0, 2, 0, 1, &rcode); // Eventually becomes zero (All off)
    -
    445  delay(25);
    -
    446  }
    -
    447  }
    -
    448  USBTRACE("BM configured\r\n");
    +
    435  // Assign epInfo to epinfo pointer
    +
    436  rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo);
    +
    437  //USBTRACE2("setEpInfoEntry returned ", rcode);
    +
    438  USBTRACE2("Cnf:", bConfNum);
    +
    439 
    +
    440  delay(1000);
    +
    441 
    +
    442  // Set Configuration Value
    +
    443  rcode = pUsb->setConf(bAddress, 0, bConfNum);
    +
    444 
    +
    445  if(rcode)
    +
    446  goto FailSetConfDescr;
    +
    447 
    +
    448  delay(1000);
    449 
    -
    450  bPollEnable = true;
    -
    451  return 0;
    +
    450  USBTRACE2("bIfaceNum:", bIfaceNum);
    +
    451  USBTRACE2("bNumIface:", bNumIface);
    452 
    -
    453 FailGetDevDescr:
    -
    454 #ifdef DEBUG_USB_HOST
    - -
    456  goto Fail;
    -
    457 #endif
    -
    458 
    -
    459  //FailSetDevTblEntry:
    -
    460  //#ifdef DEBUG_USB_HOST
    -
    461  // NotifyFailSetDevTblEntry();
    -
    462  // goto Fail;
    -
    463  //#endif
    -
    464 
    -
    465  //FailGetConfDescr:
    -
    466  //#ifdef DEBUG_USB_HOST
    -
    467  // NotifyFailGetConfDescr();
    -
    468  // goto Fail;
    -
    469  //#endif
    -
    470 
    -
    471 FailSetConfDescr:
    -
    472 #ifdef DEBUG_USB_HOST
    - -
    474  goto Fail;
    -
    475 #endif
    -
    476 
    -
    477 FailSetProtocol:
    -
    478 #ifdef DEBUG_USB_HOST
    -
    479  USBTRACE("SetProto:");
    -
    480  goto Fail;
    -
    481 #endif
    +
    453  // Yes, mouse wants SetProtocol and SetIdle too!
    +
    454  for(uint8_t i = 0; i < epMUL(BOOT_PROTOCOL); i++) {
    +
    455  USBTRACE2("\r\nInterface:", i);
    +
    456  rcode = SetProtocol(i, HID_BOOT_PROTOCOL);
    +
    457  if(rcode) goto FailSetProtocol;
    +
    458  USBTRACE2("PROTOCOL SET HID_BOOT rcode:", rcode);
    +
    459  rcode = SetIdle(i, 0, 0);
    +
    460  USBTRACE2("SET_IDLE rcode:", rcode);
    +
    461  // if(rcode) goto FailSetIdle; This can fail.
    +
    462  // Get the RPIPE and just throw it away.
    + +
    464  rcode = GetReportDescr(i, &sink);
    +
    465  USBTRACE2("RPIPE rcode:", rcode);
    +
    466  }
    +
    467 
    +
    468  // Get RPIPE and throw it away.
    +
    469 
    +
    470  if(BOOT_PROTOCOL & HID_PROTOCOL_KEYBOARD) {
    +
    471  // Wake keyboard interface by twinkling up to 5 LEDs that are in the spec.
    +
    472  // kana, compose, scroll, caps, num
    +
    473  rcode = 0x20; // Reuse rcode.
    +
    474  while(rcode) {
    +
    475  rcode >>= 1;
    +
    476  // Ignore any error returned, we don't care if LED is not supported
    +
    477  SetReport(0, 0, 2, 0, 1, &rcode); // Eventually becomes zero (All off)
    +
    478  delay(25);
    +
    479  }
    +
    480  }
    +
    481  USBTRACE("BM configured\r\n");
    482 
    -
    483  //FailSetIdle:
    -
    484  //#ifdef DEBUG_USB_HOST
    -
    485  // USBTRACE("SetIdle:");
    -
    486  //#endif
    -
    487 
    -
    488 Fail:
    -
    489 #ifdef DEBUG_USB_HOST
    -
    490  NotifyFail(rcode);
    -
    491 #endif
    -
    492  Release();
    -
    493 
    -
    494  return rcode;
    -
    495 }
    -
    496 
    -
    497 template <const uint8_t BOOT_PROTOCOL>
    -
    498 void HIDBoot<BOOT_PROTOCOL>::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) {
    -
    499 
    -
    500  // If the first configuration satisfies, the others are not considered.
    -
    501  //if(bNumEP > 1 && conf != bConfNum)
    -
    502  if(bNumEP == totalEndpoints(BOOT_PROTOCOL))
    -
    503  return;
    -
    504 
    -
    505  bConfNum = conf;
    -
    506  bIfaceNum = iface;
    -
    507 
    -
    508  if((pep->bmAttributes & 0x03) == 3 && (pep->bEndpointAddress & 0x80) == 0x80) {
    -
    509  if(pep->bInterval > bInterval) bInterval = pep->bInterval;
    -
    510 
    -
    511  // Fill in the endpoint info structure
    -
    512  epInfo[bNumEP].epAddr = (pep->bEndpointAddress & 0x0F);
    -
    513  epInfo[bNumEP].maxPktSize = (uint8_t)pep->wMaxPacketSize;
    -
    514  epInfo[bNumEP].epAttribs = 0;
    -
    515  epInfo[bNumEP].bmNakPower = USB_NAK_NOWAIT;
    -
    516  bNumEP++;
    -
    517 
    -
    518  }
    -
    519 }
    +
    483  bPollEnable = true;
    +
    484  return 0;
    +
    485 
    +
    486 FailGetDevDescr:
    +
    487 #ifdef DEBUG_USB_HOST
    + +
    489  goto Fail;
    +
    490 #endif
    +
    491 
    +
    492  //FailSetDevTblEntry:
    +
    493  //#ifdef DEBUG_USB_HOST
    +
    494  // NotifyFailSetDevTblEntry();
    +
    495  // goto Fail;
    +
    496  //#endif
    +
    497 
    +
    498  //FailGetConfDescr:
    +
    499  //#ifdef DEBUG_USB_HOST
    +
    500  // NotifyFailGetConfDescr();
    +
    501  // goto Fail;
    +
    502  //#endif
    +
    503 
    +
    504 FailSetConfDescr:
    +
    505 #ifdef DEBUG_USB_HOST
    + +
    507  goto Fail;
    +
    508 #endif
    +
    509 
    +
    510 FailSetProtocol:
    +
    511 #ifdef DEBUG_USB_HOST
    +
    512  USBTRACE("SetProto:");
    +
    513  goto Fail;
    +
    514 #endif
    +
    515 
    +
    516  //FailSetIdle:
    +
    517  //#ifdef DEBUG_USB_HOST
    +
    518  // USBTRACE("SetIdle:");
    +
    519  //#endif
    520 
    -
    521 template <const uint8_t BOOT_PROTOCOL>
    - -
    523  pUsb->GetAddressPool().FreeAddress(bAddress);
    -
    524 
    -
    525  bConfNum = 0;
    -
    526  bIfaceNum = 0;
    -
    527  bNumEP = 1;
    -
    528  bAddress = 0;
    -
    529  qNextPollTime = 0;
    -
    530  bPollEnable = false;
    -
    531 
    -
    532  return 0;
    -
    533 }
    -
    534 
    -
    535 template <const uint8_t BOOT_PROTOCOL>
    - -
    537  uint8_t rcode = 0;
    -
    538 
    -
    539  if(bPollEnable && ((long)(millis() - qNextPollTime) >= 0L)) {
    +
    521 Fail:
    +
    522 #ifdef DEBUG_USB_HOST
    +
    523  NotifyFail(rcode);
    +
    524 #endif
    +
    525  Release();
    +
    526 
    +
    527  return rcode;
    +
    528 }
    +
    529 
    +
    530 template <const uint8_t BOOT_PROTOCOL>
    +
    531 void HIDBoot<BOOT_PROTOCOL>::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) {
    +
    532 
    +
    533  // If the first configuration satisfies, the others are not considered.
    +
    534  //if(bNumEP > 1 && conf != bConfNum)
    +
    535  if(bNumEP == totalEndpoints(BOOT_PROTOCOL))
    +
    536  return;
    +
    537 
    +
    538  bConfNum = conf;
    +
    539  bIfaceNum = iface;
    540 
    -
    541  // To-do: optimize manually, using the for loop only if needed.
    -
    542  for(int i = 0; i < epMUL(BOOT_PROTOCOL); i++) {
    -
    543  const uint16_t const_buff_len = 16;
    -
    544  uint8_t buf[const_buff_len];
    -
    545 
    -
    546  USBTRACE3("(hidboot.h) i=", i, 0x81);
    -
    547  USBTRACE3("(hidboot.h) epInfo[epInterruptInIndex + i].epAddr=", epInfo[epInterruptInIndex + i].epAddr, 0x81);
    -
    548  USBTRACE3("(hidboot.h) epInfo[epInterruptInIndex + i].maxPktSize=", epInfo[epInterruptInIndex + i].maxPktSize, 0x81);
    -
    549  uint16_t read = (uint16_t)epInfo[epInterruptInIndex + i].maxPktSize;
    +
    541  if((pep->bmAttributes & 0x03) == 3 && (pep->bEndpointAddress & 0x80) == 0x80) {
    +
    542  if(pep->bInterval > bInterval) bInterval = pep->bInterval;
    +
    543 
    +
    544  // Fill in the endpoint info structure
    +
    545  epInfo[bNumEP].epAddr = (pep->bEndpointAddress & 0x0F);
    +
    546  epInfo[bNumEP].maxPktSize = (uint8_t)pep->wMaxPacketSize;
    +
    547  epInfo[bNumEP].epAttribs = 0;
    +
    548  epInfo[bNumEP].bmNakPower = USB_NAK_NOWAIT;
    +
    549  bNumEP++;
    550 
    -
    551  rcode = pUsb->inTransfer(bAddress, epInfo[epInterruptInIndex + i].epAddr, &read, buf);
    -
    552  // SOME buggy dongles report extra keys (like sleep) using a 2 byte packet on the wrong endpoint.
    -
    553  // Since keyboard and mice must report at least 3 bytes, we ignore the extra data.
    -
    554  if(!rcode && read > 2) {
    -
    555  if(pRptParser[i])
    -
    556  pRptParser[i]->Parse((HID*)this, 0, (uint8_t)read, buf);
    -
    557 #ifdef DEBUG_USB_HOST
    -
    558  // We really don't care about errors and anomalies unless we are debugging.
    -
    559  } else {
    -
    560  if(rcode != hrNAK) {
    -
    561  USBTRACE3("(hidboot.h) Poll:", rcode, 0x81);
    -
    562  }
    -
    563  if(!rcode && read) {
    -
    564  USBTRACE3("(hidboot.h) Strange read count: ", read, 0x80);
    -
    565  USBTRACE3("(hidboot.h) Interface:", i, 0x80);
    -
    566  }
    -
    567  }
    -
    568 
    -
    569  if(!rcode && read && (UsbDEBUGlvl > 0x7f)) {
    -
    570  for(uint8_t i = 0; i < read; i++) {
    -
    571  PrintHex<uint8_t > (buf[i], 0x80);
    -
    572  USBTRACE1(" ", 0x80);
    -
    573  }
    -
    574  if(read)
    -
    575  USBTRACE1("\r\n", 0x80);
    -
    576 #endif
    -
    577  }
    +
    551  }
    +
    552 }
    +
    553 
    +
    554 template <const uint8_t BOOT_PROTOCOL>
    + +
    556  pUsb->GetAddressPool().FreeAddress(bAddress);
    +
    557 
    +
    558  bConfNum = 0;
    +
    559  bIfaceNum = 0;
    +
    560  bNumEP = 1;
    +
    561  bAddress = 0;
    +
    562  qNextPollTime = 0;
    +
    563  bPollEnable = false;
    +
    564 
    +
    565  return 0;
    +
    566 }
    +
    567 
    +
    568 template <const uint8_t BOOT_PROTOCOL>
    + +
    570  uint8_t rcode = 0;
    +
    571 
    +
    572  if(bPollEnable && ((long)(millis() - qNextPollTime) >= 0L)) {
    +
    573 
    +
    574  // To-do: optimize manually, using the for loop only if needed.
    +
    575  for(int i = 0; i < epMUL(BOOT_PROTOCOL); i++) {
    +
    576  const uint16_t const_buff_len = 16;
    +
    577  uint8_t buf[const_buff_len];
    578 
    -
    579  }
    -
    580  qNextPollTime = millis() + bInterval;
    -
    581  }
    -
    582  return rcode;
    -
    583 }
    -
    584 
    -
    585 #endif // __HIDBOOTMOUSE_H__
    +
    579  USBTRACE3("(hidboot.h) i=", i, 0x81);
    +
    580  USBTRACE3("(hidboot.h) epInfo[epInterruptInIndex + i].epAddr=", epInfo[epInterruptInIndex + i].epAddr, 0x81);
    +
    581  USBTRACE3("(hidboot.h) epInfo[epInterruptInIndex + i].maxPktSize=", epInfo[epInterruptInIndex + i].maxPktSize, 0x81);
    +
    582  uint16_t read = (uint16_t)epInfo[epInterruptInIndex + i].maxPktSize;
    +
    583 
    +
    584  rcode = pUsb->inTransfer(bAddress, epInfo[epInterruptInIndex + i].epAddr, &read, buf);
    +
    585  // SOME buggy dongles report extra keys (like sleep) using a 2 byte packet on the wrong endpoint.
    +
    586  // Since keyboard and mice must report at least 3 bytes, we ignore the extra data.
    +
    587  if(!rcode && read > 2) {
    +
    588  if(pRptParser[i])
    +
    589  pRptParser[i]->Parse((HID*)this, 0, (uint8_t)read, buf);
    +
    590 #ifdef DEBUG_USB_HOST
    +
    591  // We really don't care about errors and anomalies unless we are debugging.
    +
    592  } else {
    +
    593  if(rcode != hrNAK) {
    +
    594  USBTRACE3("(hidboot.h) Poll:", rcode, 0x81);
    +
    595  }
    +
    596  if(!rcode && read) {
    +
    597  USBTRACE3("(hidboot.h) Strange read count: ", read, 0x80);
    +
    598  USBTRACE3("(hidboot.h) Interface:", i, 0x80);
    +
    599  }
    +
    600  }
    +
    601 
    +
    602  if(!rcode && read && (UsbDEBUGlvl > 0x7f)) {
    +
    603  for(uint8_t i = 0; i < read; i++) {
    +
    604  PrintHex<uint8_t > (buf[i], 0x80);
    +
    605  USBTRACE1(" ", 0x80);
    +
    606  }
    +
    607  if(read)
    +
    608  USBTRACE1("\r\n", 0x80);
    +
    609 #endif
    +
    610  }
    +
    611 
    +
    612  }
    +
    613  qNextPollTime = millis() + bInterval;
    +
    614  }
    +
    615  return rcode;
    +
    616 }
    +
    617 
    +
    618 #endif // __HIDBOOTMOUSE_H__
    -
    #define CP_MASK_COMPARE_ALL
    +
    #define CP_MASK_COMPARE_ALL
    uint8_t bmLeftShift
    Definition: hidboot.h:87
    EpInfo * epinfo
    Definition: address.h:76
    uint8_t bmKana
    Definition: hidboot.h:117
    uint8_t bmRightButton
    Definition: hidboot.h:43
    bool lowspeed
    Definition: address.h:79
    -
    #define USB_ERROR_EPINFO_IS_NULL
    Definition: UsbCore.h:81
    -
    virtual const uint8_t * getSymKeysLo()
    Definition: hidboot.h:169
    +
    #define USB_ERROR_EPINFO_IS_NULL
    Definition: UsbCore.h:83
    +
    virtual const uint8_t * getSymKeysLo()
    Definition: hidboot.h:189
    virtual void OnRightButtonDown(MOUSEINFO *mi)
    Definition: hidboot.h:75
    -
    virtual void OnKeyDown(uint8_t mod, uint8_t key)
    Definition: hidboot.h:155
    -
    virtual uint8_t Poll()
    Definition: hidboot.h:536
    +
    virtual void OnKeyDown(uint8_t mod, uint8_t key)
    Definition: hidboot.h:175
    +
    uint8_t Poll()
    Definition: hidboot.h:569
    uint8_t bmLeftCtrl
    Definition: hidboot.h:99
    +
    uint8_t SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)
    Definition: hid.cpp:50
    +
    virtual uint8_t HandleLockingKeys(HID *hid, uint8_t key)
    Definition: hidboot.h:151
    uint8_t bmRightShift
    Definition: hidboot.h:104
    #define NotifyFail(...)
    Definition: message.h:55
    virtual void OnMiddleButtonUp(MOUSEINFO *mi)
    Definition: hidboot.h:78
    -
    virtual uint8_t HandleLockingKeys(HID *hid, uint8_t key)
    Definition: hidboot.cpp:160
    MOUSEINFO mouseInfo
    Definition: hidboot.h:54
    - -
    virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    Definition: hidboot.cpp:19
    -
    virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
    Definition: hidboot.h:498
    + +
    void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    Definition: hidboot.cpp:19
    +
    virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
    Definition: hidboot.h:531
    +
    virtual bool DEVCLASSOK(uint8_t klass)
    Definition: hidboot.h:243
    uint8_t bmCapsLock
    Definition: hidboot.h:114
    uint8_t bmNumLock
    Definition: hidboot.h:113
    -
    union KeyboardReportParser::@14 kbdLockingKeys
    +
    #define UHS_HID_BOOT_KEY_SCROLL_LOCK
    Definition: hidboot.h:26
    #define NotifyFailGetDevDescr(...)
    Definition: message.h:50
    uint8_t bAddress
    Definition: hid.h:146
    -
    virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
    Definition: hidboot.h:247
    -
    union KeyboardReportParser::@13 prevState
    -
    virtual bool SetReportParser(uint8_t id, HIDReportParser *prs)
    Definition: hidboot.h:201
    -
    virtual void OnKeyUp(uint8_t mod, uint8_t key)
    Definition: hidboot.h:158
    +
    uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
    Definition: hidboot.h:280
    +
    virtual bool SetReportParser(uint8_t id, HIDReportParser *prs)
    Definition: hidboot.h:221
    +
    virtual void OnKeyUp(uint8_t mod, uint8_t key)
    Definition: hidboot.h:178
    int UsbDEBUGlvl
    Definition: message.cpp:22
    uint8_t bmLeftGUI
    Definition: hidboot.h:102
    -
    #define USB_CLASS_HID
    Definition: UsbCore.h:57
    +
    #define USB_CLASS_HID
    Definition: UsbCore.h:59
    virtual void FreeAddress(uint8_t addr)=0
    #define HID_PROTOCOL_KEYBOARD
    Definition: hid.h:93
    virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
    -
    virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    Definition: hidboot.cpp:127
    +
    void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    Definition: hidboot.cpp:127
    uint8_t bmReserved
    Definition: hidboot.h:118
    - -
    virtual const uint8_t * getSymKeysUp()
    Definition: hidboot.h:165
    + +
    virtual const uint8_t * getSymKeysUp()
    Definition: hidboot.h:185
    #define HID_BOOT_PROTOCOL
    Definition: hid.h:82
    #define USBTRACE2(s, r)
    Definition: macros.h:77
    uint8_t bmMiddleButton
    Definition: hidboot.h:44
    @@ -731,8 +766,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint8_t bmDummy
    Definition: hidboot.h:45
    uint8_t bmLeftAlt
    Definition: hidboot.h:88
    -
    virtual uint8_t GetAddress()
    Definition: hidboot.h:211
    -
    HIDBoot(USB *p)
    Definition: hidboot.h:220
    +
    virtual uint8_t GetAddress()
    Definition: hidboot.h:231
    +
    HIDBoot(USB *p)
    Definition: hidboot.h:253
    #define USB_NAK_MAX_POWER
    Definition: address.h:27
    #define HID_BOOT_INTF_SUBCLASS
    Definition: hid.h:89
    @@ -742,7 +777,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    #define epMUL(p)
    Definition: hidboot.h:34
    Definition: address.h:32
    virtual void OnMouseMove(MOUSEINFO *mi)
    Definition: hidboot.h:63
    -
    #define hrNAK
    Definition: max3421e.h:216
    +
    #define hrNAK
    Definition: max3421e.h:211
    virtual void OnRightButtonUp(MOUSEINFO *mi)
    Definition: hidboot.h:72
    uint8_t bmLeftGUI
    Definition: hidboot.h:89
    uint16_t wMaxPacketSize
    Definition: usb_ch9.h:146
    @@ -754,36 +789,41 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
    uint8_t bEndpointAddress
    Definition: usb_ch9.h:144
    uint8_t bmRightGUI
    Definition: hidboot.h:93
    +
    #define UHS_HID_BOOT_KEY_NUM_LOCK
    Definition: hidboot.h:27
    uint8_t bmScrollLock
    Definition: hidboot.h:115
    -
    #define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
    Definition: UsbCore.h:83
    +
    #define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
    Definition: UsbCore.h:85
    #define totalEndpoints(p)
    Definition: hidboot.h:33
    uint8_t bmLeftShift
    Definition: hidboot.h:100
    #define USBTRACE1(s, l)
    Definition: macros.h:76
    uint8_t bmRightShift
    Definition: hidboot.h:91
    #define USB_NAK_NOWAIT
    Definition: address.h:29
    -
    #define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
    Definition: UsbCore.h:80
    +
    #define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
    Definition: UsbCore.h:82
    +
    union KeyboardReportParser::@17 prevState
    int8_t dX
    Definition: hidboot.h:47
    -
    #define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
    Definition: UsbCore.h:75
    -
    virtual void OnControlKeysChanged(uint8_t before, uint8_t after)
    Definition: hidboot.h:152
    +
    #define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
    Definition: UsbCore.h:77
    +
    virtual void OnControlKeysChanged(uint8_t before, uint8_t after)
    Definition: hidboot.h:172
    USB * pUsb
    Definition: hid.h:145
    -
    virtual uint8_t Release()
    Definition: hidboot.h:522
    +
    uint8_t Release()
    Definition: hidboot.h:555
    uint8_t bmRightGUI
    Definition: hidboot.h:106
    virtual void OnLeftButtonDown(MOUSEINFO *mi)
    Definition: hidboot.h:69
    -
    virtual const uint8_t * getNumKeys()
    Definition: hidboot.h:161
    +
    virtual const uint8_t * getNumKeys()
    Definition: hidboot.h:181
    #define HID_PROTOCOL_MOUSE
    Definition: hid.h:94
    -
    #define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
    Definition: UsbCore.h:78
    +
    union KeyboardReportParser::@18 kbdLockingKeys
    +
    #define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
    Definition: UsbCore.h:80
    uint8_t bmLeftCtrl
    Definition: hidboot.h:86
    -
    virtual const uint8_t * getPadKeys()
    Definition: hidboot.h:173
    +
    virtual bool isReady()
    Definition: hidboot.h:235
    +
    virtual const uint8_t * getPadKeys()
    Definition: hidboot.h:193
    uint8_t bmRightAlt
    Definition: hidboot.h:92
    int8_t dY
    Definition: hidboot.h:48
    -
    Definition: UsbCore.h:190
    +
    Definition: UsbCore.h:197
    uint8_t bmRightAlt
    Definition: hidboot.h:105
    +
    virtual bool DEVSUBCLASSOK(uint8_t subklass)
    Definition: hidboot.h:247
    uint8_t Keys[6]
    Definition: hidboot.h:109
    #define USBTRACE3(s, r, l)
    Definition: macros.h:78
    -
    uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
    Definition: UsbCore.h:210
    +
    uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
    Definition: UsbCore.h:217
    static const uint8_t totalEndpoints
    Definition: hid.h:154
    #define NotifyFailSetConfDescr(...)
    Definition: message.h:53
    uint8_t bmCompose
    Definition: hidboot.h:116
    @@ -791,15 +831,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint8_t bmLeftAlt
    Definition: hidboot.h:101
    uint8_t bReserved
    Definition: hidboot.h:108
    +
    #define UHS_HID_BOOT_KEY_CAPS_LOCK
    Definition: hidboot.h:25
    #define USBTRACE(s)
    Definition: macros.h:75
    -
    uint8_t OemToAscii(uint8_t mod, uint8_t key)
    Definition: hidboot.cpp:186
    +
    uint8_t OemToAscii(uint8_t mod, uint8_t key)
    Definition: hidboot.cpp:165
    diff --git a/hidescriptorparser_8cpp.html b/hidescriptorparser_8cpp.html index 33878459..13c24c55 100644 --- a/hidescriptorparser_8cpp.html +++ b/hidescriptorparser_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidescriptorparser.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -104,7 +105,7 @@ Include dependency graph for hidescriptorparser.cpp:
    diff --git a/hidescriptorparser_8cpp__incl.md5 b/hidescriptorparser_8cpp__incl.md5 index 92c3fddd..41a329ae 100644 --- a/hidescriptorparser_8cpp__incl.md5 +++ b/hidescriptorparser_8cpp__incl.md5 @@ -1 +1 @@ -554c54073302f1217d88977562c2dc01 \ No newline at end of file +91b99ba7a1c855f43e1158f1ae0764dd \ No newline at end of file diff --git a/hidescriptorparser_8cpp_source.html b/hidescriptorparser_8cpp_source.html index 25feb2b3..85f71e47 100644 --- a/hidescriptorparser_8cpp_source.html +++ b/hidescriptorparser_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidescriptorparser.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -1096,91 +1097,91 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    1005  ParseItem(&p, &cntdn);
    1006 
    1007  //if (ParseItem(&p, &cntdn))
    -
    1008  // return;
    +
    1008  // return;
    1009  }
    1010  //USBTRACE2("Total:", totalSize);
    1011 }
    1012 
    1013 void ReportDescParserBase::PrintValue(uint8_t *p, uint8_t len) {
    -
    1014  E_Notify(PSTR("("), 0x80);
    +
    1014  E_Notify(PSTR("("), 0x80);
    1015  for(; len; p++, len--)
    1016  PrintHex<uint8_t > (*p, 0x80);
    -
    1017  E_Notify(PSTR(")"), 0x80);
    +
    1017  E_Notify(PSTR(")"), 0x80);
    1018 }
    1019 
    -
    1021  E_Notify(PSTR("("), 0x80);
    +
    1021  E_Notify(PSTR("("), 0x80);
    1022  PrintHex<uint8_t > (data, 0x80);
    -
    1023  E_Notify(PSTR(")"), 0x80);
    +
    1023  E_Notify(PSTR(")"), 0x80);
    1024 }
    1025 
    1027  switch(prefix & (TYPE_MASK | TAG_MASK)) {
    1028  case (TYPE_GLOBAL | TAG_GLOBAL_PUSH):
    -
    1029  E_Notify(PSTR("\r\nPush"), 0x80);
    +
    1029  E_Notify(PSTR("\r\nPush"), 0x80);
    1030  break;
    1031  case (TYPE_GLOBAL | TAG_GLOBAL_POP):
    -
    1032  E_Notify(PSTR("\r\nPop"), 0x80);
    +
    1032  E_Notify(PSTR("\r\nPop"), 0x80);
    1033  break;
    -
    1035  E_Notify(PSTR("\r\nUsage Page"), 0x80);
    +
    1035  E_Notify(PSTR("\r\nUsage Page"), 0x80);
    1036  break;
    -
    1038  E_Notify(PSTR("\r\nLogical Min"), 0x80);
    +
    1038  E_Notify(PSTR("\r\nLogical Min"), 0x80);
    1039  break;
    -
    1041  E_Notify(PSTR("\r\nLogical Max"), 0x80);
    +
    1041  E_Notify(PSTR("\r\nLogical Max"), 0x80);
    1042  break;
    -
    1044  E_Notify(PSTR("\r\nPhysical Min"), 0x80);
    +
    1044  E_Notify(PSTR("\r\nPhysical Min"), 0x80);
    1045  break;
    -
    1047  E_Notify(PSTR("\r\nPhysical Max"), 0x80);
    +
    1047  E_Notify(PSTR("\r\nPhysical Max"), 0x80);
    1048  break;
    -
    1050  E_Notify(PSTR("\r\nUnit Exp"), 0x80);
    +
    1050  E_Notify(PSTR("\r\nUnit Exp"), 0x80);
    1051  break;
    1052  case (TYPE_GLOBAL | TAG_GLOBAL_UNIT):
    -
    1053  E_Notify(PSTR("\r\nUnit"), 0x80);
    +
    1053  E_Notify(PSTR("\r\nUnit"), 0x80);
    1054  break;
    -
    1056  E_Notify(PSTR("\r\nReport Size"), 0x80);
    +
    1056  E_Notify(PSTR("\r\nReport Size"), 0x80);
    1057  break;
    -
    1059  E_Notify(PSTR("\r\nReport Count"), 0x80);
    +
    1059  E_Notify(PSTR("\r\nReport Count"), 0x80);
    1060  break;
    -
    1062  E_Notify(PSTR("\r\nReport Id"), 0x80);
    +
    1062  E_Notify(PSTR("\r\nReport Id"), 0x80);
    1063  break;
    1064  case (TYPE_LOCAL | TAG_LOCAL_USAGE):
    -
    1065  E_Notify(PSTR("\r\nUsage"), 0x80);
    +
    1065  E_Notify(PSTR("\r\nUsage"), 0x80);
    1066  break;
    1067  case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN):
    -
    1068  E_Notify(PSTR("\r\nUsage Min"), 0x80);
    +
    1068  E_Notify(PSTR("\r\nUsage Min"), 0x80);
    1069  break;
    1070  case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX):
    -
    1071  E_Notify(PSTR("\r\nUsage Max"), 0x80);
    +
    1071  E_Notify(PSTR("\r\nUsage Max"), 0x80);
    1072  break;
    1073  case (TYPE_MAIN | TAG_MAIN_COLLECTION):
    -
    1074  E_Notify(PSTR("\r\nCollection"), 0x80);
    +
    1074  E_Notify(PSTR("\r\nCollection"), 0x80);
    1075  break;
    -
    1077  E_Notify(PSTR("\r\nEnd Collection"), 0x80);
    +
    1077  E_Notify(PSTR("\r\nEnd Collection"), 0x80);
    1078  break;
    1079  case (TYPE_MAIN | TAG_MAIN_INPUT):
    -
    1080  E_Notify(PSTR("\r\nInput"), 0x80);
    +
    1080  E_Notify(PSTR("\r\nInput"), 0x80);
    1081  break;
    1082  case (TYPE_MAIN | TAG_MAIN_OUTPUT):
    -
    1083  E_Notify(PSTR("\r\nOutput"), 0x80);
    +
    1083  E_Notify(PSTR("\r\nOutput"), 0x80);
    1084  break;
    1085  case (TYPE_MAIN | TAG_MAIN_FEATURE):
    -
    1086  E_Notify(PSTR("\r\nFeature"), 0x80);
    +
    1086  E_Notify(PSTR("\r\nFeature"), 0x80);
    1087  break;
    1088  } // switch (**pp & (TYPE_MASK | TAG_MASK))
    1089 }
    1090 
    1091 uint8_t ReportDescParserBase::ParseItem(uint8_t **pp, uint16_t *pcntdn) {
    -
    1092  //uint8_t ret = enErrorSuccess;
    +
    1092  //uint8_t ret = enErrorSuccess;
    1093  //reinterpret_cast<>(varBuffer);
    1094  switch(itemParseState) {
    1095  case 0:
    @@ -1203,7 +1204,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    1112  break;
    1113 
    1114  if(!pcntdn)
    -
    1115  return enErrorIncomplete;
    +
    1115  return enErrorIncomplete;
    1116  case 1:
    1117  //USBTRACE2("\r\niSz:",itemSize);
    1118 
    @@ -1212,7 +1213,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    1121  itemParseState = 2;
    1122  case 2:
    1123  if(!valParser.Parse(pp, pcntdn))
    -
    1124  return enErrorIncomplete;
    +
    1124  return enErrorIncomplete;
    1125  itemParseState = 3;
    1126  case 3:
    1127  {
    @@ -1259,30 +1260,30 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    1169  switch(data) {
    1170  case 0x00:
    -
    1171  E_Notify(PSTR(" Physical"), 0x80);
    +
    1171  E_Notify(PSTR(" Physical"), 0x80);
    1172  break;
    1173  case 0x01:
    -
    1174  E_Notify(PSTR(" Application"), 0x80);
    +
    1174  E_Notify(PSTR(" Application"), 0x80);
    1175  break;
    1176  case 0x02:
    -
    1177  E_Notify(PSTR(" Logical"), 0x80);
    +
    1177  E_Notify(PSTR(" Logical"), 0x80);
    1178  break;
    1179  case 0x03:
    -
    1180  E_Notify(PSTR(" Report"), 0x80);
    +
    1180  E_Notify(PSTR(" Report"), 0x80);
    1181  break;
    1182  case 0x04:
    -
    1183  E_Notify(PSTR(" Named Array"), 0x80);
    +
    1183  E_Notify(PSTR(" Named Array"), 0x80);
    1184  break;
    1185  case 0x05:
    -
    1186  E_Notify(PSTR(" Usage Switch"), 0x80);
    +
    1186  E_Notify(PSTR(" Usage Switch"), 0x80);
    1187  break;
    1188  case 0x06:
    -
    1189  E_Notify(PSTR(" Usage Modifier"), 0x80);
    +
    1189  E_Notify(PSTR(" Usage Modifier"), 0x80);
    1190  break;
    1191  default:
    -
    1192  E_Notify(PSTR(" Vendor Defined("), 0x80);
    +
    1192  E_Notify(PSTR(" Vendor Defined("), 0x80);
    1193  PrintHex<uint8_t > (data, 0x80);
    -
    1194  E_Notify(PSTR(")"), 0x80);
    +
    1194  E_Notify(PSTR(")"), 0x80);
    1195  }
    1196  break;
    1197  case (TYPE_MAIN | TAG_MAIN_INPUT):
    @@ -1291,18 +1292,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    1200  totalSize += (uint16_t)rptSize * (uint16_t)rptCount;
    1201  rptSize = 0;
    1202  rptCount = 0;
    -
    1203  E_Notify(PSTR("("), 0x80);
    +
    1203  E_Notify(PSTR("("), 0x80);
    1204  PrintBin<uint8_t > (data, 0x80);
    -
    1205  E_Notify(PSTR(")"), 0x80);
    +
    1205  E_Notify(PSTR(")"), 0x80);
    1206  break;
    1207  } // switch (**pp & (TYPE_MASK | TAG_MASK))
    1208  }
    1209  } // switch (itemParseState)
    1210  itemParseState = 0;
    -
    1211  return enErrorSuccess;
    +
    1211  return enErrorSuccess;
    1212 }
    1213 
    - + @@ -1324,370 +1325,359 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    1234  pfUsage = NULL;
    1235 
    -
    1236  if(VALUE_BETWEEN(page, 0x00, 0x11))
    +
    1236  if(VALUE_BETWEEN(page, 0x00, 0x11)) {
    1237  pfUsage = (usagePageFunctions[page - 1]);
    1238 
    -
    1239  // Dead code...
    -
    1240  //
    -
    1241  // pfUsage = (UsagePageFunc)pgm_read_pointer(usagePageFunctions[page - 1]);
    -
    1242  //else if (page > 0x7f && page < 0x84)
    -
    1243  // E_Notify(pstrUsagePageMonitor);
    -
    1244  //else if (page > 0x83 && page < 0x8c)
    -
    1245  // E_Notify(pstrUsagePagePower);
    -
    1246  //else if (page > 0x8b && page < 0x92)
    -
    1247  // E_Notify((char*)pgm_read_pointer(&usagePageTitles1[page - 0x8c]));
    -
    1248  //else if (page > 0xfeff && page <= 0xffff)
    -
    1249  // E_Notify(pstrUsagePageVendorDefined);
    -
    1250  //
    -
    1251  else
    -
    1252  switch(page) {
    -
    1253  case 0x14:
    - -
    1255  break;
    -
    1256  case 0x40:
    - -
    1258  break;
    -
    1259  }
    -
    1260 }
    -
    1261 
    - -
    1263  const char * const * w;
    -
    1264  E_Notify(pstrSpace, 0x80);
    -
    1265 
    -
    1266  output_if_between(page, 0x00, 0x11, w, E_Notify, usagePageTitles0, 0x80)
    -
    1267  else output_if_between(page, 0x8b, 0x92, w, E_Notify, usagePageTitles1, 0x80)
    -
    1268  else if(VALUE_BETWEEN(page, 0x7f, 0x84))
    - -
    1270  else if(VALUE_BETWEEN(page, 0x83, 0x8c))
    - -
    1272  else if(page > 0xfeff /* && page <= 0xffff */)
    - -
    1274  else
    -
    1275  switch(page) {
    -
    1276  case 0x14:
    - -
    1278  break;
    -
    1279  case 0x40:
    - -
    1281  break;
    -
    1282  default:
    - -
    1284  }
    -
    1285 }
    -
    1286 
    - -
    1288  E_Notify(pstrSpace, 0x80);
    -
    1289  E_Notify(PSTR("Btn"), 0x80);
    -
    1290  PrintHex<uint16_t > (usage, 0x80);
    -
    1291  E_Notify(PSTR("\r\n"), 0x80);
    -
    1292  //USB_HOST_SERIAL.print(usage, HEX);
    -
    1293 }
    -
    1294 
    - -
    1296  E_Notify(pstrSpace, 0x80);
    -
    1297  E_Notify(PSTR("Inst"), 0x80);
    -
    1298  // Sorry, HEX for now...
    -
    1299  PrintHex<uint16_t > (usage, 0x80);
    -
    1300  E_Notify(PSTR("\r\n"), 0x80);
    -
    1301  //USB_HOST_SERIAL.print(usage, DEC);
    -
    1302 }
    -
    1303 
    - -
    1305  const char * const * w;
    -
    1306  E_Notify(pstrSpace, 0x80);
    -
    1307 
    -
    1308  output_if_between(usage, 0x00, 0x0a, w, E_Notify, genDesktopTitles0, 0x80)
    -
    1309  else output_if_between(usage, 0x2f, 0x49, w, E_Notify, genDesktopTitles1, 0x80)
    -
    1310  else output_if_between(usage, 0x7f, 0x94, w, E_Notify, genDesktopTitles2, 0x80)
    -
    1311  else output_if_between(usage, 0x9f, 0xa9, w, E_Notify, genDesktopTitles3, 0x80)
    -
    1312  else output_if_between(usage, 0xaf, 0xb8, w, E_Notify, genDesktopTitles4, 0x80)
    -
    1313  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1314 }
    -
    1315 
    - -
    1317  const char * const * w;
    -
    1318  E_Notify(pstrSpace, 0x80);
    -
    1319 
    -
    1320  output_if_between(usage, 0x00, 0x0d, w, E_Notify, simuTitles0, 0x80)
    -
    1321  else output_if_between(usage, 0x1f, 0x26, w, E_Notify, simuTitles1, 0x80)
    -
    1322  else output_if_between(usage, 0xaf, 0xd1, w, E_Notify, simuTitles2, 0x80)
    -
    1323  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1324 }
    -
    1325 
    - -
    1327  const char * const * w;
    -
    1328  E_Notify(pstrSpace, 0x80);
    -
    1329 
    -
    1330  output_if_between(usage, 0x00, 0x0b, w, E_Notify, vrTitles0, 0x80)
    -
    1331  else output_if_between(usage, 0x1f, 0x22, w, E_Notify, vrTitles1, 0x80)
    -
    1332  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1333 }
    -
    1334 
    - -
    1336  const char * const * w;
    -
    1337  E_Notify(pstrSpace, 0x80);
    -
    1338 
    -
    1339  output_if_between(usage, 0x00, 0x05, w, E_Notify, sportsCtrlTitles0, 0x80)
    -
    1340  else output_if_between(usage, 0x2f, 0x3a, w, E_Notify, sportsCtrlTitles1, 0x80)
    -
    1341  else output_if_between(usage, 0x4f, 0x64, w, E_Notify, sportsCtrlTitles2, 0x80)
    -
    1342  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1343 }
    -
    1344 
    - -
    1346  const char * const * w;
    -
    1347  E_Notify(pstrSpace, 0x80);
    -
    1348 
    -
    1349  output_if_between(usage, 0x00, 0x04, w, E_Notify, gameTitles0, 0x80)
    -
    1350  else output_if_between(usage, 0x1f, 0x3a, w, E_Notify, gameTitles1, 0x80)
    -
    1351  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1352 }
    -
    1353 
    - -
    1355  const char * const * w;
    -
    1356  E_Notify(pstrSpace, 0x80);
    -
    1357 
    -
    1358  output_if_between(usage, 0x1f, 0x27, w, E_Notify, genDevCtrlTitles, 0x80)
    -
    1359  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1360 }
    -
    1361 
    - -
    1363  const char * const * w;
    -
    1364  E_Notify(pstrSpace, 0x80);
    -
    1365 
    -
    1366  output_if_between(usage, 0x00, 0x4e, w, E_Notify, ledTitles, 0x80)
    -
    1367  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1368 }
    -
    1369 
    - -
    1371  const char * const * w;
    -
    1372  E_Notify(pstrSpace, 0x80);
    -
    1373 
    -
    1374  output_if_between(usage, 0x00, 0x08, w, E_Notify, telTitles0, 0x80)
    -
    1375  else output_if_between(usage, 0x1f, 0x32, w, E_Notify, telTitles1, 0x80)
    -
    1376  else output_if_between(usage, 0x4f, 0x54, w, E_Notify, telTitles2, 0x80)
    -
    1377  else output_if_between(usage, 0x6f, 0x75, w, E_Notify, telTitles3, 0x80)
    -
    1378  else output_if_between(usage, 0x8f, 0x9f, w, E_Notify, telTitles4, 0x80)
    -
    1379  else output_if_between(usage, 0xaf, 0xc0, w, E_Notify, telTitles5, 0x80)
    -
    1380  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1381 }
    -
    1382 
    - -
    1384  const char * const * w;
    -
    1385  E_Notify(pstrSpace, 0x80);
    -
    1386 
    -
    1387  output_if_between(usage, 0x00, 0x07, w, E_Notify, consTitles0, 0x80)
    -
    1388  else output_if_between(usage, 0x1f, 0x23, w, E_Notify, consTitles1, 0x80)
    -
    1389  else output_if_between(usage, 0x2f, 0x37, w, E_Notify, consTitles2, 0x80)
    -
    1390  else output_if_between(usage, 0x3f, 0x49, w, E_Notify, consTitles3, 0x80)
    -
    1391  else output_if_between(usage, 0x5f, 0x67, w, E_Notify, consTitles4, 0x80)
    -
    1392  else output_if_between(usage, 0x7f, 0xa5, w, E_Notify, consTitles5, 0x80)
    -
    1393  else output_if_between(usage, 0xaf, 0xcf, w, E_Notify, consTitles6, 0x80)
    -
    1394  else output_if_between(usage, 0xdf, 0xeb, w, E_Notify, consTitles7, 0x80)
    -
    1395  else output_if_between(usage, 0xef, 0xf6, w, E_Notify, consTitles8, 0x80)
    -
    1396  else output_if_between(usage, 0xff, 0x10e, w, E_Notify, consTitles9, 0x80)
    -
    1397  else output_if_between(usage, 0x14f, 0x156, w, E_Notify, consTitlesA, 0x80)
    -
    1398  else output_if_between(usage, 0x15f, 0x16b, w, E_Notify, consTitlesB, 0x80)
    -
    1399  else output_if_between(usage, 0x16f, 0x175, w, E_Notify, consTitlesC, 0x80)
    -
    1400  else output_if_between(usage, 0x17f, 0x1c8, w, E_Notify, consTitlesD, 0x80)
    -
    1401  else output_if_between(usage, 0x1ff, 0x29d, w, E_Notify, consTitlesE, 0x80)
    -
    1402  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1403 }
    -
    1404 
    - -
    1406  const char * const * w;
    -
    1407  E_Notify(pstrSpace, 0x80);
    -
    1408 
    -
    1409  output_if_between(usage, 0x00, 0x0e, w, E_Notify, digitTitles0, 0x80)
    -
    1410  else output_if_between(usage, 0x1f, 0x23, w, E_Notify, digitTitles1, 0x80)
    -
    1411  else output_if_between(usage, 0x2f, 0x47, w, E_Notify, digitTitles2, 0x80)
    -
    1412  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1413 }
    -
    1414 
    - -
    1416  const char * const * w;
    -
    1417  E_Notify(pstrSpace, 0x80);
    -
    1418 
    -
    1419  output_if_between(usage, 0x00, 0x03, w, E_Notify, aplphanumTitles0, 0x80)
    -
    1420  else output_if_between(usage, 0x1f, 0x4e, w, E_Notify, aplphanumTitles1, 0x80)
    -
    1421  else output_if_between(usage, 0x7f, 0x96, w, E_Notify, digitTitles2, 0x80)
    -
    1422  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1423 }
    -
    1424 
    - -
    1426  const char * const * w;
    -
    1427  E_Notify(pstrSpace, 0x80);
    +
    1239  } else {
    +
    1240  switch(page) {
    +
    1241  case 0x14:
    + +
    1243  break;
    +
    1244  case 0x40:
    + +
    1246  break;
    +
    1247  }
    +
    1248  }
    +
    1249 }
    +
    1250 
    + +
    1252  const char * const * w;
    +
    1253  E_Notify(pstrSpace, 0x80);
    +
    1254 
    +
    1255  output_if_between(page, 0x00, 0x11, w, E_Notify, usagePageTitles0, 0x80)
    +
    1256  else output_if_between(page, 0x8b, 0x92, w, E_Notify, usagePageTitles1, 0x80)
    +
    1257  else if(VALUE_BETWEEN(page, 0x7f, 0x84))
    + +
    1259  else if(VALUE_BETWEEN(page, 0x83, 0x8c))
    + +
    1261  else if(page > 0xfeff /* && page <= 0xffff */)
    + +
    1263  else
    +
    1264  switch(page) {
    +
    1265  case 0x14:
    + +
    1267  break;
    +
    1268  case 0x40:
    + +
    1270  break;
    +
    1271  default:
    + +
    1273  }
    +
    1274 }
    +
    1275 
    + +
    1277  E_Notify(pstrSpace, 0x80);
    +
    1278  E_Notify(PSTR("Btn"), 0x80);
    +
    1279  PrintHex<uint16_t > (usage, 0x80);
    +
    1280  E_Notify(PSTR("\r\n"), 0x80);
    +
    1281  //USB_HOST_SERIAL.print(usage, HEX);
    +
    1282 }
    +
    1283 
    + +
    1285  E_Notify(pstrSpace, 0x80);
    +
    1286  E_Notify(PSTR("Inst"), 0x80);
    +
    1287  // Sorry, HEX for now...
    +
    1288  PrintHex<uint16_t > (usage, 0x80);
    +
    1289  E_Notify(PSTR("\r\n"), 0x80);
    +
    1290  //USB_HOST_SERIAL.print(usage, DEC);
    +
    1291 }
    +
    1292 
    + +
    1294  const char * const * w;
    +
    1295  E_Notify(pstrSpace, 0x80);
    +
    1296 
    +
    1297  output_if_between(usage, 0x00, 0x0a, w, E_Notify, genDesktopTitles0, 0x80)
    +
    1298  else output_if_between(usage, 0x2f, 0x49, w, E_Notify, genDesktopTitles1, 0x80)
    +
    1299  else output_if_between(usage, 0x7f, 0x94, w, E_Notify, genDesktopTitles2, 0x80)
    +
    1300  else output_if_between(usage, 0x9f, 0xa9, w, E_Notify, genDesktopTitles3, 0x80)
    +
    1301  else output_if_between(usage, 0xaf, 0xb8, w, E_Notify, genDesktopTitles4, 0x80)
    +
    1302  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1303 }
    +
    1304 
    + +
    1306  const char * const * w;
    +
    1307  E_Notify(pstrSpace, 0x80);
    +
    1308 
    +
    1309  output_if_between(usage, 0x00, 0x0d, w, E_Notify, simuTitles0, 0x80)
    +
    1310  else output_if_between(usage, 0x1f, 0x26, w, E_Notify, simuTitles1, 0x80)
    +
    1311  else output_if_between(usage, 0xaf, 0xd1, w, E_Notify, simuTitles2, 0x80)
    +
    1312  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1313 }
    +
    1314 
    + +
    1316  const char * const * w;
    +
    1317  E_Notify(pstrSpace, 0x80);
    +
    1318 
    +
    1319  output_if_between(usage, 0x00, 0x0b, w, E_Notify, vrTitles0, 0x80)
    +
    1320  else output_if_between(usage, 0x1f, 0x22, w, E_Notify, vrTitles1, 0x80)
    +
    1321  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1322 }
    +
    1323 
    + +
    1325  const char * const * w;
    +
    1326  E_Notify(pstrSpace, 0x80);
    +
    1327 
    +
    1328  output_if_between(usage, 0x00, 0x05, w, E_Notify, sportsCtrlTitles0, 0x80)
    +
    1329  else output_if_between(usage, 0x2f, 0x3a, w, E_Notify, sportsCtrlTitles1, 0x80)
    +
    1330  else output_if_between(usage, 0x4f, 0x64, w, E_Notify, sportsCtrlTitles2, 0x80)
    +
    1331  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1332 }
    +
    1333 
    + +
    1335  const char * const * w;
    +
    1336  E_Notify(pstrSpace, 0x80);
    +
    1337 
    +
    1338  output_if_between(usage, 0x00, 0x04, w, E_Notify, gameTitles0, 0x80)
    +
    1339  else output_if_between(usage, 0x1f, 0x3a, w, E_Notify, gameTitles1, 0x80)
    +
    1340  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1341 }
    +
    1342 
    + +
    1344  const char * const * w;
    +
    1345  E_Notify(pstrSpace, 0x80);
    +
    1346 
    +
    1347  output_if_between(usage, 0x1f, 0x27, w, E_Notify, genDevCtrlTitles, 0x80)
    +
    1348  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1349 }
    +
    1350 
    + +
    1352  const char * const * w;
    +
    1353  E_Notify(pstrSpace, 0x80);
    +
    1354 
    +
    1355  output_if_between(usage, 0x00, 0x4e, w, E_Notify, ledTitles, 0x80)
    +
    1356  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1357 }
    +
    1358 
    + +
    1360  const char * const * w;
    +
    1361  E_Notify(pstrSpace, 0x80);
    +
    1362 
    +
    1363  output_if_between(usage, 0x00, 0x08, w, E_Notify, telTitles0, 0x80)
    +
    1364  else output_if_between(usage, 0x1f, 0x32, w, E_Notify, telTitles1, 0x80)
    +
    1365  else output_if_between(usage, 0x4f, 0x54, w, E_Notify, telTitles2, 0x80)
    +
    1366  else output_if_between(usage, 0x6f, 0x75, w, E_Notify, telTitles3, 0x80)
    +
    1367  else output_if_between(usage, 0x8f, 0x9f, w, E_Notify, telTitles4, 0x80)
    +
    1368  else output_if_between(usage, 0xaf, 0xc0, w, E_Notify, telTitles5, 0x80)
    +
    1369  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1370 }
    +
    1371 
    + +
    1373  const char * const * w;
    +
    1374  E_Notify(pstrSpace, 0x80);
    +
    1375 
    +
    1376  output_if_between(usage, 0x00, 0x07, w, E_Notify, consTitles0, 0x80)
    +
    1377  else output_if_between(usage, 0x1f, 0x23, w, E_Notify, consTitles1, 0x80)
    +
    1378  else output_if_between(usage, 0x2f, 0x37, w, E_Notify, consTitles2, 0x80)
    +
    1379  else output_if_between(usage, 0x3f, 0x49, w, E_Notify, consTitles3, 0x80)
    +
    1380  else output_if_between(usage, 0x5f, 0x67, w, E_Notify, consTitles4, 0x80)
    +
    1381  else output_if_between(usage, 0x7f, 0xa5, w, E_Notify, consTitles5, 0x80)
    +
    1382  else output_if_between(usage, 0xaf, 0xcf, w, E_Notify, consTitles6, 0x80)
    +
    1383  else output_if_between(usage, 0xdf, 0xeb, w, E_Notify, consTitles7, 0x80)
    +
    1384  else output_if_between(usage, 0xef, 0xf6, w, E_Notify, consTitles8, 0x80)
    +
    1385  else output_if_between(usage, 0xff, 0x10e, w, E_Notify, consTitles9, 0x80)
    +
    1386  else output_if_between(usage, 0x14f, 0x156, w, E_Notify, consTitlesA, 0x80)
    +
    1387  else output_if_between(usage, 0x15f, 0x16b, w, E_Notify, consTitlesB, 0x80)
    +
    1388  else output_if_between(usage, 0x16f, 0x175, w, E_Notify, consTitlesC, 0x80)
    +
    1389  else output_if_between(usage, 0x17f, 0x1c8, w, E_Notify, consTitlesD, 0x80)
    +
    1390  else output_if_between(usage, 0x1ff, 0x29d, w, E_Notify, consTitlesE, 0x80)
    +
    1391  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1392 }
    +
    1393 
    + +
    1395  const char * const * w;
    +
    1396  E_Notify(pstrSpace, 0x80);
    +
    1397 
    +
    1398  output_if_between(usage, 0x00, 0x0e, w, E_Notify, digitTitles0, 0x80)
    +
    1399  else output_if_between(usage, 0x1f, 0x23, w, E_Notify, digitTitles1, 0x80)
    +
    1400  else output_if_between(usage, 0x2f, 0x47, w, E_Notify, digitTitles2, 0x80)
    +
    1401  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1402 }
    +
    1403 
    + +
    1405  const char * const * w;
    +
    1406  E_Notify(pstrSpace, 0x80);
    +
    1407 
    +
    1408  output_if_between(usage, 0x00, 0x03, w, E_Notify, aplphanumTitles0, 0x80)
    +
    1409  else output_if_between(usage, 0x1f, 0x4e, w, E_Notify, aplphanumTitles1, 0x80)
    +
    1410  else output_if_between(usage, 0x7f, 0x96, w, E_Notify, digitTitles2, 0x80)
    +
    1411  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1412 }
    +
    1413 
    + +
    1415  const char * const * w;
    +
    1416  E_Notify(pstrSpace, 0x80);
    +
    1417 
    +
    1418  if(usage == 1) E_Notify(pstrUsageMedicalUltrasound, 0x80);
    +
    1419  else if(usage == 0x70)
    + +
    1421  else output_if_between(usage, 0x1f, 0x28, w, E_Notify, medInstrTitles0, 0x80)
    +
    1422  else output_if_between(usage, 0x3f, 0x45, w, E_Notify, medInstrTitles1, 0x80)
    +
    1423  else output_if_between(usage, 0x5f, 0x62, w, E_Notify, medInstrTitles2, 0x80)
    +
    1424  else output_if_between(usage, 0x7f, 0x8a, w, E_Notify, medInstrTitles3, 0x80)
    +
    1425  else output_if_between(usage, 0x9f, 0xa2, w, E_Notify, medInstrTitles4, 0x80)
    +
    1426  else E_Notify(pstrUsagePageUndefined, 0x80);
    +
    1427 }
    1428 
    -
    1429  if(usage == 1) E_Notify(pstrUsageMedicalUltrasound, 0x80);
    -
    1430  else if(usage == 0x70)
    - -
    1432  else output_if_between(usage, 0x1f, 0x28, w, E_Notify, medInstrTitles0, 0x80)
    -
    1433  else output_if_between(usage, 0x3f, 0x45, w, E_Notify, medInstrTitles1, 0x80)
    -
    1434  else output_if_between(usage, 0x5f, 0x62, w, E_Notify, medInstrTitles2, 0x80)
    -
    1435  else output_if_between(usage, 0x7f, 0x8a, w, E_Notify, medInstrTitles3, 0x80)
    -
    1436  else output_if_between(usage, 0x9f, 0xa2, w, E_Notify, medInstrTitles4, 0x80)
    -
    1437  else E_Notify(pstrUsagePageUndefined, 0x80);
    -
    1438 }
    -
    1439 
    -
    1440 uint8_t ReportDescParser2::ParseItem(uint8_t **pp, uint16_t *pcntdn) {
    -
    1441  //uint8_t ret = enErrorSuccess;
    -
    1442 
    -
    1443  switch(itemParseState) {
    -
    1444  case 0:
    -
    1445  if(**pp == HID_LONG_ITEM_PREFIX)
    -
    1446  USBTRACE("\r\nLONG\r\n");
    -
    1447  else {
    -
    1448  uint8_t size = ((**pp) & DATA_SIZE_MASK);
    -
    1449  itemPrefix = (**pp);
    -
    1450  itemSize = 1 + ((size == DATA_SIZE_4) ? 4 : size);
    -
    1451  }
    -
    1452  (*pp)++;
    -
    1453  (*pcntdn)--;
    -
    1454  itemSize--;
    -
    1455  itemParseState = 1;
    -
    1456 
    -
    1457  if(!itemSize)
    -
    1458  break;
    -
    1459 
    -
    1460  if(!pcntdn)
    -
    1461  return enErrorIncomplete;
    -
    1462  case 1:
    - - -
    1465  itemParseState = 2;
    -
    1466  case 2:
    -
    1467  if(!valParser.Parse(pp, pcntdn))
    -
    1468  return enErrorIncomplete;
    -
    1469  itemParseState = 3;
    -
    1470  case 3:
    -
    1471  {
    -
    1472  uint8_t data = *((uint8_t*)varBuffer);
    -
    1473 
    -
    1474  switch(itemPrefix & (TYPE_MASK | TAG_MASK)) {
    -
    1475  case (TYPE_LOCAL | TAG_LOCAL_USAGE):
    -
    1476  if(pfUsage) {
    -
    1477  if(theBuffer.valueSize > 1) {
    -
    1478  uint16_t* ui16 = reinterpret_cast<uint16_t *>(varBuffer);
    -
    1479  pfUsage(*ui16);
    -
    1480  } else
    -
    1481  pfUsage(data);
    -
    1482  }
    -
    1483  break;
    - -
    1485  rptSize = data;
    -
    1486  break;
    - -
    1488  rptCount = data;
    -
    1489  break;
    - -
    1491  rptId = data;
    -
    1492  break;
    -
    1493  case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN):
    -
    1494  useMin = data;
    -
    1495  break;
    -
    1496  case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX):
    -
    1497  useMax = data;
    -
    1498  break;
    - -
    1500  SetUsagePage(data);
    -
    1501  break;
    -
    1502  case (TYPE_MAIN | TAG_MAIN_OUTPUT):
    -
    1503  case (TYPE_MAIN | TAG_MAIN_FEATURE):
    -
    1504  rptSize = 0;
    -
    1505  rptCount = 0;
    -
    1506  useMin = 0;
    -
    1507  useMax = 0;
    -
    1508  break;
    -
    1509  case (TYPE_MAIN | TAG_MAIN_INPUT):
    -
    1510  OnInputItem(data);
    -
    1511 
    -
    1512  totalSize += (uint16_t)rptSize * (uint16_t)rptCount;
    -
    1513 
    -
    1514  rptSize = 0;
    -
    1515  rptCount = 0;
    -
    1516  useMin = 0;
    -
    1517  useMax = 0;
    -
    1518  break;
    -
    1519  } // switch (**pp & (TYPE_MASK | TAG_MASK))
    -
    1520  }
    -
    1521  } // switch (itemParseState)
    -
    1522  itemParseState = 0;
    -
    1523  return enErrorSuccess;
    -
    1524 }
    +
    1429 uint8_t ReportDescParser2::ParseItem(uint8_t **pp, uint16_t *pcntdn) {
    +
    1430  //uint8_t ret = enErrorSuccess;
    +
    1431 
    +
    1432  switch(itemParseState) {
    +
    1433  case 0:
    +
    1434  if(**pp == HID_LONG_ITEM_PREFIX)
    +
    1435  USBTRACE("\r\nLONG\r\n");
    +
    1436  else {
    +
    1437  uint8_t size = ((**pp) & DATA_SIZE_MASK);
    +
    1438  itemPrefix = (**pp);
    +
    1439  itemSize = 1 + ((size == DATA_SIZE_4) ? 4 : size);
    +
    1440  }
    +
    1441  (*pp)++;
    +
    1442  (*pcntdn)--;
    +
    1443  itemSize--;
    +
    1444  itemParseState = 1;
    +
    1445 
    +
    1446  if(!itemSize)
    +
    1447  break;
    +
    1448 
    +
    1449  if(!pcntdn)
    +
    1450  return enErrorIncomplete;
    +
    1451  case 1:
    + + +
    1454  itemParseState = 2;
    +
    1455  case 2:
    +
    1456  if(!valParser.Parse(pp, pcntdn))
    +
    1457  return enErrorIncomplete;
    +
    1458  itemParseState = 3;
    +
    1459  case 3:
    +
    1460  {
    +
    1461  uint8_t data = *((uint8_t*)varBuffer);
    +
    1462 
    +
    1463  switch(itemPrefix & (TYPE_MASK | TAG_MASK)) {
    +
    1464  case (TYPE_LOCAL | TAG_LOCAL_USAGE):
    +
    1465  if(pfUsage) {
    +
    1466  if(theBuffer.valueSize > 1) {
    +
    1467  uint16_t* ui16 = reinterpret_cast<uint16_t *>(varBuffer);
    +
    1468  pfUsage(*ui16);
    +
    1469  } else
    +
    1470  pfUsage(data);
    +
    1471  }
    +
    1472  break;
    + +
    1474  rptSize = data;
    +
    1475  break;
    + +
    1477  rptCount = data;
    +
    1478  break;
    + +
    1480  rptId = data;
    +
    1481  break;
    +
    1482  case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN):
    +
    1483  useMin = data;
    +
    1484  break;
    +
    1485  case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX):
    +
    1486  useMax = data;
    +
    1487  break;
    + +
    1489  SetUsagePage(data);
    +
    1490  break;
    +
    1491  case (TYPE_MAIN | TAG_MAIN_OUTPUT):
    +
    1492  case (TYPE_MAIN | TAG_MAIN_FEATURE):
    +
    1493  rptSize = 0;
    +
    1494  rptCount = 0;
    +
    1495  useMin = 0;
    +
    1496  useMax = 0;
    +
    1497  break;
    +
    1498  case (TYPE_MAIN | TAG_MAIN_INPUT):
    +
    1499  OnInputItem(data);
    +
    1500 
    +
    1501  totalSize += (uint16_t)rptSize * (uint16_t)rptCount;
    +
    1502 
    +
    1503  rptSize = 0;
    +
    1504  rptCount = 0;
    +
    1505  useMin = 0;
    +
    1506  useMax = 0;
    +
    1507  break;
    +
    1508  } // switch (**pp & (TYPE_MASK | TAG_MASK))
    +
    1509  }
    +
    1510  } // switch (itemParseState)
    +
    1511  itemParseState = 0;
    +
    1512  return enErrorSuccess;
    +
    1513 }
    +
    1514 
    +
    1515 void ReportDescParser2::OnInputItem(uint8_t itm) {
    +
    1516  uint8_t byte_offset = (totalSize >> 3); // calculate offset to the next unhandled byte i = (int)(totalCount / 8);
    +
    1517  uint32_t tmp = (byte_offset << 3);
    +
    1518  uint8_t bit_offset = totalSize - tmp; // number of bits in the current byte already handled
    +
    1519  uint8_t *p = pBuf + byte_offset; // current byte pointer
    +
    1520 
    +
    1521  if(bit_offset)
    +
    1522  *p >>= bit_offset;
    +
    1523 
    +
    1524  uint8_t usage = useMin;
    1525 
    -
    1526 void ReportDescParser2::OnInputItem(uint8_t itm) {
    -
    1527  uint8_t byte_offset = (totalSize >> 3); // calculate offset to the next unhandled byte i = (int)(totalCount / 8);
    -
    1528  uint32_t tmp = (byte_offset << 3);
    -
    1529  uint8_t bit_offset = totalSize - tmp; // number of bits in the current byte already handled
    -
    1530  uint8_t *p = pBuf + byte_offset; // current byte pointer
    -
    1531 
    -
    1532  if(bit_offset)
    -
    1533  *p >>= bit_offset;
    -
    1534 
    -
    1535  uint8_t usage = useMin;
    -
    1536 
    -
    1537  bool print_usemin_usemax = ((useMin < useMax) && ((itm & 3) == 2) && pfUsage) ? true : false;
    +
    1526  bool print_usemin_usemax = ((useMin < useMax) && ((itm & 3) == 2) && pfUsage) ? true : false;
    +
    1527 
    +
    1528  uint8_t bits_of_byte = 8;
    +
    1529 
    +
    1530  // for each field in field array defined by rptCount
    +
    1531  for(uint8_t field = 0; field < rptCount; field++, usage++) {
    +
    1532 
    +
    1533  union {
    +
    1534  uint8_t bResult[4];
    +
    1535  uint16_t wResult[2];
    +
    1536  uint32_t dwResult;
    +
    1537  } result;
    1538 
    -
    1539  uint8_t bits_of_byte = 8;
    -
    1540 
    -
    1541  // for each field in field array defined by rptCount
    -
    1542  for(uint8_t field = 0; field < rptCount; field++, usage++) {
    -
    1543 
    -
    1544  union {
    -
    1545  uint8_t bResult[4];
    -
    1546  uint16_t wResult[2];
    -
    1547  uint32_t dwResult;
    -
    1548  } result;
    -
    1549 
    -
    1550  result.dwResult = 0;
    -
    1551  uint8_t mask = 0;
    -
    1552 
    -
    1553  if(print_usemin_usemax)
    -
    1554  pfUsage(usage);
    +
    1539  result.dwResult = 0;
    +
    1540  uint8_t mask = 0;
    +
    1541 
    +
    1542  if(print_usemin_usemax)
    +
    1543  pfUsage(usage);
    +
    1544 
    +
    1545  // bits_left - number of bits in the field(array of fields, depending on Report Count) left to process
    +
    1546  // bits_of_byte - number of bits in current byte left to process
    +
    1547  // bits_to_copy - number of bits to copy to result buffer
    +
    1548 
    +
    1549  // for each bit in a field
    +
    1550  for(uint8_t bits_left = rptSize, bits_to_copy = 0; bits_left;
    +
    1551  bits_left -= bits_to_copy) {
    +
    1552  bits_to_copy = (bits_left > bits_of_byte) ? bits_of_byte : bits_left;
    +
    1553 
    +
    1554  result.dwResult <<= bits_to_copy; // Result buffer is shifted by the number of bits to be copied into it
    1555 
    -
    1556  // bits_left - number of bits in the field(array of fields, depending on Report Count) left to process
    -
    1557  // bits_of_byte - number of bits in current byte left to process
    -
    1558  // bits_to_copy - number of bits to copy to result buffer
    +
    1556  uint8_t val = *p;
    +
    1557 
    +
    1558  val >>= (8 - bits_of_byte); // Shift by the number of bits already processed
    1559 
    -
    1560  // for each bit in a field
    -
    1561  for(uint8_t bits_left = rptSize, bits_to_copy = 0; bits_left;
    -
    1562  bits_left -= bits_to_copy) {
    -
    1563  bits_to_copy = (bits_left > bits_of_byte) ? bits_of_byte : bits_left;
    -
    1564 
    -
    1565  result.dwResult <<= bits_to_copy; // Result buffer is shifted by the number of bits to be copied into it
    +
    1560  mask = 0;
    +
    1561 
    +
    1562  for(uint8_t j = bits_to_copy; j; j--) {
    +
    1563  mask <<= 1;
    +
    1564  mask |= 1;
    +
    1565  }
    1566 
    -
    1567  uint8_t val = *p;
    +
    1567  result.bResult[0] = (result.bResult[0] | (val & mask));
    1568 
    -
    1569  val >>= (8 - bits_of_byte); // Shift by the number of bits already processed
    +
    1569  bits_of_byte -= bits_to_copy;
    1570 
    -
    1571  mask = 0;
    -
    1572 
    -
    1573  for(uint8_t j = bits_to_copy; j; j--) {
    -
    1574  mask <<= 1;
    -
    1575  mask |= 1;
    -
    1576  }
    -
    1577 
    -
    1578  result.bResult[0] = (result.bResult[0] | (val & mask));
    -
    1579 
    -
    1580  bits_of_byte -= bits_to_copy;
    -
    1581 
    -
    1582  if(bits_of_byte < 1) {
    -
    1583  bits_of_byte = 8;
    -
    1584  p++;
    -
    1585  }
    -
    1586  }
    -
    1587  PrintByteValue(result.dwResult);
    -
    1588  }
    -
    1589  E_Notify(PSTR("\r\n"), 0x80);
    -
    1590 }
    -
    1591 
    -
    1592 void UniversalReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) {
    -
    1593  ReportDescParser2 prs(len, buf);
    -
    1594 
    -
    1595  uint8_t ret = hid->GetReportDescr(0, &prs);
    -
    1596 
    -
    1597  if(ret)
    -
    1598  ErrorMessage<uint8_t > (PSTR("GetReportDescr-2"), ret);
    -
    1599 }
    +
    1571  if(bits_of_byte < 1) {
    +
    1572  bits_of_byte = 8;
    +
    1573  p++;
    +
    1574  }
    +
    1575  }
    +
    1576  PrintByteValue(result.dwResult);
    +
    1577  }
    +
    1578  E_Notify(PSTR("\r\n"), 0x80);
    +
    1579 }
    +
    1580 
    +
    1581 void UniversalReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) {
    +
    1582  ReportDescParser2 prs(len, buf);
    +
    1583 
    +
    1584  uint8_t ret = hid->GetReportDescr(0, &prs);
    +
    1585 
    +
    1586  if(ret)
    +
    1587  ErrorMessage<uint8_t > (PSTR("GetReportDescr-2"), ret);
    +
    1588 }
    const char pstrUsageYTilt[]
    Definition: hidusagestr.h:814
    const char pstrUsageRewind[]
    Definition: hidusagestr.h:323
    static const char *const medInstrTitles0[]
    @@ -1705,7 +1695,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    static const char *const telTitles1[]
    const char pstrUsageSystemColdRestart[]
    Definition: hidusagestr.h:105
    const char pstrUsageSecurityCodeCharEntered[]
    Definition: hidusagestr.h:267
    -
    void(* UsagePageFunc)(uint16_t usage)
    const char pstrUsageRearBrake[]
    Definition: hidusagestr.h:180
    const char pstrUsageACSort[]
    Definition: hidusagestr.h:747
    const char pstrUsageSelectedIndicator[]
    Definition: hidusagestr.h:329
    @@ -1825,7 +1814,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    static const char *const aplphanumTitles2[]
    const char pstrUsageSystemSuspend[]
    Definition: hidusagestr.h:347
    #define TAG_GLOBAL_PUSH
    Definition: hid.h:55
    -
    static void PrintUsagePage(uint16_t page)
    +
    static void PrintUsagePage(uint16_t page)
    const char pstrUsageDepth[]
    Definition: hidusagestr.h:908
    const char pstrUsagePaletteDataSize[]
    Definition: hidusagestr.h:878
    #define TAG_GLOBAL_PHYSMIN
    Definition: hid.h:48
    @@ -1870,7 +1859,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageACRotate[]
    Definition: hidusagestr.h:694
    const char pstrUsageSystemMenuLeft[]
    Definition: hidusagestr.h:102
    const char pstrUsageColorDopplerModeAdjust[]
    Definition: hidusagestr.h:917
    -
    static void PrintTelephonyPageUsage(uint16_t usage)
    +
    static void PrintTelephonyPageUsage(uint16_t usage)
    const char pstrUsagePageBarCodeScanner[]
    Definition: hidusagestr.h:49
    const char pstrUsageACFormat[]
    Definition: hidusagestr.h:685
    const char pstrUsage3Wood[]
    Definition: hidusagestr.h:227
    @@ -1894,7 +1883,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageSave[]
    Definition: hidusagestr.h:901
    const char pstrUsageEject[]
    Definition: hidusagestr.h:494
    const char pstrUsagePageConsumer[]
    Definition: hidusagestr.h:41
    -
    static void PrintMedicalInstrumentPageUsage(uint16_t usage)
    +
    static void PrintMedicalInstrumentPageUsage(uint16_t usage)
    #define TYPE_MAIN
    Definition: hid.h:35
    const char pstrUsageALMovieBrowser[]
    Definition: hidusagestr.h:626
    const char pstrUsageACExpandAll[]
    Definition: hidusagestr.h:725
    @@ -1933,7 +1922,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsagePen[]
    Definition: hidusagestr.h:785
    const char pstrUsageSpeedSelect[]
    Definition: hidusagestr.h:528
    const char pstrUsageSubChannelDecrement[]
    Definition: hidusagestr.h:567
    -
    virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    +
    virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    const char pstrUsagePower[]
    Definition: hidusagestr.h:277
    const char pstrUsageMessage[]
    Definition: hidusagestr.h:383
    const char pstrUsageACSelectTimeZone[]
    Definition: hidusagestr.h:753
    @@ -1953,7 +1942,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageShootBall[]
    Definition: hidusagestr.h:250
    const char pstrUsageDivePlane[]
    Definition: hidusagestr.h:175
    const char pstrUsageSpinning[]
    Definition: hidusagestr.h:290
    -
    static void PrintLEDPageUsage(uint16_t usage)
    +
    static void PrintLEDPageUsage(uint16_t usage)
    const char pstrUsageFlightStick[]
    Definition: hidusagestr.h:143
    const char pstrUsageDisplayEnable[]
    Definition: hidusagestr.h:194
    const char pstrUsageAltitude[]
    Definition: hidusagestr.h:816
    @@ -1969,7 +1958,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageAlternateFunction[]
    Definition: hidusagestr.h:367
    const char pstrUsageDaily[]
    Definition: hidusagestr.h:483
    const char pstrUsageRowingMachine[]
    Definition: hidusagestr.h:199
    -
    static void PrintGameControlsPageUsage(uint16_t usage)
    +
    static void PrintGameControlsPageUsage(uint16_t usage)
    const char pstrUsageTrebleIncrement[]
    Definition: hidusagestr.h:552
    const char pstrUsageArmature[]
    Definition: hidusagestr.h:794
    const char pstrUsageCharacterReport[]
    Definition: hidusagestr.h:838
    @@ -1978,10 +1967,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageNext[]
    Definition: hidusagestr.h:900
    const char pstrUsageCursorEnable[]
    Definition: hidusagestr.h:852
    const char pstrUsageSoftButtonReport[]
    Definition: hidusagestr.h:892
    -
    static void PrintButtonPageUsage(uint16_t usage)
    +
    static void PrintButtonPageUsage(uint16_t usage)
    const char pstrUsageALOEMHelp[]
    Definition: hidusagestr.h:631
    const char pstrUsageQuit[]
    Definition: hidusagestr.h:470
    -
    static void PrintConsumerPageUsage(uint16_t usage)
    +
    static void PrintConsumerPageUsage(uint16_t usage)
    const char pstrUsagePhoneKey7[]
    Definition: hidusagestr.h:407
    const char pstrUsageALLogoff[]
    Definition: hidusagestr.h:598
    const char pstrUsageOnLine[]
    Definition: hidusagestr.h:313
    @@ -1989,10 +1978,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageACInsertPicture[]
    Definition: hidusagestr.h:773
    static void PrintItemTitle(uint8_t prefix)
    const char pstrUsageACDistributeVerticaly[]
    Definition: hidusagestr.h:781
    +
    #define TAG_GLOBAL_USAGEPAGE
    Definition: hid.h:45
    const char pstrUsageVolumeDecrement[]
    Definition: hidusagestr.h:527
    +
    void(* UsagePageFunc)(uint16_t usage)
    const char pstrUsageTabletPick[]
    Definition: hidusagestr.h:822
    - +
    const char pstrUsageDPadLeft[]
    Definition: hidusagestr.h:110
    const char pstrUsagePlus10[]
    Definition: hidusagestr.h:424
    const char pstrUsageBassDecrement[]
    Definition: hidusagestr.h:551
    @@ -2005,7 +1996,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageMenu[]
    Definition: hidusagestr.h:434
    const char pstrUsageALNextTaskApplication[]
    Definition: hidusagestr.h:605
    const char pstrUsagePhoneMute[]
    Definition: hidusagestr.h:373
    -
    static void PrintOrdinalPageUsage(uint16_t usage)
    +
    static void PrintOrdinalPageUsage(uint16_t usage)
    const char pstrUsageSystemDisplaySwapPriSec[]
    Definition: hidusagestr.h:126
    const char pstrUsageInsideRingback[]
    Definition: hidusagestr.h:390
    static const char *const consTitles3[]
    @@ -2031,7 +2022,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsage9Wood[]
    Definition: hidusagestr.h:230
    const char pstrUsageOrderMovie[]
    Definition: hidusagestr.h:455
    const char pstrUsageACSelectColumn[]
    Definition: hidusagestr.h:742
    -
    static void PrintDigitizerPageUsage(uint16_t usage)
    +
    static void PrintDigitizerPageUsage(uint16_t usage)
    const char pstrUsageSystemWarmRestart[]
    Definition: hidusagestr.h:106
    const char pstrUsageALKeyboardLayout[]
    Definition: hidusagestr.h:616
    const char pstrUsageACHistory[]
    Definition: hidusagestr.h:668
    @@ -2100,9 +2091,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageVoiceMail[]
    Definition: hidusagestr.h:380
    const char pstrUsageZoomSelect[]
    Definition: hidusagestr.h:912
    static const char *const aplphanumTitles1[]
    -
    static void PrintGenericDeviceControlsPageUsage(uint16_t usage)
    -
    static void PrintSportsControlsPageUsage(uint16_t usage)
    - +
    static void PrintGenericDeviceControlsPageUsage(uint16_t usage)
    +
    static void PrintSportsControlsPageUsage(uint16_t usage)
    const char pstrUsageElectronicCountermeasures[]
    Definition: hidusagestr.h:155
    const char pstrUsagePriorityRingback[]
    Definition: hidusagestr.h:391
    const char pstrUsageACLock[]
    Definition: hidusagestr.h:732
    @@ -2139,7 +2129,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageLowCutFilter[]
    Definition: hidusagestr.h:283
    const char pstrUsageChaffRelease[]
    Definition: hidusagestr.h:152
    const char pstrUsageACBold[]
    Definition: hidusagestr.h:687
    -
    static void PrintVRControlsPageUsage(uint16_t usage)
    +
    static void PrintVRControlsPageUsage(uint16_t usage)
    const char pstrUsageMediaSelectProgramGuide[]
    Definition: hidusagestr.h:463
    const char pstrUsage1Iron[]
    Definition: hidusagestr.h:212
    const char pstrUsageCompose[]
    Definition: hidusagestr.h:275
    @@ -2160,6 +2150,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    static const char *const medInstrTitles4[]
    const char pstrUsageACJustifyCenterV[]
    Definition: hidusagestr.h:708
    const char pstrUsageSlider[]
    Definition: hidusagestr.h:73
    +
    const char pstrUsageMonthly[]
    Definition: hidusagestr.h:485
    const char pstrUsageZ[]
    Definition: hidusagestr.h:69
    const char pstrUsageACSelectRow[]
    Definition: hidusagestr.h:743
    @@ -2216,7 +2207,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageACNewWindow[]
    Definition: hidusagestr.h:682
    const char pstrUsageALDatabaseApp[]
    Definition: hidusagestr.h:579
    const char pstrUsageALOnlineCommunity[]
    Definition: hidusagestr.h:632
    -
    const char pstrUsageFastForward[]
    Definition: hidusagestr.h:324
    const char pstrUsageClosedCaption[]
    Definition: hidusagestr.h:444
    const char pstrUsageVCRAcquisition[]
    Definition: hidusagestr.h:896
    @@ -2242,7 +2232,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    static const char *const telTitles0[]
    const char pstrUsageACDemote[]
    Definition: hidusagestr.h:717
    const char pstrUsageChannelSurround[]
    Definition: hidusagestr.h:561
    -
    static void PrintGenericDesktopPageUsage(uint16_t usage)
    +
    static void PrintGenericDesktopPageUsage(uint16_t usage)
    const char pstrUsageALFileBrowser[]
    Definition: hidusagestr.h:622
    const char pstrUsageSoftStepPrimary[]
    Definition: hidusagestr.h:909
    const char pstrUsageACCollapseAll[]
    Definition: hidusagestr.h:727
    @@ -2253,7 +2243,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageFeature[]
    Definition: hidusagestr.h:360
    bool Parse(uint8_t **pp, uint16_t *pcntdn)
    Definition: parsetools.cpp:19
    const char pstrUsageFont14Segment[]
    Definition: hidusagestr.h:863
    - +
    const char pstrUsageRx[]
    Definition: hidusagestr.h:70
    const char pstrUsage14SegmentDirectMap[]
    Definition: hidusagestr.h:864
    const char pstrUsageGamepadTrigger[]
    Definition: hidusagestr.h:260
    @@ -2287,6 +2277,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageDisplayStatus[]
    Definition: hidusagestr.h:840
    const char pstrUsageACFontColor[]
    Definition: hidusagestr.h:701
    const char pstrUsageWheel[]
    Definition: hidusagestr.h:75
    +
    #define PSTR(str)
    #define TAG_GLOBAL_REPORTSIZE
    Definition: hid.h:52
    const char pstrUsageACFontSelect[]
    Definition: hidusagestr.h:700
    const char pstrUsageRingSelect[]
    Definition: hidusagestr.h:372
    @@ -2332,7 +2323,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageMediaSelectVCR[]
    Definition: hidusagestr.h:468
    const char pstrUsageElevatorTrim[]
    Definition: hidusagestr.h:157
    const char pstrUsageRz[]
    Definition: hidusagestr.h:72
    -
    static void PrintSimulationControlsPageUsage(uint16_t usage)
    +
    static void PrintSimulationControlsPageUsage(uint16_t usage)
    const char pstrUsageTap[]
    Definition: hidusagestr.h:805
    const char pstrUsageACSyncronize[]
    Definition: hidusagestr.h:759
    const char pstrUsagePlaybackSpeed[]
    Definition: hidusagestr.h:529
    @@ -2363,7 +2354,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageModeStep[]
    Definition: hidusagestr.h:452
    const char pstrUsageInUseIndicator[]
    Definition: hidusagestr.h:330
    const char pstrUsageTrackNormal[]
    Definition: hidusagestr.h:500
    -
    static void PrintAlphanumDisplayPageUsage(uint16_t usage)
    +
    static void PrintAlphanumDisplayPageUsage(uint16_t usage)
    const char pstrUsageACPasteSpecial[]
    Definition: hidusagestr.h:729
    const char pstrUsageCallWaitingTone[]
    Definition: hidusagestr.h:394
    const char pstrUsageACAddToCart[]
    Definition: hidusagestr.h:723
    @@ -2469,7 +2460,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageSecondaryTipSwitch[]
    Definition: hidusagestr.h:819
    const char pstrUsageDiscoverWirelessControl[]
    Definition: hidusagestr.h:266
    const char pstrUsageSystemMainMenu[]
    Definition: hidusagestr.h:96
    -
    virtual void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset)
    +
    void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset)
    const char pstrUsageDataValid[]
    Definition: hidusagestr.h:807
    const char pstrUsageACViewToggle[]
    Definition: hidusagestr.h:675
    const char pstrUsagePriorityRingTone[]
    Definition: hidusagestr.h:389
    @@ -2507,7 +2498,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    const char pstrUsageALResearchSearchBrowser[]
    Definition: hidusagestr.h:639
    static const char *const digitTitles0[]
    const char pstrUsageAzimuth[]
    Definition: hidusagestr.h:815
    -
    virtual uint8_t ParseItem(uint8_t **pp, uint16_t *pcntdn)
    +
    virtual uint8_t ParseItem(uint8_t **pp, uint16_t *pcntdn)
    const char pstrUsageACSelectAll[]
    Definition: hidusagestr.h:655
    const char pstrUsageALNetworkChat[]
    Definition: hidusagestr.h:595
    const char pstrUsageMotocicleSimulationDevice[]
    Definition: hidusagestr.h:136
    @@ -2675,7 +2666,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/hidescriptorparser_8h.html b/hidescriptorparser_8h.html index efaac84e..91781fcb 100644 --- a/hidescriptorparser_8h.html +++ b/hidescriptorparser_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidescriptorparser.h File Reference + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -125,7 +126,7 @@ Classes diff --git a/hidescriptorparser_8h__dep__incl.md5 b/hidescriptorparser_8h__dep__incl.md5 index 991feb0f..e086c781 100644 --- a/hidescriptorparser_8h__dep__incl.md5 +++ b/hidescriptorparser_8h__dep__incl.md5 @@ -1 +1 @@ -6d9c0da3c50e6ec2d2e9f7e12ac51f93 \ No newline at end of file +f9ba94ed99ad5905f056e92fce988411 \ No newline at end of file diff --git a/hidescriptorparser_8h__incl.md5 b/hidescriptorparser_8h__incl.md5 index 0decf55a..a4d83f26 100644 --- a/hidescriptorparser_8h__incl.md5 +++ b/hidescriptorparser_8h__incl.md5 @@ -1 +1 @@ -995e56fd70b002050bc9cb01e6404c98 \ No newline at end of file +a0afe05b5a9c183c07c271615e912399 \ No newline at end of file diff --git a/hidescriptorparser_8h_source.html b/hidescriptorparser_8h_source.html index c33f5022..c4e264b0 100644 --- a/hidescriptorparser_8h_source.html +++ b/hidescriptorparser_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidescriptorparser.h Source File + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    21 
    23 public:
    -
    24  typedef void (*UsagePageFunc)(uint16_t usage);
    +
    24  typedef void (*UsagePageFunc)(uint16_t usage);
    25 
    26  static void PrintGenericDesktopPageUsage(uint16_t usage);
    27  static void PrintSimulationControlsPageUsage(uint16_t usage);
    @@ -187,7 +188,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    96  static const char * const medInstrTitles4[];
    97 
    98 protected:
    - +
    100 
    @@ -202,70 +203,72 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    111 
    112  uint16_t totalSize; // Report size in bits
    113 
    -
    114  virtual uint8_t ParseItem(uint8_t **pp, uint16_t *pcntdn);
    -
    115 
    - -
    117 
    -
    118  static void PrintUsagePage(uint16_t page);
    -
    119  void SetUsagePage(uint16_t page);
    -
    120 
    -
    121 public:
    -
    122 
    - -
    124  itemParseState(0),
    -
    125  itemSize(0),
    -
    126  itemPrefix(0),
    -
    127  rptSize(0),
    -
    128  rptCount(0),
    -
    129  pfUsage(NULL) {
    - - - -
    133  };
    -
    134 
    -
    135  virtual void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset);
    -
    136 
    -
    137  enum {
    - -
    139  , enErrorIncomplete // value or record is partialy read in buffer
    - -
    141  };
    -
    142 };
    -
    143 
    - -
    145 };
    -
    146 
    - -
    148  uint8_t rptId; // Report ID
    -
    149  uint8_t useMin; // Usage Minimum
    -
    150  uint8_t useMax; // Usage Maximum
    -
    151  uint8_t fieldCount; // Number of field being currently processed
    -
    152 
    -
    153  void OnInputItem(uint8_t itm); // Method which is called every time Input item is found
    -
    154 
    -
    155  uint8_t *pBuf; // Report buffer pointer
    -
    156  uint8_t bLen; // Report length
    -
    157 
    -
    158 protected:
    -
    159  virtual uint8_t ParseItem(uint8_t **pp, uint16_t *pcntdn);
    -
    160 
    -
    161 public:
    +
    114  // Method should be defined here if virtual.
    +
    115  virtual uint8_t ParseItem(uint8_t **pp, uint16_t *pcntdn);
    +
    116 
    + +
    118 
    +
    119  static void PrintUsagePage(uint16_t page);
    +
    120  void SetUsagePage(uint16_t page);
    +
    121 
    +
    122 public:
    +
    123 
    + +
    125  itemParseState(0),
    +
    126  itemSize(0),
    +
    127  itemPrefix(0),
    +
    128  rptSize(0),
    +
    129  rptCount(0),
    +
    130  pfUsage(NULL) {
    +
    131  theBuffer.pValue = varBuffer;
    +
    132  valParser.Initialize(&theBuffer);
    +
    133  theSkipper.Initialize(&theBuffer);
    +
    134  };
    +
    135 
    +
    136  void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset);
    +
    137 
    +
    138  enum {
    + +
    140  , enErrorIncomplete // value or record is partialy read in buffer
    + +
    142  };
    +
    143 };
    +
    144 
    + +
    146 };
    +
    147 
    + +
    149  uint8_t rptId; // Report ID
    +
    150  uint8_t useMin; // Usage Minimum
    +
    151  uint8_t useMax; // Usage Maximum
    +
    152  uint8_t fieldCount; // Number of field being currently processed
    +
    153 
    +
    154  void OnInputItem(uint8_t itm); // Method which is called every time Input item is found
    +
    155 
    +
    156  uint8_t *pBuf; // Report buffer pointer
    +
    157  uint8_t bLen; // Report length
    +
    158 
    +
    159 protected:
    +
    160  // Method should be defined here if virtual.
    +
    161  virtual uint8_t ParseItem(uint8_t **pp, uint16_t *pcntdn);
    162 
    -
    163  ReportDescParser2(uint16_t len, uint8_t *pbuf) :
    -
    164  ReportDescParserBase(), rptId(0), useMin(0), useMax(0), fieldCount(0), pBuf(pbuf), bLen(len) {
    -
    165  };
    -
    166 };
    -
    167 
    - -
    169 public:
    -
    170  virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf);
    -
    171 };
    -
    172 
    -
    173 #endif // __HIDDESCRIPTORPARSER_H__
    +
    163 public:
    +
    164 
    +
    165  ReportDescParser2(uint16_t len, uint8_t *pbuf) :
    +
    166  ReportDescParserBase(), rptId(0), useMin(0), useMax(0), fieldCount(0), pBuf(pbuf), bLen(len) {
    +
    167  };
    +
    168 };
    +
    169 
    + +
    171 public:
    +
    172  // Method should be defined here if virtual.
    +
    173  virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf);
    +
    174 };
    +
    175 
    +
    176 #endif // __HIDDESCRIPTORPARSER_H__
    static const char *const medInstrTitles0[]
    static const char *const usagePageTitles0[]
    static const char *const telTitles1[]
    -
    void(* UsagePageFunc)(uint16_t usage)
    static const char *const consTitles1[]
    static const char *const consTitles5[]
    static const char *const consTitlesD[]
    @@ -275,31 +278,33 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    static const char *const telTitles5[]
    static const char *const aplphanumTitles2[]
    -
    static void PrintUsagePage(uint16_t page)
    +
    static void PrintUsagePage(uint16_t page)
    static const char *const gameTitles1[]
    static const char *const genDesktopTitles0[]
    static const char *const genDevCtrlTitles[]
    -
    static void PrintTelephonyPageUsage(uint16_t usage)
    +
    static void PrintTelephonyPageUsage(uint16_t usage)
    static void PrintByteValue(uint8_t data)
    -
    static void PrintMedicalInstrumentPageUsage(uint16_t usage)
    +
    static void PrintMedicalInstrumentPageUsage(uint16_t usage)
    static const char *const consTitles7[]
    -
    virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    -
    static void PrintLEDPageUsage(uint16_t usage)
    +
    virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    +
    static void PrintLEDPageUsage(uint16_t usage)
    void SetUsagePage(uint16_t page)
    -
    static void PrintGameControlsPageUsage(uint16_t usage)
    -
    static void PrintButtonPageUsage(uint16_t usage)
    -
    static void PrintConsumerPageUsage(uint16_t usage)
    +
    static void PrintGameControlsPageUsage(uint16_t usage)
    +
    static void PrintButtonPageUsage(uint16_t usage)
    +
    static void PrintConsumerPageUsage(uint16_t usage)
    static void PrintItemTitle(uint8_t prefix)
    - + +
    void(* UsagePageFunc)(uint16_t usage)
    +
    static const char *const medInstrTitles1[]
    -
    static void PrintOrdinalPageUsage(uint16_t usage)
    +
    static void PrintOrdinalPageUsage(uint16_t usage)
    static const char *const consTitles3[]
    static const char *const genDesktopTitles3[]
    static const char *const usagePageTitles1[]
    static const char *const simuTitles1[]
    -
    static void PrintDigitizerPageUsage(uint16_t usage)
    +
    static void PrintDigitizerPageUsage(uint16_t usage)
    static const char *const consTitles4[]
    static const char *const digitTitles2[]
    static const char *const genDesktopTitles2[]
    @@ -311,52 +316,51 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    static const char *const sportsCtrlTitles2[]
    static const char *const consTitlesC[]
    static const char *const aplphanumTitles1[]
    -
    static void PrintGenericDeviceControlsPageUsage(uint16_t usage)
    -
    static void PrintSportsControlsPageUsage(uint16_t usage)
    - +
    static void PrintGenericDeviceControlsPageUsage(uint16_t usage)
    +
    static void PrintSportsControlsPageUsage(uint16_t usage)
    static const char *const consTitlesB[]
    void Initialize(MultiValueBuffer *pbuf)
    Definition: parsetools.h:60
    -
    static void PrintVRControlsPageUsage(uint16_t usage)
    +
    static void PrintVRControlsPageUsage(uint16_t usage)
    static const char *const medInstrTitles4[]
    -
    ReportDescParser2(uint16_t len, uint8_t *pbuf)
    + +
    ReportDescParser2(uint16_t len, uint8_t *pbuf)
    Definition: hid.h:143
    static const char *const telTitles3[]
    - - +
    static const char *const consTitles2[]
    static const char *const telTitles0[]
    -
    static void PrintGenericDesktopPageUsage(uint16_t usage)
    - - +
    static void PrintGenericDesktopPageUsage(uint16_t usage)
    + + - - + +
    MultiByteValueParser valParser
    static const char *const consTitles6[]
    static const char *const vrTitles0[]
    static const char *const telTitles2[]
    static const char *const consTitles0[]
    -
    static void PrintSimulationControlsPageUsage(uint16_t usage)
    +
    static void PrintSimulationControlsPageUsage(uint16_t usage)
    static const char *const sportsCtrlTitles0[]
    static const char *const medInstrTitles3[]
    -
    static void PrintAlphanumDisplayPageUsage(uint16_t usage)
    +
    static void PrintAlphanumDisplayPageUsage(uint16_t usage)
    virtual uint8_t ParseItem(uint8_t **pp, uint16_t *pcntdn)
    +
    static const char *const digitTitles1[]
    static const char *const vrTitles1[]
    static const char *const ledTitles[]
    void Initialize(MultiValueBuffer *const pbuf)
    Definition: parsetools.h:42
    static const char *const gameTitles0[]
    -
    virtual void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset)
    - +
    void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset)
    static const char *const consTitlesA[]
    static const char *const genDesktopTitles4[]
    static const char *const consTitlesE[]
    static const char *const digitTitles0[]
    -
    virtual uint8_t ParseItem(uint8_t **pp, uint16_t *pcntdn)
    +
    virtual uint8_t ParseItem(uint8_t **pp, uint16_t *pcntdn)
    static const char *const simuTitles0[]
    static const char *const simuTitles2[]
    static const char *const sportsCtrlTitles1[]
    @@ -374,7 +378,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/hiduniversal_8cpp.html b/hiduniversal_8cpp.html index c5d2676b..b64f8312 100644 --- a/hiduniversal_8cpp.html +++ b/hiduniversal_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hiduniversal.cpp File Reference + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -104,7 +105,7 @@ Include dependency graph for hiduniversal.cpp:
    diff --git a/hiduniversal_8cpp__incl.md5 b/hiduniversal_8cpp__incl.md5 index 4c55bb1e..abe26a65 100644 --- a/hiduniversal_8cpp__incl.md5 +++ b/hiduniversal_8cpp__incl.md5 @@ -1 +1 @@ -32a76392309f3454fa83907b12976ee0 \ No newline at end of file +f166c2163e3da736da869307c3454d25 \ No newline at end of file diff --git a/hiduniversal_8cpp_source.html b/hiduniversal_8cpp_source.html index b49ce6c8..1aa9434d 100644 --- a/hiduniversal_8cpp_source.html +++ b/hiduniversal_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hiduniversal.cpp Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -194,7 +195,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    103  uint8_t len = 0;
    104 
    105  uint8_t num_of_conf; // number of configurations
    -
    106  //uint8_t num_of_intf; // number of interfaces
    +
    106  //uint8_t num_of_intf; // number of interfaces
    107 
    108  AddressPool &addrPool = pUsb->GetAddressPool();
    109 
    @@ -291,7 +292,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    200  USBTRACE2("NC:", num_of_conf);
    201 
    202  for(uint8_t i = 0; i < num_of_conf; i++) {
    -
    203  //HexDumper<USBReadParser, uint16_t, uint16_t> HexDump;
    +
    203  //HexDumper<USBReadParser, uint16_t, uint16_t> HexDump;
    205  CP_MASK_COMPARE_CLASS> confDescrParser(this);
    206 
    @@ -490,14 +491,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    399  if(identical)
    400  return 0;
    401 #if 0
    -
    402  Notify(PSTR("\r\nBuf: "), 0x80);
    +
    402  Notify(PSTR("\r\nBuf: "), 0x80);
    403 
    404  for(uint8_t i = 0; i < read; i++) {
    405  D_PrintHex<uint8_t > (buf[i], 0x80);
    -
    406  Notify(PSTR(" "), 0x80);
    +
    406  Notify(PSTR(" "), 0x80);
    407  }
    408 
    -
    409  Notify(PSTR("\r\n"), 0x80);
    +
    409  Notify(PSTR("\r\n"), 0x80);
    410 #endif
    411  ParseHIDData(this, bHasReportId, (uint8_t)read, buf);
    412 
    @@ -509,15 +510,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    418  }
    419  return rcode;
    420 }
    +
    421 
    +
    422 // Send a report to interrupt out endpoint. This is NOT SetReport() request!
    +
    423 uint8_t HIDUniversal::SndRpt(uint16_t nbytes, uint8_t *dataptr) {
    +
    424  return pUsb->outTransfer(bAddress, epInfo[epInterruptOutIndex].epAddr, nbytes, dataptr);
    +
    425 }
    uint16_t PID
    Definition: hiduniversal.h:69
    -
    uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
    Definition: Usb.cpp:766
    -
    virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
    +
    uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
    Definition: Usb.cpp:769
    +
    uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
    bool bHasReportId
    Definition: hiduniversal.h:67
    EpInfo * epinfo
    Definition: address.h:76
    bool lowspeed
    Definition: address.h:79
    -
    #define USB_ERROR_EPINFO_IS_NULL
    Definition: UsbCore.h:81
    -
    #define hrSTALL
    Definition: max3421e.h:217
    +
    #define USB_ERROR_EPINFO_IS_NULL
    Definition: UsbCore.h:83
    +
    #define hrSTALL
    Definition: max3421e.h:212
    uint8_t bmNakPower
    Definition: address.h:42
    @@ -526,69 +532,72 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint8_t bMaxPacketSize0
    Definition: usb_ch9.h:105
    #define NotifyFail(...)
    Definition: message.h:55
    static const uint8_t epInterruptOutIndex
    Definition: hid.h:150
    -
    uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
    Definition: Usb.cpp:805
    +
    uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
    Definition: Usb.cpp:808
    #define NotifyFailGetDevDescr(...)
    Definition: message.h:50
    uint8_t bAddress
    Definition: hid.h:146
    HIDInterface hidInterfaces[maxHidInterfaces]
    Definition: hiduniversal.h:65
    uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
    Definition: Usb.cpp:64
    -
    virtual uint8_t Release()
    -
    #define CP_MASK_COMPARE_CLASS
    +
    uint8_t Release()
    +
    #define CP_MASK_COMPARE_CLASS
    uint16_t VID
    Definition: hiduniversal.h:69
    virtual uint8_t OnInitSuccessful()
    Definition: hiduniversal.h:74
    -
    #define USB_CLASS_HID
    Definition: UsbCore.h:57
    +
    #define USB_CLASS_HID
    Definition: UsbCore.h:59
    virtual void FreeAddress(uint8_t addr)=0
    -
    virtual uint8_t Poll()
    +
    uint8_t Poll()
    uint8_t epAttribs
    Definition: address.h:37
    virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
    #define Notify(...)
    Definition: message.h:44
    - +
    #define USBTRACE2(s, r)
    Definition: macros.h:77
    -
    uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
    Definition: Usb.cpp:796
    +
    uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
    Definition: Usb.cpp:799
    #define NotifyFailGetConfDescr(...)
    Definition: message.h:52
    virtual void ParseHIDData(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    Definition: hiduniversal.h:78
    uint8_t epAddr
    Definition: address.h:33
    #define USB_NAK_MAX_POWER
    Definition: address.h:27
    -
    virtual HIDReportParser * GetReportParser(uint8_t id)
    +
    HIDReportParser * GetReportParser(uint8_t id)
    Definition: address.h:32
    -
    virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
    -
    #define hrNAK
    Definition: max3421e.h:216
    +
    uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
    Definition: Usb.cpp:292
    +
    void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
    +
    #define hrNAK
    Definition: max3421e.h:211
    HIDUniversal(USB *p)
    uint16_t wMaxPacketSize
    Definition: usb_ch9.h:146
    Definition: hid.h:143
    virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
    uint8_t bEndpointAddress
    Definition: usb_ch9.h:144
    -
    #define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
    Definition: UsbCore.h:83
    +
    #define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
    Definition: UsbCore.h:85
    +
    #define PSTR(str)
    #define USB_NAK_NOWAIT
    Definition: address.h:29
    -
    #define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
    Definition: UsbCore.h:80
    +
    #define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
    Definition: UsbCore.h:82
    virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)=0
    uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
    Definition: Usb.cpp:206
    #define MAX_REPORT_PARSERS
    Definition: hid.h:23
    -
    #define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
    Definition: UsbCore.h:75
    +
    #define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
    Definition: UsbCore.h:77
    USB * pUsb
    Definition: hid.h:145
    uint8_t SetIdle(uint8_t iface, uint8_t reportID, uint8_t duration)
    Definition: hid.cpp:62
    uint16_t idProduct
    Definition: usb_ch9.h:107
    static const uint8_t epInterruptInIndex
    Definition: hid.h:149
    +
    uint8_t SndRpt(uint16_t nbytes, uint8_t *dataptr)
    uint8_t bNumConfigurations
    Definition: usb_ch9.h:112
    -
    #define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
    Definition: UsbCore.h:78
    +
    #define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
    Definition: UsbCore.h:80
    uint8_t maxPktSize
    Definition: address.h:34
    -
    AddressPool & GetAddressPool()
    Definition: UsbCore.h:206
    +
    AddressPool & GetAddressPool()
    Definition: UsbCore.h:213
    -
    Definition: UsbCore.h:190
    +
    Definition: UsbCore.h:197
    #define USBTRACE3(s, r, l)
    Definition: macros.h:78
    -
    uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
    Definition: UsbCore.h:210
    +
    uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
    Definition: UsbCore.h:217
    static const uint8_t totalEndpoints
    Definition: hid.h:154
    #define NotifyFailSetConfDescr(...)
    Definition: message.h:53
    EpInfo epInfo[totalEndpoints]
    Definition: hiduniversal.h:64
    #define HID_MAX_HID_CLASS_DESCRIPTORS
    Definition: hid.h:24
    static const uint8_t maxEpPerInterface
    Definition: hid.h:153
    -
    virtual bool SetReportParser(uint8_t id, HIDReportParser *prs)
    +
    bool SetReportParser(uint8_t id, HIDReportParser *prs)
    #define USBTRACE(s)
    Definition: macros.h:75
    -
    uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
    defined(USB_METHODS_INLINE)
    Definition: Usb.cpp:761
    +
    uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
    defined(USB_METHODS_INLINE)
    Definition: Usb.cpp:764
    #define NotifyFailSetDevTblEntry(...)
    Definition: message.h:51
    static const uint8_t maxHidInterfaces
    Definition: hid.h:152
    @@ -597,7 +606,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/hiduniversal_8h.html b/hiduniversal_8h.html index b16a31d3..575027ec 100644 --- a/hiduniversal_8h.html +++ b/hiduniversal_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hiduniversal.h File Reference + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -119,7 +120,7 @@ Classes diff --git a/hiduniversal_8h__dep__incl.md5 b/hiduniversal_8h__dep__incl.md5 index 436cf0d0..8b07bcbb 100644 --- a/hiduniversal_8h__dep__incl.md5 +++ b/hiduniversal_8h__dep__incl.md5 @@ -1 +1 @@ -a86212bae843e45e600441e77f5c34e5 \ No newline at end of file +6079ba5023de3a9bc19938f024e95433 \ No newline at end of file diff --git a/hiduniversal_8h__incl.md5 b/hiduniversal_8h__incl.md5 index dbe1fb13..9ad0797e 100644 --- a/hiduniversal_8h__incl.md5 +++ b/hiduniversal_8h__incl.md5 @@ -1 +1 @@ -9241a6908523802cf640b05f17a0115f \ No newline at end of file +7e667316a72f4254e92d23fbd41baea2 \ No newline at end of file diff --git a/hiduniversal_8h_source.html b/hiduniversal_8h_source.html index 4172f3d0..442b2526 100644 --- a/hiduniversal_8h_source.html +++ b/hiduniversal_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hiduniversal.h Source File + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -160,7 +161,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    69  uint16_t PID, VID; // PID and VID of connected device
    70 
    71  // HID implementation
    -
    72  virtual HIDReportParser* GetReportParser(uint8_t id);
    +
    72  HIDReportParser* GetReportParser(uint8_t id);
    73 
    74  virtual uint8_t OnInitSuccessful() {
    75  return 0;
    @@ -174,12 +175,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    83  HIDUniversal(USB *p);
    84 
    85  // HID implementation
    -
    86  virtual bool SetReportParser(uint8_t id, HIDReportParser *prs);
    +
    86  bool SetReportParser(uint8_t id, HIDReportParser *prs);
    87 
    88  // USBDeviceConfig implementation
    -
    89  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
    -
    90  virtual uint8_t Release();
    -
    91  virtual uint8_t Poll();
    +
    89  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
    +
    90  uint8_t Release();
    +
    91  uint8_t Poll();
    92 
    93  virtual uint8_t GetAddress() {
    94  return bAddress;
    @@ -190,12 +191,15 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    99  };
    100 
    101  // UsbConfigXtracter implementation
    -
    102  virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
    -
    103 };
    -
    104 
    -
    105 #endif // __HIDUNIVERSAL_H__
    +
    102  void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
    +
    103 
    +
    104  // Send report - do not mix with SetReport()!
    +
    105  uint8_t SndRpt(uint16_t nbytes, uint8_t *dataptr);
    +
    106 };
    +
    107 
    +
    108 #endif // __HIDUNIVERSAL_H__
    uint16_t PID
    Definition: hiduniversal.h:69
    -
    virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
    +
    uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
    bool bHasReportId
    Definition: hiduniversal.h:67
    virtual bool isReady()
    Definition: hiduniversal.h:97
    @@ -203,25 +207,26 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint8_t bAddress
    Definition: hid.h:146
    HIDInterface hidInterfaces[maxHidInterfaces]
    Definition: hiduniversal.h:65
    -
    virtual uint8_t Release()
    +
    uint8_t Release()
    uint16_t VID
    Definition: hiduniversal.h:69
    virtual uint8_t OnInitSuccessful()
    Definition: hiduniversal.h:74
    -
    virtual uint8_t Poll()
    +
    uint8_t Poll()
    virtual void ParseHIDData(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
    Definition: hiduniversal.h:78
    -
    virtual HIDReportParser * GetReportParser(uint8_t id)
    +
    HIDReportParser * GetReportParser(uint8_t id)
    Definition: address.h:32
    -
    virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
    +
    void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
    HIDUniversal(USB *p)
    Definition: hid.h:143
    #define MAX_REPORT_PARSERS
    Definition: hid.h:23
    +
    uint8_t SndRpt(uint16_t nbytes, uint8_t *dataptr)
    -
    Definition: UsbCore.h:190
    +
    Definition: UsbCore.h:197
    virtual uint8_t GetAddress()
    Definition: hiduniversal.h:93
    static const uint8_t totalEndpoints
    Definition: hid.h:154
    EpInfo epInfo[totalEndpoints]
    Definition: hiduniversal.h:64
    #define HID_MAX_HID_CLASS_DESCRIPTORS
    Definition: hid.h:24
    static const uint8_t maxEpPerInterface
    Definition: hid.h:153
    -
    virtual bool SetReportParser(uint8_t id, HIDReportParser *prs)
    +
    bool SetReportParser(uint8_t id, HIDReportParser *prs)
    static const uint8_t maxHidInterfaces
    Definition: hid.h:152
    @@ -229,7 +234,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/hidusagestr_8h.html b/hidusagestr_8h.html index efee6706..03041dcd 100644 --- a/hidusagestr_8h.html +++ b/hidusagestr_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidusagestr.h File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -104,7 +105,7 @@ This graph shows which files directly or indirectly include this file:
    - +

    Go to the source code of this file.

    @@ -13862,7 +13863,7 @@ Variables diff --git a/hidusagestr_8h__dep__incl.map b/hidusagestr_8h__dep__incl.map index ebfa9a20..253c090f 100644 --- a/hidusagestr_8h__dep__incl.map +++ b/hidusagestr_8h__dep__incl.map @@ -1,17 +1,31 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hidusagestr_8h__dep__incl.md5 b/hidusagestr_8h__dep__incl.md5 index bc666d1e..82f83106 100644 --- a/hidusagestr_8h__dep__incl.md5 +++ b/hidusagestr_8h__dep__incl.md5 @@ -1 +1 @@ -b6544c4d984ea18ee75ce97840862dc1 \ No newline at end of file +79f7cddbbaea899b2a60dccfaea5c735 \ No newline at end of file diff --git a/hidusagestr_8h__dep__incl.png b/hidusagestr_8h__dep__incl.png index 5919da11..a65b4a76 100644 Binary files a/hidusagestr_8h__dep__incl.png and b/hidusagestr_8h__dep__incl.png differ diff --git a/hidusagestr_8h__incl.md5 b/hidusagestr_8h__incl.md5 index 98b0c93e..bc04b8cf 100644 --- a/hidusagestr_8h__incl.md5 +++ b/hidusagestr_8h__incl.md5 @@ -1 +1 @@ -5c963a7b7fd1884b649a89fdccf4c385 \ No newline at end of file +794eccf037bd4feb00fd840fe0fc37b3 \ No newline at end of file diff --git a/hidusagestr_8h_source.html b/hidusagestr_8h_source.html index ae395f4e..6319a5c2 100644 --- a/hidusagestr_8h_source.html +++ b/hidusagestr_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidusagestr.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -449,7 +450,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    358 const char pstrUsageHookSwitch [] PROGMEM = "Hook Sw";
    359 const char pstrUsageFlash [] PROGMEM = "Flash";
    360 const char pstrUsageFeature [] PROGMEM = "Feature";
    -
    361 //const char pstrUsageHold [] PROGMEM = "Hold";
    +
    361 //const char pstrUsageHold [] PROGMEM = "Hold";
    362 const char pstrUsageRedial [] PROGMEM = "Redial";
    363 const char pstrUsageTransfer [] PROGMEM = "Transfer";
    364 const char pstrUsageDrop [] PROGMEM = "Drop";
    @@ -458,7 +459,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    367 const char pstrUsageAlternateFunction [] PROGMEM = "Alt Func";
    368 const char pstrUsageLine [] PROGMEM = "Line";
    369 const char pstrUsageSpeakerPhone [] PROGMEM = "Spk Phone";
    -
    370 //const char pstrUsageConference [] PROGMEM = "Conference";
    +
    370 //const char pstrUsageConference [] PROGMEM = "Conference";
    371 const char pstrUsageRingEnable [] PROGMEM = "Ring Enbl";
    372 const char pstrUsageRingSelect [] PROGMEM = "Ring Sel";
    373 const char pstrUsagePhoneMute [] PROGMEM = "Phone Mute";
    @@ -470,7 +471,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    379 const char pstrUsagePhoneDirectory [] PROGMEM = "Phone Dir";
    380 const char pstrUsageVoiceMail [] PROGMEM = "Voice Mail";
    381 const char pstrUsageScreenCalls [] PROGMEM = "Screen Calls";
    -
    382 //const char pstrUsageDoNotDisturb [] PROGMEM = "Do Not Disturb";
    +
    382 //const char pstrUsageDoNotDisturb [] PROGMEM = "Do Not Disturb";
    383 const char pstrUsageMessage [] PROGMEM = "Msg";
    384 const char pstrUsageAnswerOnOff [] PROGMEM = "Answer On/Off";
    385 const char pstrUsageInsideDialTone [] PROGMEM = "Inside Dial Tone";
    @@ -508,14 +509,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    417 // Consumer Usage Page
    418 const char pstrUsageConsumerControl [] PROGMEM = "Consumer Ctrl";
    419 const char pstrUsageNumericKeyPad [] PROGMEM = "Num Key Pad";
    -
    420 //const char pstrUsageProgrammableButton [] PROGMEM = "Prog Btn";
    -
    421 //const char pstrUsageMicrophone [] PROGMEM = "Mic";
    +
    420 //const char pstrUsageProgrammableButton [] PROGMEM = "Prog Btn";
    +
    421 //const char pstrUsageMicrophone [] PROGMEM = "Mic";
    422 const char pstrUsageHeadphone [] PROGMEM = "Headphone";
    423 const char pstrUsageGraphicEqualizer [] PROGMEM = "Graph Eq";
    424 const char pstrUsagePlus10 [] PROGMEM = "+10";
    425 const char pstrUsagePlus100 [] PROGMEM = "+100";
    426 const char pstrUsageAMPM [] PROGMEM = "AM/PM";
    -
    427 //const char pstrUsagePower [] PROGMEM = "Pwr";
    +
    427 //const char pstrUsagePower [] PROGMEM = "Pwr";
    428 const char pstrUsageReset [] PROGMEM = "Reset";
    429 const char pstrUsageSleep [] PROGMEM = "Sleep";
    430 const char pstrUsageSleepAfter [] PROGMEM = "Sleep After";
    @@ -574,19 +575,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    483 const char pstrUsageDaily [] PROGMEM = "Daily";
    484 const char pstrUsageWeekly [] PROGMEM = "Weekly";
    485 const char pstrUsageMonthly [] PROGMEM = "Monthly";
    -
    486 //const char pstrUsagePlay [] PROGMEM = "Play";
    -
    487 //const char pstrUsagePause [] PROGMEM = "Pause";
    -
    488 //const char pstrUsageRecord [] PROGMEM = "Rec";
    -
    489 //const char pstrUsageFastForward [] PROGMEM = "FF";
    -
    490 //const char pstrUsageRewind [] PROGMEM = "Rewind";
    +
    486 //const char pstrUsagePlay [] PROGMEM = "Play";
    +
    487 //const char pstrUsagePause [] PROGMEM = "Pause";
    +
    488 //const char pstrUsageRecord [] PROGMEM = "Rec";
    +
    489 //const char pstrUsageFastForward [] PROGMEM = "FF";
    +
    490 //const char pstrUsageRewind [] PROGMEM = "Rewind";
    491 const char pstrUsageScanNextTrack [] PROGMEM = "Next Track";
    492 const char pstrUsageScanPreviousTrack [] PROGMEM = "Prev Track";
    -
    493 //const char pstrUsageStop [] PROGMEM = "Stop";
    +
    493 //const char pstrUsageStop [] PROGMEM = "Stop";
    494 const char pstrUsageEject [] PROGMEM = "Eject";
    495 const char pstrUsageRandomPlay [] PROGMEM = "Random";
    496 const char pstrUsageSelectDisk [] PROGMEM = "Sel Disk";
    497 const char pstrUsageEnterDisk [] PROGMEM = "Ent Disk";
    -
    498 //const char pstrUsageRepeat [] PROGMEM = "Repeat";
    +
    498 //const char pstrUsageRepeat [] PROGMEM = "Repeat";
    499 const char pstrUsageTracking [] PROGMEM = "Tracking";
    500 const char pstrUsageTrackNormal [] PROGMEM = "Trk Norm";
    501 const char pstrUsageSlowTracking [] PROGMEM = "Slow Trk";
    @@ -607,7 +608,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    516 const char pstrUsagePlaySkip [] PROGMEM = "Play/Skip";
    517 const char pstrUsageVolume [] PROGMEM = "Vol";
    518 const char pstrUsageBalance [] PROGMEM = "Balance";
    -
    519 //const char pstrUsageMute [] PROGMEM = "Mute";
    +
    519 //const char pstrUsageMute [] PROGMEM = "Mute";
    520 const char pstrUsageBass [] PROGMEM = "Bass";
    521 const char pstrUsageTreble [] PROGMEM = "Treble";
    522 const char pstrUsageBassBoost [] PROGMEM = "Bass Boost";
    @@ -899,7 +900,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    808 const char pstrUsageTransducerIndex [] PROGMEM = "Transducer Ind";
    809 const char pstrUsageTabletFunctionKeys [] PROGMEM = "Tabl Func Keys";
    810 const char pstrUsageProgramChangeKeys [] PROGMEM = "Pgm Chng Keys";
    -
    811 //const char pstrUsageBatteryStrength [] PROGMEM = "Bat Strength";
    +
    811 //const char pstrUsageBatteryStrength [] PROGMEM = "Bat Strength";
    812 const char pstrUsageInvert [] PROGMEM = "Invert";
    813 const char pstrUsageXTilt [] PROGMEM = "X Tilt";
    814 const char pstrUsageYTilt [] PROGMEM = "Y Tilt";
    @@ -921,7 +922,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    830 const char pstrUsageFontReadBack [] PROGMEM = "Fnt Rd Back";
    831 const char pstrUsageDisplayControlReport [] PROGMEM = "Disp Ctrl Rpt";
    832 const char pstrUsageClearDisplay [] PROGMEM = "Clr Disp";
    -
    833 //const char pstrUsageDisplayEnable [] PROGMEM = "Disp Enbl";
    +
    833 //const char pstrUsageDisplayEnable [] PROGMEM = "Disp Enbl";
    834 const char pstrUsageScreenSaverDelay [] PROGMEM = "Scr Sav Delay";
    835 const char pstrUsageScreenSaverEnable [] PROGMEM = "Scr Sav Enbl";
    836 const char pstrUsageVerticalScroll [] PROGMEM = "V Scroll";
    @@ -994,7 +995,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    903 const char pstrUsageMicrophoneEnable [] PROGMEM = "Mic Enbl";
    904 const char pstrUsageCine [] PROGMEM = "Cine";
    905 const char pstrUsageTransmitPower [] PROGMEM = "Trans Pwr";
    -
    906 //const char pstrUsageVolume [] PROGMEM = "Vol";
    +
    906 //const char pstrUsageVolume [] PROGMEM = "Vol";
    907 const char pstrUsageFocus [] PROGMEM = "Focus";
    908 const char pstrUsageDepth [] PROGMEM = "Depth";
    909 const char pstrUsageSoftStepPrimary [] PROGMEM = "Soft Stp-Pri";
    @@ -1931,7 +1932,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/hidusagetitlearrays_8cpp.html b/hidusagetitlearrays_8cpp.html index 28ebf05b..4a8774cd 100644 --- a/hidusagetitlearrays_8cpp.html +++ b/hidusagetitlearrays_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidusagetitlearrays.cpp File Reference + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -127,7 +128,7 @@ Macros diff --git a/hidusagetitlearrays_8cpp__incl.md5 b/hidusagetitlearrays_8cpp__incl.md5 index 94a0dbe2..4e28641f 100644 --- a/hidusagetitlearrays_8cpp__incl.md5 +++ b/hidusagetitlearrays_8cpp__incl.md5 @@ -1 +1 @@ -f05b4297843c24e9f050bb654365b3db \ No newline at end of file +24f4b9fff6ebcb53f983ea5749309c1d \ No newline at end of file diff --git a/hidusagetitlearrays_8cpp_source.html b/hidusagetitlearrays_8cpp_source.html index a361fcff..07bc68d7 100644 --- a/hidusagetitlearrays_8cpp_source.html +++ b/hidusagetitlearrays_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: hidusagetitlearrays.cpp Source File + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -110,1038 +111,1040 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    19 
    20 #include "hidusagestr.h"
    21 
    -
    22 //const char *usagePageTitles0[] PROGMEM =
    -
    23 //{
    -
    24 // pstrUsagePageGenericDesktopControls ,
    -
    25 // pstrUsagePageSimulationControls ,
    -
    26 // pstrUsagePageVRControls ,
    -
    27 // pstrUsagePageSportControls ,
    -
    28 // pstrUsagePageGameControls ,
    -
    29 // pstrUsagePageGenericDeviceControls ,
    -
    30 // pstrUsagePageKeyboardKeypad ,
    -
    31 // pstrUsagePageLEDs ,
    -
    32 // pstrUsagePageButton ,
    -
    33 // pstrUsagePageOrdinal ,
    -
    34 // pstrUsagePageTelephone ,
    -
    35 // pstrUsagePageConsumer ,
    -
    36 // pstrUsagePageDigitizer ,
    -
    37 // pstrUsagePagePID ,
    -
    38 // pstrUsagePageUnicode
    -
    39 //};
    -
    40 //
    -
    41 //const char *usagePageTitles1[] PROGMEM =
    -
    42 //{
    -
    43 // pstrUsagePageBarCodeScanner ,
    -
    44 // pstrUsagePageScale ,
    -
    45 // pstrUsagePageMSRDevices ,
    -
    46 // pstrUsagePagePointOfSale ,
    -
    47 // pstrUsagePageCameraControl ,
    -
    48 // pstrUsagePageArcade
    -
    49 //};
    -
    50 //const char *genDesktopTitles0[] PROGMEM =
    -
    51 //{
    -
    52 // pstrUsagePointer ,
    -
    53 // pstrUsageMouse ,
    -
    54 // pstrUsageJoystick ,
    -
    55 // pstrUsageGamePad ,
    -
    56 // pstrUsageKeyboard ,
    -
    57 // pstrUsageKeypad ,
    -
    58 // pstrUsageMultiAxisController ,
    -
    59 // pstrUsageTabletPCSystemControls
    -
    60 //
    -
    61 //};
    -
    62 //const char *genDesktopTitles1[] PROGMEM =
    -
    63 //{
    -
    64 // pstrUsageX ,
    -
    65 // pstrUsageY ,
    -
    66 // pstrUsageZ ,
    -
    67 // pstrUsageRx ,
    -
    68 // pstrUsageRy ,
    -
    69 // pstrUsageRz ,
    -
    70 // pstrUsageSlider ,
    -
    71 // pstrUsageDial ,
    -
    72 // pstrUsageWheel ,
    -
    73 // pstrUsageHatSwitch ,
    -
    74 // pstrUsageCountedBuffer ,
    -
    75 // pstrUsageByteCount ,
    -
    76 // pstrUsageMotionWakeup ,
    -
    77 // pstrUsageStart ,
    -
    78 // pstrUsageSelect ,
    -
    79 // pstrUsagePageReserved ,
    -
    80 // pstrUsageVx ,
    -
    81 // pstrUsageVy ,
    -
    82 // pstrUsageVz ,
    -
    83 // pstrUsageVbrx ,
    -
    84 // pstrUsageVbry ,
    -
    85 // pstrUsageVbrz ,
    -
    86 // pstrUsageVno ,
    -
    87 // pstrUsageFeatureNotification ,
    -
    88 // pstrUsageResolutionMultiplier
    -
    89 //};
    -
    90 //const char *genDesktopTitles2[] PROGMEM =
    -
    91 //{
    -
    92 // pstrUsageSystemControl ,
    -
    93 // pstrUsageSystemPowerDown ,
    -
    94 // pstrUsageSystemSleep ,
    -
    95 // pstrUsageSystemWakeup ,
    -
    96 // pstrUsageSystemContextMenu ,
    -
    97 // pstrUsageSystemMainMenu ,
    -
    98 // pstrUsageSystemAppMenu ,
    -
    99 // pstrUsageSystemMenuHelp ,
    -
    100 // pstrUsageSystemMenuExit ,
    -
    101 // pstrUsageSystemMenuSelect ,
    -
    102 // pstrUsageSystemMenuRight ,
    -
    103 // pstrUsageSystemMenuLeft ,
    -
    104 // pstrUsageSystemMenuUp ,
    -
    105 // pstrUsageSystemMenuDown ,
    -
    106 // pstrUsageSystemColdRestart ,
    -
    107 // pstrUsageSystemWarmRestart ,
    -
    108 // pstrUsageDPadUp ,
    -
    109 // pstrUsageDPadDown ,
    -
    110 // pstrUsageDPadRight ,
    -
    111 // pstrUsageDPadLeft
    -
    112 //};
    -
    113 //const char *genDesktopTitles3[] PROGMEM =
    -
    114 //{
    -
    115 // pstrUsageSystemDock ,
    -
    116 // pstrUsageSystemUndock ,
    -
    117 // pstrUsageSystemSetup ,
    -
    118 // pstrUsageSystemBreak ,
    -
    119 // pstrUsageSystemDebuggerBreak ,
    -
    120 // pstrUsageApplicationBreak ,
    -
    121 // pstrUsageApplicationDebuggerBreak,
    -
    122 // pstrUsageSystemSpeakerMute ,
    -
    123 // pstrUsageSystemHibernate
    -
    124 //};
    -
    125 //const char *genDesktopTitles4[] PROGMEM =
    -
    126 //{
    -
    127 // pstrUsageSystemDisplayInvert ,
    -
    128 // pstrUsageSystemDisplayInternal ,
    -
    129 // pstrUsageSystemDisplayExternal ,
    -
    130 // pstrUsageSystemDisplayBoth ,
    -
    131 // pstrUsageSystemDisplayDual ,
    -
    132 // pstrUsageSystemDisplayToggleIntExt ,
    -
    133 // pstrUsageSystemDisplaySwapPriSec ,
    -
    134 // pstrUsageSystemDisplayLCDAutoscale
    -
    135 //};
    -
    136 //const char *simuTitles0[] PROGMEM =
    -
    137 //{
    -
    138 // pstrUsageFlightSimulationDevice ,
    -
    139 // pstrUsageAutomobileSimulationDevice ,
    -
    140 // pstrUsageTankSimulationDevice ,
    -
    141 // pstrUsageSpaceshipSimulationDevice ,
    -
    142 // pstrUsageSubmarineSimulationDevice ,
    -
    143 // pstrUsageSailingSimulationDevice ,
    -
    144 // pstrUsageMotocicleSimulationDevice ,
    -
    145 // pstrUsageSportsSimulationDevice ,
    -
    146 // pstrUsageAirplaneSimulationDevice ,
    -
    147 // pstrUsageHelicopterSimulationDevice ,
    -
    148 // pstrUsageMagicCarpetSimulationDevice,
    -
    149 // pstrUsageBicycleSimulationDevice
    -
    150 //};
    -
    151 //const char *simuTitles1[] PROGMEM =
    -
    152 //{
    -
    153 // pstrUsageFlightControlStick ,
    -
    154 // pstrUsageFlightStick ,
    -
    155 // pstrUsageCyclicControl ,
    -
    156 // pstrUsageCyclicTrim ,
    -
    157 // pstrUsageFlightYoke ,
    -
    158 // pstrUsageTrackControl
    -
    159 //};
    -
    160 //const char *simuTitles2[] PROGMEM =
    -
    161 //{
    -
    162 // pstrUsageAileron ,
    -
    163 // pstrUsageAileronTrim ,
    -
    164 // pstrUsageAntiTorqueControl ,
    -
    165 // pstrUsageAutopilotEnable ,
    -
    166 // pstrUsageChaffRelease ,
    -
    167 // pstrUsageCollectiveControl ,
    -
    168 // pstrUsageDiveBrake ,
    -
    169 // pstrUsageElectronicCountermeasures ,
    -
    170 // pstrUsageElevator ,
    -
    171 // pstrUsageElevatorTrim ,
    -
    172 // pstrUsageRudder ,
    -
    173 // pstrUsageThrottle ,
    -
    174 // pstrUsageFlightCommunications ,
    -
    175 // pstrUsageFlareRelease ,
    -
    176 // pstrUsageLandingGear ,
    -
    177 // pstrUsageToeBrake ,
    -
    178 // pstrUsageTrigger ,
    -
    179 // pstrUsageWeaponsArm ,
    -
    180 // pstrUsageWeaponsSelect ,
    -
    181 // pstrUsageWingFlaps ,
    -
    182 // pstrUsageAccelerator ,
    -
    183 // pstrUsageBrake ,
    -
    184 // pstrUsageClutch ,
    -
    185 // pstrUsageShifter ,
    -
    186 // pstrUsageSteering ,
    -
    187 // pstrUsageTurretDirection ,
    -
    188 // pstrUsageBarrelElevation ,
    -
    189 // pstrUsageDivePlane ,
    -
    190 // pstrUsageBallast ,
    -
    191 // pstrUsageBicycleCrank ,
    -
    192 // pstrUsageHandleBars ,
    -
    193 // pstrUsageFrontBrake ,
    -
    194 // pstrUsageRearBrake
    -
    195 //};
    -
    196 //const char *vrTitles0[] PROGMEM =
    -
    197 //{
    -
    198 // pstrUsageBelt ,
    -
    199 // pstrUsageBodySuit ,
    -
    200 // pstrUsageFlexor ,
    -
    201 // pstrUsageGlove ,
    -
    202 // pstrUsageHeadTracker ,
    -
    203 // pstrUsageHeadMountedDisplay ,
    -
    204 // pstrUsageHandTracker ,
    -
    205 // pstrUsageOculometer ,
    -
    206 // pstrUsageVest ,
    -
    207 // pstrUsageAnimatronicDevice
    -
    208 //};
    -
    209 //const char *vrTitles1[] PROGMEM =
    -
    210 //{
    -
    211 // pstrUsageStereoEnable ,
    -
    212 // pstrUsageDisplayEnable
    -
    213 //};
    -
    214 //const char *sportsCtrlTitles0[] PROGMEM =
    -
    215 //{
    -
    216 // pstrUsageBaseballBat ,
    -
    217 // pstrUsageGolfClub ,
    -
    218 // pstrUsageRowingMachine ,
    -
    219 // pstrUsageTreadmill
    -
    220 //};
    -
    221 //const char *sportsCtrlTitles1[] PROGMEM =
    -
    222 //{
    -
    223 // pstrUsageOar ,
    -
    224 // pstrUsageSlope ,
    -
    225 // pstrUsageRate ,
    -
    226 // pstrUsageStickSpeed ,
    -
    227 // pstrUsageStickFaceAngle ,
    -
    228 // pstrUsageStickHeelToe ,
    -
    229 // pstrUsageStickFollowThough ,
    -
    230 // pstrUsageStickTempo ,
    -
    231 // pstrUsageStickType ,
    -
    232 // pstrUsageStickHeight
    -
    233 //};
    -
    234 //const char *sportsCtrlTitles2[] PROGMEM =
    -
    235 //{
    -
    236 // pstrUsagePutter ,
    -
    237 // pstrUsage1Iron ,
    -
    238 // pstrUsage2Iron ,
    -
    239 // pstrUsage3Iron ,
    -
    240 // pstrUsage4Iron ,
    -
    241 // pstrUsage5Iron ,
    -
    242 // pstrUsage6Iron ,
    -
    243 // pstrUsage7Iron ,
    -
    244 // pstrUsage8Iron ,
    -
    245 // pstrUsage9Iron ,
    -
    246 // pstrUsage10Iron ,
    -
    247 // pstrUsage11Iron ,
    -
    248 // pstrUsageSandWedge ,
    -
    249 // pstrUsageLoftWedge ,
    -
    250 // pstrUsagePowerWedge ,
    -
    251 // pstrUsage1Wood ,
    -
    252 // pstrUsage3Wood ,
    -
    253 // pstrUsage5Wood ,
    -
    254 // pstrUsage7Wood ,
    -
    255 // pstrUsage9Wood
    -
    256 //};
    -
    257 //const char *gameTitles0[] PROGMEM =
    -
    258 //{
    -
    259 // pstrUsage3DGameController ,
    -
    260 // pstrUsagePinballDevice ,
    -
    261 // pstrUsageGunDevice
    -
    262 //};
    -
    263 //const char *gameTitles1[] PROGMEM =
    -
    264 //{
    -
    265 // pstrUsagePointOfView ,
    -
    266 // pstrUsageTurnRightLeft ,
    -
    267 // pstrUsagePitchForwardBackward ,
    -
    268 // pstrUsageRollRightLeft ,
    -
    269 // pstrUsageMoveRightLeft ,
    -
    270 // pstrUsageMoveForwardBackward ,
    -
    271 // pstrUsageMoveUpDown ,
    -
    272 // pstrUsageLeanRightLeft ,
    -
    273 // pstrUsageLeanForwardBackward ,
    -
    274 // pstrUsageHeightOfPOV ,
    -
    275 // pstrUsageFlipper ,
    -
    276 // pstrUsageSecondaryFlipper ,
    -
    277 // pstrUsageBump ,
    -
    278 // pstrUsageNewGame ,
    -
    279 // pstrUsageShootBall ,
    -
    280 // pstrUsagePlayer ,
    -
    281 // pstrUsageGunBolt ,
    -
    282 // pstrUsageGunClip ,
    -
    283 // pstrUsageGunSelector ,
    -
    284 // pstrUsageGunSingleShot ,
    -
    285 // pstrUsageGunBurst ,
    -
    286 // pstrUsageGunAutomatic ,
    -
    287 // pstrUsageGunSafety ,
    -
    288 // pstrUsageGamepadFireJump ,
    -
    289 // pstrUsageGamepadTrigger
    -
    290 //};
    -
    291 //const char *genDevCtrlTitles[] PROGMEM =
    -
    292 //{
    -
    293 // pstrUsageBatteryStrength,
    -
    294 // pstrUsageWirelessChannel,
    -
    295 // pstrUsageWirelessID,
    -
    296 // pstrUsageDiscoverWirelessControl,
    -
    297 // pstrUsageSecurityCodeCharEntered,
    -
    298 // pstrUsageSecurityCodeCharErased,
    -
    299 // pstrUsageSecurityCodeCleared
    -
    300 //};
    -
    301 //const char *ledTitles[] PROGMEM =
    -
    302 //{
    -
    303 // pstrUsageNumLock ,
    -
    304 // pstrUsageCapsLock ,
    -
    305 // pstrUsageScrollLock ,
    -
    306 // pstrUsageCompose ,
    -
    307 // pstrUsageKana ,
    -
    308 // pstrUsagePower ,
    -
    309 // pstrUsageShift ,
    -
    310 // pstrUsageDoNotDisturb ,
    -
    311 // pstrUsageMute ,
    -
    312 // pstrUsageToneEnable ,
    -
    313 // pstrUsageHighCutFilter ,
    -
    314 // pstrUsageLowCutFilter ,
    -
    315 // pstrUsageEqualizerEnable ,
    -
    316 // pstrUsageSoundFieldOn ,
    -
    317 // pstrUsageSurroundOn ,
    -
    318 // pstrUsageRepeat ,
    -
    319 // pstrUsageStereo ,
    -
    320 // pstrUsageSamplingRateDetect ,
    -
    321 // pstrUsageSpinning ,
    -
    322 // pstrUsageCAV ,
    -
    323 // pstrUsageCLV ,
    -
    324 // pstrUsageRecordingFormatDetect ,
    -
    325 // pstrUsageOffHook ,
    -
    326 // pstrUsageRing ,
    -
    327 // pstrUsageMessageWaiting ,
    -
    328 // pstrUsageDataMode ,
    -
    329 // pstrUsageBatteryOperation ,
    -
    330 // pstrUsageBatteryOK ,
    -
    331 // pstrUsageBatteryLow ,
    -
    332 // pstrUsageSpeaker ,
    -
    333 // pstrUsageHeadSet ,
    -
    334 // pstrUsageHold ,
    -
    335 // pstrUsageMicrophone ,
    -
    336 // pstrUsageCoverage ,
    -
    337 // pstrUsageNightMode ,
    -
    338 // pstrUsageSendCalls ,
    -
    339 // pstrUsageCallPickup ,
    -
    340 // pstrUsageConference ,
    -
    341 // pstrUsageStandBy ,
    -
    342 // pstrUsageCameraOn ,
    -
    343 // pstrUsageCameraOff ,
    -
    344 // pstrUsageOnLine ,
    -
    345 // pstrUsageOffLine ,
    -
    346 // pstrUsageBusy ,
    -
    347 // pstrUsageReady ,
    -
    348 // pstrUsagePaperOut ,
    -
    349 // pstrUsagePaperJam ,
    -
    350 // pstrUsageRemote ,
    -
    351 // pstrUsageForward ,
    -
    352 // pstrUsageReverse ,
    -
    353 // pstrUsageStop ,
    -
    354 // pstrUsageRewind ,
    -
    355 // pstrUsageFastForward ,
    -
    356 // pstrUsagePlay ,
    -
    357 // pstrUsagePause ,
    -
    358 // pstrUsageRecord ,
    -
    359 // pstrUsageError ,
    -
    360 // pstrUsageSelectedIndicator ,
    -
    361 // pstrUsageInUseIndicator ,
    -
    362 // pstrUsageMultiModeIndicator ,
    -
    363 // pstrUsageIndicatorOn ,
    -
    364 // pstrUsageIndicatorFlash ,
    -
    365 // pstrUsageIndicatorSlowBlink ,
    -
    366 // pstrUsageIndicatorFastBlink ,
    -
    367 // pstrUsageIndicatorOff ,
    -
    368 // pstrUsageFlashOnTime ,
    -
    369 // pstrUsageSlowBlinkOnTime ,
    -
    370 // pstrUsageSlowBlinkOffTime ,
    -
    371 // pstrUsageFastBlinkOnTime ,
    -
    372 // pstrUsageFastBlinkOffTime ,
    -
    373 // pstrUsageIndicatorColor ,
    -
    374 // pstrUsageIndicatorRed ,
    -
    375 // pstrUsageIndicatorGreen ,
    -
    376 // pstrUsageIndicatorAmber ,
    -
    377 // pstrUsageGenericIndicator ,
    -
    378 // pstrUsageSystemSuspend ,
    -
    379 // pstrUsageExternalPowerConnected
    -
    380 //};
    -
    381 //const char *telTitles0 [] PROGMEM =
    -
    382 //{
    -
    383 // pstrUsagePhone ,
    -
    384 // pstrUsageAnsweringMachine ,
    -
    385 // pstrUsageMessageControls ,
    -
    386 // pstrUsageHandset ,
    -
    387 // pstrUsageHeadset ,
    -
    388 // pstrUsageTelephonyKeyPad ,
    -
    389 // pstrUsageProgrammableButton
    -
    390 //};
    -
    391 //const char *telTitles1 [] PROGMEM =
    -
    392 //{
    -
    393 // pstrUsageHookSwitch ,
    -
    394 // pstrUsageFlash ,
    -
    395 // pstrUsageFeature ,
    -
    396 // pstrUsageHold ,
    -
    397 // pstrUsageRedial ,
    -
    398 // pstrUsageTransfer ,
    -
    399 // pstrUsageDrop ,
    -
    400 // pstrUsagePark ,
    -
    401 // pstrUsageForwardCalls ,
    -
    402 // pstrUsageAlternateFunction ,
    -
    403 // pstrUsageLine ,
    -
    404 // pstrUsageSpeakerPhone ,
    -
    405 // pstrUsageConference ,
    -
    406 // pstrUsageRingEnable ,
    -
    407 // pstrUsageRingSelect ,
    -
    408 // pstrUsagePhoneMute ,
    -
    409 // pstrUsageCallerID ,
    -
    410 // pstrUsageSend
    -
    411 //};
    -
    412 //const char *telTitles2 [] PROGMEM =
    -
    413 //{
    -
    414 // pstrUsageSpeedDial ,
    -
    415 // pstrUsageStoreNumber ,
    -
    416 // pstrUsageRecallNumber ,
    -
    417 // pstrUsagePhoneDirectory
    -
    418 //};
    -
    419 //const char *telTitles3 [] PROGMEM =
    -
    420 //{
    -
    421 // pstrUsageVoiceMail ,
    -
    422 // pstrUsageScreenCalls ,
    -
    423 // pstrUsageDoNotDisturb ,
    -
    424 // pstrUsageMessage ,
    -
    425 // pstrUsageAnswerOnOff
    -
    426 //};
    -
    427 //const char *telTitles4 [] PROGMEM =
    -
    428 //{
    -
    429 // pstrUsageInsideDialTone ,
    -
    430 // pstrUsageOutsideDialTone ,
    -
    431 // pstrUsageInsideRingTone ,
    -
    432 // pstrUsageOutsideRingTone ,
    -
    433 // pstrUsagePriorityRingTone ,
    -
    434 // pstrUsageInsideRingback ,
    -
    435 // pstrUsagePriorityRingback ,
    -
    436 // pstrUsageLineBusyTone ,
    -
    437 // pstrUsageReorderTone ,
    -
    438 // pstrUsageCallWaitingTone ,
    -
    439 // pstrUsageConfirmationTone1 ,
    -
    440 // pstrUsageConfirmationTone2 ,
    -
    441 // pstrUsageTonesOff ,
    -
    442 // pstrUsageOutsideRingback ,
    -
    443 // pstrUsageRinger
    -
    444 //};
    -
    445 //const char *telTitles5 [] PROGMEM =
    -
    446 //{
    -
    447 // pstrUsagePhoneKey0 ,
    -
    448 // pstrUsagePhoneKey1 ,
    -
    449 // pstrUsagePhoneKey2 ,
    -
    450 // pstrUsagePhoneKey3 ,
    -
    451 // pstrUsagePhoneKey4 ,
    -
    452 // pstrUsagePhoneKey5 ,
    -
    453 // pstrUsagePhoneKey6 ,
    -
    454 // pstrUsagePhoneKey7 ,
    -
    455 // pstrUsagePhoneKey8 ,
    -
    456 // pstrUsagePhoneKey9 ,
    -
    457 // pstrUsagePhoneKeyStar ,
    -
    458 // pstrUsagePhoneKeyPound ,
    -
    459 // pstrUsagePhoneKeyA ,
    -
    460 // pstrUsagePhoneKeyB ,
    -
    461 // pstrUsagePhoneKeyC ,
    -
    462 // pstrUsagePhoneKeyD
    -
    463 //};
    -
    464 //const char *consTitles0[] PROGMEM =
    -
    465 //{
    -
    466 // pstrUsageConsumerControl,
    -
    467 // pstrUsageNumericKeyPad,
    -
    468 // pstrUsageProgrammableButton,
    -
    469 // pstrUsageMicrophone,
    -
    470 // pstrUsageHeadphone,
    -
    471 // pstrUsageGraphicEqualizer
    -
    472 //};
    -
    473 //const char *consTitles1[] PROGMEM =
    -
    474 //{
    -
    475 // pstrUsagePlus10 ,
    -
    476 // pstrUsagePlus100,
    -
    477 // pstrUsageAMPM
    -
    478 //};
    -
    479 //const char *consTitles2[] PROGMEM =
    -
    480 //{
    -
    481 // pstrUsagePower ,
    -
    482 // pstrUsageReset ,
    -
    483 // pstrUsageSleep ,
    -
    484 // pstrUsageSleepAfter ,
    -
    485 // pstrUsageSleepMode ,
    -
    486 // pstrUsageIllumination ,
    -
    487 // pstrUsageFunctionButtons
    -
    488 //
    -
    489 //};
    -
    490 //const char *consTitles3[] PROGMEM =
    -
    491 //{
    -
    492 // pstrUsageMenu ,
    -
    493 // pstrUsageMenuPick ,
    -
    494 // pstrUsageMenuUp ,
    -
    495 // pstrUsageMenuDown ,
    -
    496 // pstrUsageMenuLeft ,
    -
    497 // pstrUsageMenuRight ,
    -
    498 // pstrUsageMenuEscape ,
    -
    499 // pstrUsageMenuValueIncrease,
    -
    500 // pstrUsageMenuValueDecrease
    -
    501 //};
    -
    502 //const char *consTitles4[] PROGMEM =
    -
    503 //{
    -
    504 // pstrUsageDataOnScreen ,
    -
    505 // pstrUsageClosedCaption ,
    -
    506 // pstrUsageClosedCaptionSelect,
    -
    507 // pstrUsageVCRTV ,
    -
    508 // pstrUsageBroadcastMode ,
    -
    509 // pstrUsageSnapshot ,
    -
    510 // pstrUsageStill
    -
    511 //};
    -
    512 //const char *consTitles5[] PROGMEM =
    -
    513 //{
    -
    514 // pstrUsageSelection ,
    -
    515 // pstrUsageAssignSelection ,
    -
    516 // pstrUsageModeStep ,
    -
    517 // pstrUsageRecallLast ,
    -
    518 // pstrUsageEnterChannel ,
    -
    519 // pstrUsageOrderMovie ,
    -
    520 // pstrUsageChannel ,
    -
    521 // pstrUsageMediaSelection ,
    -
    522 // pstrUsageMediaSelectComputer ,
    -
    523 // pstrUsageMediaSelectTV ,
    -
    524 // pstrUsageMediaSelectWWW ,
    -
    525 // pstrUsageMediaSelectDVD ,
    -
    526 // pstrUsageMediaSelectTelephone ,
    -
    527 // pstrUsageMediaSelectProgramGuide ,
    -
    528 // pstrUsageMediaSelectVideoPhone ,
    -
    529 // pstrUsageMediaSelectGames ,
    -
    530 // pstrUsageMediaSelectMessages ,
    -
    531 // pstrUsageMediaSelectCD ,
    -
    532 // pstrUsageMediaSelectVCR ,
    -
    533 // pstrUsageMediaSelectTuner ,
    -
    534 // pstrUsageQuit ,
    -
    535 // pstrUsageHelp ,
    -
    536 // pstrUsageMediaSelectTape ,
    -
    537 // pstrUsageMediaSelectCable ,
    -
    538 // pstrUsageMediaSelectSatellite ,
    -
    539 // pstrUsageMediaSelectSecurity ,
    -
    540 // pstrUsageMediaSelectHome ,
    -
    541 // pstrUsageMediaSelectCall ,
    -
    542 // pstrUsageChannelIncrement ,
    -
    543 // pstrUsageChannelDecrement ,
    -
    544 // pstrUsageMediaSelectSAP ,
    -
    545 // pstrUsagePageReserved ,
    -
    546 // pstrUsageVCRPlus ,
    -
    547 // pstrUsageOnce ,
    -
    548 // pstrUsageDaily ,
    -
    549 // pstrUsageWeekly ,
    -
    550 // pstrUsageMonthly
    -
    551 //};
    -
    552 //const char *consTitles6[] PROGMEM =
    -
    553 //{
    -
    554 // pstrUsagePlay ,
    -
    555 // pstrUsagePause ,
    -
    556 // pstrUsageRecord ,
    -
    557 // pstrUsageFastForward ,
    -
    558 // pstrUsageRewind ,
    -
    559 // pstrUsageScanNextTrack ,
    -
    560 // pstrUsageScanPreviousTrack ,
    -
    561 // pstrUsageStop ,
    -
    562 // pstrUsageEject ,
    -
    563 // pstrUsageRandomPlay ,
    -
    564 // pstrUsageSelectDisk ,
    -
    565 // pstrUsageEnterDisk ,
    -
    566 // pstrUsageRepeat ,
    -
    567 // pstrUsageTracking ,
    -
    568 // pstrUsageTrackNormal ,
    -
    569 // pstrUsageSlowTracking ,
    -
    570 // pstrUsageFrameForward ,
    -
    571 // pstrUsageFrameBackwards ,
    -
    572 // pstrUsageMark ,
    -
    573 // pstrUsageClearMark ,
    -
    574 // pstrUsageRepeatFromMark ,
    -
    575 // pstrUsageReturnToMark ,
    -
    576 // pstrUsageSearchMarkForward ,
    -
    577 // pstrUsageSearchMarkBackwards ,
    -
    578 // pstrUsageCounterReset ,
    -
    579 // pstrUsageShowCounter ,
    -
    580 // pstrUsageTrackingIncrement ,
    -
    581 // pstrUsageTrackingDecrement ,
    -
    582 // pstrUsageStopEject ,
    -
    583 // pstrUsagePlayPause ,
    -
    584 // pstrUsagePlaySkip
    -
    585 //};
    -
    586 //const char *consTitles7[] PROGMEM =
    -
    587 //{
    -
    588 // pstrUsageVolume ,
    -
    589 // pstrUsageBalance ,
    -
    590 // pstrUsageMute ,
    -
    591 // pstrUsageBass ,
    -
    592 // pstrUsageTreble ,
    -
    593 // pstrUsageBassBoost ,
    -
    594 // pstrUsageSurroundMode ,
    -
    595 // pstrUsageLoudness ,
    -
    596 // pstrUsageMPX ,
    -
    597 // pstrUsageVolumeIncrement ,
    -
    598 // pstrUsageVolumeDecrement
    -
    599 //};
    -
    600 //const char *consTitles8[] PROGMEM =
    -
    601 //{
    -
    602 // pstrUsageSpeedSelect ,
    -
    603 // pstrUsagePlaybackSpeed ,
    -
    604 // pstrUsageStandardPlay ,
    -
    605 // pstrUsageLongPlay ,
    -
    606 // pstrUsageExtendedPlay ,
    -
    607 // pstrUsageSlow
    -
    608 //};
    -
    609 //const char *consTitles9[] PROGMEM =
    -
    610 //{
    -
    611 // pstrUsageFanEnable ,
    -
    612 // pstrUsageFanSpeed ,
    -
    613 // pstrUsageLightEnable ,
    -
    614 // pstrUsageLightIlluminationLevel ,
    -
    615 // pstrUsageClimateControlEnable ,
    -
    616 // pstrUsageRoomTemperature ,
    -
    617 // pstrUsageSecurityEnable ,
    -
    618 // pstrUsageFireAlarm ,
    -
    619 // pstrUsagePoliceAlarm ,
    -
    620 // pstrUsageProximity ,
    -
    621 // pstrUsageMotion ,
    -
    622 // pstrUsageDuresAlarm ,
    -
    623 // pstrUsageHoldupAlarm ,
    -
    624 // pstrUsageMedicalAlarm
    -
    625 //};
    -
    626 //const char *consTitlesA[] PROGMEM =
    -
    627 //{
    -
    628 // pstrUsageBalanceRight ,
    -
    629 // pstrUsageBalanceLeft ,
    -
    630 // pstrUsageBassIncrement ,
    -
    631 // pstrUsageBassDecrement ,
    -
    632 // pstrUsageTrebleIncrement ,
    -
    633 // pstrUsageTrebleDecrement
    -
    634 //};
    -
    635 //const char *consTitlesB[] PROGMEM =
    -
    636 //{
    -
    637 // pstrUsageSpeakerSystem ,
    -
    638 // pstrUsageChannelLeft ,
    -
    639 // pstrUsageChannelRight ,
    -
    640 // pstrUsageChannelCenter ,
    -
    641 // pstrUsageChannelFront ,
    -
    642 // pstrUsageChannelCenterFront ,
    -
    643 // pstrUsageChannelSide ,
    -
    644 // pstrUsageChannelSurround ,
    -
    645 // pstrUsageChannelLowFreqEnhancement ,
    -
    646 // pstrUsageChannelTop ,
    -
    647 // pstrUsageChannelUnknown
    -
    648 //};
    -
    649 //const char *consTitlesC[] PROGMEM =
    -
    650 //{
    -
    651 // pstrUsageSubChannel ,
    -
    652 // pstrUsageSubChannelIncrement ,
    -
    653 // pstrUsageSubChannelDecrement ,
    -
    654 // pstrUsageAlternateAudioIncrement ,
    -
    655 // pstrUsageAlternateAudioDecrement
    -
    656 //};
    -
    657 //const char *consTitlesD[] PROGMEM =
    -
    658 //{
    -
    659 // pstrUsageApplicationLaunchButtons ,
    -
    660 // pstrUsageALLaunchButtonConfigTool ,
    -
    661 // pstrUsageALProgrammableButton ,
    -
    662 // pstrUsageALConsumerControlConfig ,
    -
    663 // pstrUsageALWordProcessor ,
    -
    664 // pstrUsageALTextEditor ,
    -
    665 // pstrUsageALSpreadsheet ,
    -
    666 // pstrUsageALGraphicsEditor ,
    -
    667 // pstrUsageALPresentationApp ,
    -
    668 // pstrUsageALDatabaseApp ,
    -
    669 // pstrUsageALEmailReader ,
    -
    670 // pstrUsageALNewsreader ,
    -
    671 // pstrUsageALVoicemail ,
    -
    672 // pstrUsageALContactsAddressBook ,
    -
    673 // pstrUsageALCalendarSchedule ,
    -
    674 // pstrUsageALTaskProjectManager ,
    -
    675 // pstrUsageALLogJournalTimecard ,
    -
    676 // pstrUsageALCheckbookFinance ,
    -
    677 // pstrUsageALCalculator ,
    -
    678 // pstrUsageALAVCapturePlayback ,
    -
    679 // pstrUsageALLocalMachineBrowser ,
    -
    680 // pstrUsageALLANWANBrow ,
    -
    681 // pstrUsageALInternetBrowser ,
    -
    682 // pstrUsageALRemoteNetISPConnect ,
    -
    683 // pstrUsageALNetworkConference ,
    -
    684 // pstrUsageALNetworkChat ,
    -
    685 // pstrUsageALTelephonyDialer ,
    -
    686 // pstrUsageALLogon ,
    -
    687 // pstrUsageALLogoff ,
    -
    688 // pstrUsageALLogonLogoff ,
    -
    689 // pstrUsageALTermLockScrSav ,
    -
    690 // pstrUsageALControlPannel ,
    -
    691 // pstrUsageALCommandLineProcessorRun ,
    -
    692 // pstrUsageALProcessTaskManager ,
    -
    693 // pstrUsageALSelectTaskApplication ,
    -
    694 // pstrUsageALNextTaskApplication ,
    -
    695 // pstrUsageALPreviousTaskApplication ,
    -
    696 // pstrUsageALPreemptiveHaltTaskApp ,
    -
    697 // pstrUsageALIntegratedHelpCenter ,
    -
    698 // pstrUsageALDocuments ,
    -
    699 // pstrUsageALThesaurus ,
    -
    700 // pstrUsageALDictionary ,
    -
    701 // pstrUsageALDesktop ,
    -
    702 // pstrUsageALSpellCheck ,
    -
    703 // pstrUsageALGrammarCheck ,
    -
    704 // pstrUsageALWirelessStatus ,
    -
    705 // pstrUsageALKeyboardLayout ,
    -
    706 // pstrUsageALVirusProtection ,
    -
    707 // pstrUsageALEncryption ,
    -
    708 // pstrUsageALScreenSaver ,
    -
    709 // pstrUsageALAlarms ,
    -
    710 // pstrUsageALClock ,
    -
    711 // pstrUsageALFileBrowser ,
    -
    712 // pstrUsageALPowerStatus ,
    -
    713 // pstrUsageALImageBrowser ,
    -
    714 // pstrUsageALAudioBrowser ,
    -
    715 // pstrUsageALMovieBrowser ,
    -
    716 // pstrUsageALDigitalRightsManager ,
    -
    717 // pstrUsageALDigitalWallet ,
    -
    718 // pstrUsagePageReserved ,
    -
    719 // pstrUsageALInstantMessaging ,
    -
    720 // pstrUsageALOEMFeaturesBrowser ,
    -
    721 // pstrUsageALOEMHelp ,
    -
    722 // pstrUsageALOnlineCommunity ,
    -
    723 // pstrUsageALEntertainmentContentBrow ,
    -
    724 // pstrUsageALOnlineShoppingBrowser ,
    -
    725 // pstrUsageALSmartCardInfoHelp ,
    -
    726 // pstrUsageALMarketMonitorFinBrowser ,
    -
    727 // pstrUsageALCustomCorpNewsBrowser ,
    -
    728 // pstrUsageALOnlineActivityBrowser ,
    -
    729 // pstrUsageALResearchSearchBrowser ,
    -
    730 // pstrUsageALAudioPlayer
    -
    731 //};
    -
    732 //const char *consTitlesE[] PROGMEM =
    -
    733 //{
    -
    734 // pstrUsageGenericGUIAppControls ,
    -
    735 // pstrUsageACNew ,
    -
    736 // pstrUsageACOpen ,
    -
    737 // pstrUsageACClose ,
    -
    738 // pstrUsageACExit ,
    -
    739 // pstrUsageACMaximize ,
    -
    740 // pstrUsageACMinimize ,
    -
    741 // pstrUsageACSave ,
    -
    742 // pstrUsageACPrint ,
    -
    743 // pstrUsageACProperties ,
    -
    744 // pstrUsageACUndo ,
    -
    745 // pstrUsageACCopy ,
    -
    746 // pstrUsageACCut ,
    -
    747 // pstrUsageACPaste ,
    -
    748 // pstrUsageACSelectAll ,
    -
    749 // pstrUsageACFind ,
    -
    750 // pstrUsageACFindAndReplace ,
    -
    751 // pstrUsageACSearch ,
    -
    752 // pstrUsageACGoto ,
    -
    753 // pstrUsageACHome ,
    -
    754 // pstrUsageACBack ,
    -
    755 // pstrUsageACForward ,
    -
    756 // pstrUsageACStop ,
    -
    757 // pstrUsageACRefresh ,
    -
    758 // pstrUsageACPreviousLink ,
    -
    759 // pstrUsageACNextLink ,
    -
    760 // pstrUsageACBookmarks ,
    -
    761 // pstrUsageACHistory ,
    -
    762 // pstrUsageACSubscriptions ,
    -
    763 // pstrUsageACZoomIn ,
    -
    764 // pstrUsageACZoomOut ,
    -
    765 // pstrUsageACZoom ,
    -
    766 // pstrUsageACFullScreenView ,
    -
    767 // pstrUsageACNormalView ,
    -
    768 // pstrUsageACViewToggle ,
    -
    769 // pstrUsageACScrollUp ,
    -
    770 // pstrUsageACScrollDown ,
    -
    771 // pstrUsageACScroll ,
    -
    772 // pstrUsageACPanLeft ,
    -
    773 // pstrUsageACPanRight ,
    -
    774 // pstrUsageACPan ,
    -
    775 // pstrUsageACNewWindow ,
    -
    776 // pstrUsageACTileHoriz ,
    -
    777 // pstrUsageACTileVert ,
    -
    778 // pstrUsageACFormat ,
    -
    779 // pstrUsageACEdit ,
    -
    780 // pstrUsageACBold ,
    -
    781 // pstrUsageACItalics ,
    -
    782 // pstrUsageACUnderline ,
    -
    783 // pstrUsageACStrikethrough ,
    -
    784 // pstrUsageACSubscript ,
    -
    785 // pstrUsageACSuperscript ,
    -
    786 // pstrUsageACAllCaps ,
    -
    787 // pstrUsageACRotate ,
    -
    788 // pstrUsageACResize ,
    -
    789 // pstrUsageACFlipHorizontal ,
    -
    790 // pstrUsageACFlipVertical ,
    -
    791 // pstrUsageACMirrorHorizontal ,
    -
    792 // pstrUsageACMirrorVertical ,
    -
    793 // pstrUsageACFontSelect ,
    -
    794 // pstrUsageACFontColor ,
    -
    795 // pstrUsageACFontSize ,
    -
    796 // pstrUsageACJustifyLeft ,
    -
    797 // pstrUsageACJustifyCenterH ,
    -
    798 // pstrUsageACJustifyRight ,
    -
    799 // pstrUsageACJustifyBlockH ,
    -
    800 // pstrUsageACJustifyTop ,
    -
    801 // pstrUsageACJustifyCenterV ,
    -
    802 // pstrUsageACJustifyBottom ,
    -
    803 // pstrUsageACJustifyBlockV ,
    -
    804 // pstrUsageACIndentDecrease ,
    -
    805 // pstrUsageACIndentIncrease ,
    -
    806 // pstrUsageACNumberedList ,
    -
    807 // pstrUsageACRestartNumbering ,
    -
    808 // pstrUsageACBulletedList ,
    -
    809 // pstrUsageACPromote ,
    -
    810 // pstrUsageACDemote ,
    -
    811 // pstrUsageACYes ,
    -
    812 // pstrUsageACNo ,
    -
    813 // pstrUsageACCancel ,
    -
    814 // pstrUsageACCatalog ,
    -
    815 // pstrUsageACBuyChkout ,
    -
    816 // pstrUsageACAddToCart ,
    -
    817 // pstrUsageACExpand ,
    -
    818 // pstrUsageACExpandAll ,
    -
    819 // pstrUsageACCollapse ,
    -
    820 // pstrUsageACCollapseAll ,
    -
    821 // pstrUsageACPrintPreview ,
    -
    822 // pstrUsageACPasteSpecial ,
    -
    823 // pstrUsageACInsertMode ,
    -
    824 // pstrUsageACDelete ,
    -
    825 // pstrUsageACLock ,
    -
    826 // pstrUsageACUnlock ,
    -
    827 // pstrUsageACProtect ,
    -
    828 // pstrUsageACUnprotect ,
    -
    829 // pstrUsageACAttachComment ,
    -
    830 // pstrUsageACDeleteComment ,
    -
    831 // pstrUsageACViewComment ,
    -
    832 // pstrUsageACSelectWord ,
    -
    833 // pstrUsageACSelectSentence ,
    -
    834 // pstrUsageACSelectParagraph ,
    -
    835 // pstrUsageACSelectColumn ,
    -
    836 // pstrUsageACSelectRow ,
    -
    837 // pstrUsageACSelectTable ,
    -
    838 // pstrUsageACSelectObject ,
    -
    839 // pstrUsageACRedoRepeat ,
    -
    840 // pstrUsageACSort ,
    -
    841 // pstrUsageACSortAscending ,
    -
    842 // pstrUsageACSortDescending ,
    -
    843 // pstrUsageACFilter ,
    -
    844 // pstrUsageACSetClock ,
    -
    845 // pstrUsageACViewClock ,
    -
    846 // pstrUsageACSelectTimeZone ,
    -
    847 // pstrUsageACEditTimeZone ,
    -
    848 // pstrUsageACSetAlarm ,
    -
    849 // pstrUsageACClearAlarm ,
    -
    850 // pstrUsageACSnoozeAlarm ,
    -
    851 // pstrUsageACResetAlarm ,
    -
    852 // pstrUsageACSyncronize ,
    -
    853 // pstrUsageACSendReceive ,
    -
    854 // pstrUsageACSendTo ,
    -
    855 // pstrUsageACReply ,
    -
    856 // pstrUsageACReplyAll ,
    -
    857 // pstrUsageACForwardMessage ,
    -
    858 // pstrUsageACSend ,
    -
    859 // pstrUsageACAttachFile ,
    -
    860 // pstrUsageACUpload ,
    -
    861 // pstrUsageACDownload ,
    -
    862 // pstrUsageACSetBorders ,
    -
    863 // pstrUsageACInsertRow ,
    -
    864 // pstrUsageACInsertColumn ,
    -
    865 // pstrUsageACInsertFile ,
    -
    866 // pstrUsageACInsertPicture ,
    -
    867 // pstrUsageACInsertObject ,
    -
    868 // pstrUsageACInsertSymbol ,
    -
    869 // pstrUsageACSaveAndClose ,
    -
    870 // pstrUsageACRename ,
    -
    871 // pstrUsageACMerge ,
    -
    872 // pstrUsageACSplit ,
    -
    873 // pstrUsageACDistributeHorizontaly ,
    -
    874 // pstrUsageACDistributeVerticaly
    -
    875 //};
    -
    876 //const char *digitTitles0[] PROGMEM =
    -
    877 //{
    -
    878 // pstrUsageDigitizer ,
    -
    879 // pstrUsagePen ,
    -
    880 // pstrUsageLightPen ,
    -
    881 // pstrUsageTouchScreen ,
    -
    882 // pstrUsageTouchPad ,
    -
    883 // pstrUsageWhiteBoard ,
    -
    884 // pstrUsageCoordinateMeasuringMachine ,
    -
    885 // pstrUsage3DDigitizer ,
    -
    886 // pstrUsageStereoPlotter ,
    -
    887 // pstrUsageArticulatedArm ,
    -
    888 // pstrUsageArmature ,
    -
    889 // pstrUsageMultiplePointDigitizer ,
    -
    890 // pstrUsageFreeSpaceWand
    -
    891 //};
    -
    892 //const char *digitTitles1[] PROGMEM =
    -
    893 //{
    -
    894 // pstrUsageStylus ,
    -
    895 // pstrUsagePuck ,
    -
    896 // pstrUsageFinger
    -
    897 //
    -
    898 //};
    -
    899 //const char *digitTitles2[] PROGMEM =
    -
    900 //{
    -
    901 // pstrUsageTipPressure ,
    -
    902 // pstrUsageBarrelPressure ,
    -
    903 // pstrUsageInRange ,
    -
    904 // pstrUsageTouch ,
    -
    905 // pstrUsageUntouch ,
    -
    906 // pstrUsageTap ,
    -
    907 // pstrUsageQuality ,
    -
    908 // pstrUsageDataValid ,
    -
    909 // pstrUsageTransducerIndex ,
    -
    910 // pstrUsageTabletFunctionKeys ,
    -
    911 // pstrUsageProgramChangeKeys ,
    -
    912 // pstrUsageBatteryStrength ,
    -
    913 // pstrUsageInvert ,
    -
    914 // pstrUsageXTilt ,
    -
    915 // pstrUsageYTilt ,
    -
    916 // pstrUsageAzimuth ,
    -
    917 // pstrUsageAltitude ,
    -
    918 // pstrUsageTwist ,
    -
    919 // pstrUsageTipSwitch ,
    -
    920 // pstrUsageSecondaryTipSwitch ,
    -
    921 // pstrUsageBarrelSwitch ,
    -
    922 // pstrUsageEraser ,
    -
    923 // pstrUsageTabletPick
    -
    924 //};
    -
    925 //const char *aplphanumTitles0[] PROGMEM =
    -
    926 //{
    -
    927 // pstrUsageAlphanumericDisplay,
    -
    928 // pstrUsageBitmappedDisplay
    -
    929 //};
    -
    930 //const char *aplphanumTitles1[] PROGMEM =
    -
    931 //{
    -
    932 // pstrUsageDisplayAttributesReport ,
    -
    933 // pstrUsageASCIICharacterSet ,
    -
    934 // pstrUsageDataReadBack ,
    -
    935 // pstrUsageFontReadBack ,
    -
    936 // pstrUsageDisplayControlReport ,
    -
    937 // pstrUsageClearDisplay ,
    -
    938 // pstrUsageDisplayEnable ,
    -
    939 // pstrUsageScreenSaverDelay ,
    -
    940 // pstrUsageScreenSaverEnable ,
    -
    941 // pstrUsageVerticalScroll ,
    -
    942 // pstrUsageHorizontalScroll ,
    -
    943 // pstrUsageCharacterReport ,
    -
    944 // pstrUsageDisplayData ,
    -
    945 // pstrUsageDisplayStatus ,
    -
    946 // pstrUsageStatusNotReady ,
    -
    947 // pstrUsageStatusReady ,
    -
    948 // pstrUsageErrorNotALoadableCharacter ,
    -
    949 // pstrUsageErrorFotDataCanNotBeRead ,
    -
    950 // pstrUsageCursorPositionReport ,
    -
    951 // pstrUsageRow ,
    -
    952 // pstrUsageColumn ,
    -
    953 // pstrUsageRows ,
    -
    954 // pstrUsageColumns ,
    -
    955 // pstrUsageCursorPixelPosition ,
    -
    956 // pstrUsageCursorMode ,
    -
    957 // pstrUsageCursorEnable ,
    -
    958 // pstrUsageCursorBlink ,
    -
    959 // pstrUsageFontReport ,
    -
    960 // pstrUsageFontData ,
    -
    961 // pstrUsageCharacterWidth ,
    -
    962 // pstrUsageCharacterHeight ,
    -
    963 // pstrUsageCharacterSpacingHorizontal ,
    -
    964 // pstrUsageCharacterSpacingVertical ,
    -
    965 // pstrUsageUnicodeCharset ,
    -
    966 // pstrUsageFont7Segment ,
    -
    967 // pstrUsage7SegmentDirectMap ,
    -
    968 // pstrUsageFont14Segment ,
    -
    969 // pstrUsage14SegmentDirectMap ,
    -
    970 // pstrUsageDisplayBrightness ,
    -
    971 // pstrUsageDisplayContrast ,
    -
    972 // pstrUsageCharacterAttribute ,
    -
    973 // pstrUsageAttributeReadback ,
    -
    974 // pstrUsageAttributeData ,
    -
    975 // pstrUsageCharAttributeEnhance ,
    -
    976 // pstrUsageCharAttributeUnderline ,
    -
    977 // pstrUsageCharAttributeBlink
    -
    978 //};
    -
    979 //const char *aplphanumTitles2[] PROGMEM =
    -
    980 //{
    -
    981 // pstrUsageBitmapSizeX ,
    -
    982 // pstrUsageBitmapSizeY ,
    -
    983 // pstrUsagePageReserved ,
    -
    984 // pstrUsageBitDepthFormat ,
    -
    985 // pstrUsageDisplayOrientation ,
    -
    986 // pstrUsagePaletteReport ,
    -
    987 // pstrUsagePaletteDataSize ,
    -
    988 // pstrUsagePaletteDataOffset ,
    -
    989 // pstrUsagePaletteData ,
    -
    990 // pstrUsageBlitReport ,
    -
    991 // pstrUsageBlitRectangleX1 ,
    -
    992 // pstrUsageBlitRectangleY1 ,
    -
    993 // pstrUsageBlitRectangleX2 ,
    -
    994 // pstrUsageBlitRectangleY2 ,
    -
    995 // pstrUsageBlitData ,
    -
    996 // pstrUsageSoftButton ,
    -
    997 // pstrUsageSoftButtonID ,
    -
    998 // pstrUsageSoftButtonSide ,
    -
    999 // pstrUsageSoftButtonOffset1 ,
    -
    1000 // pstrUsageSoftButtonOffset2 ,
    -
    1001 // pstrUsageSoftButtonReport
    -
    1002 //};
    -
    1003 //const char *medInstrTitles0[] PROGMEM =
    -
    1004 //{
    -
    1005 // pstrUsageVCRAcquisition ,
    -
    1006 // pstrUsageFreezeThaw ,
    -
    1007 // pstrUsageClipStore ,
    -
    1008 // pstrUsageUpdate ,
    -
    1009 // pstrUsageNext ,
    -
    1010 // pstrUsageSave ,
    -
    1011 // pstrUsagePrint ,
    -
    1012 // pstrUsageMicrophoneEnable
    -
    1013 //};
    -
    1014 //const char *medInstrTitles1[] PROGMEM =
    -
    1015 //{
    -
    1016 // pstrUsageCine ,
    -
    1017 // pstrUsageTransmitPower ,
    -
    1018 // pstrUsageVolume ,
    -
    1019 // pstrUsageFocus ,
    -
    1020 // pstrUsageDepth
    -
    1021 //};
    -
    1022 //const char *medInstrTitles2[] PROGMEM =
    -
    1023 //{
    -
    1024 // pstrUsageSoftStepPrimary ,
    -
    1025 // pstrUsageSoftStepSecondary
    -
    1026 //};
    -
    1027 //const char *medInstrTitles3[] PROGMEM =
    -
    1028 //{
    -
    1029 // pstrUsageZoomSelect ,
    -
    1030 // pstrUsageZoomAdjust ,
    -
    1031 // pstrUsageSpectralDopplerModeSelect ,
    -
    1032 // pstrUsageSpectralDopplerModeAdjust ,
    -
    1033 // pstrUsageColorDopplerModeSelect ,
    -
    1034 // pstrUsageColorDopplerModeAdjust ,
    -
    1035 // pstrUsageMotionModeSelect ,
    -
    1036 // pstrUsageMotionModeAdjust ,
    -
    1037 // pstrUsage2DModeSelect ,
    -
    1038 // pstrUsage2DModeAdjust
    -
    1039 //};
    -
    1040 //const char *medInstrTitles4[] PROGMEM =
    -
    1041 //{
    -
    1042 // pstrUsageSoftControlSelect ,
    -
    1043 // pstrUsageSoftControlAdjust
    -
    1044 //};
    -
    1045 
    -
    1046 #endif // __HIDUSAGETITLEARRAYS_H__
    +
    22 // This is here why?
    +
    23 
    +
    24 //const char *usagePageTitles0[] PROGMEM =
    +
    25 //{
    +
    26 // pstrUsagePageGenericDesktopControls ,
    +
    27 // pstrUsagePageSimulationControls ,
    +
    28 // pstrUsagePageVRControls ,
    +
    29 // pstrUsagePageSportControls ,
    +
    30 // pstrUsagePageGameControls ,
    +
    31 // pstrUsagePageGenericDeviceControls ,
    +
    32 // pstrUsagePageKeyboardKeypad ,
    +
    33 // pstrUsagePageLEDs ,
    +
    34 // pstrUsagePageButton ,
    +
    35 // pstrUsagePageOrdinal ,
    +
    36 // pstrUsagePageTelephone ,
    +
    37 // pstrUsagePageConsumer ,
    +
    38 // pstrUsagePageDigitizer ,
    +
    39 // pstrUsagePagePID ,
    +
    40 // pstrUsagePageUnicode
    +
    41 //};
    +
    42 //
    +
    43 //const char *usagePageTitles1[] PROGMEM =
    +
    44 //{
    +
    45 // pstrUsagePageBarCodeScanner ,
    +
    46 // pstrUsagePageScale ,
    +
    47 // pstrUsagePageMSRDevices ,
    +
    48 // pstrUsagePagePointOfSale ,
    +
    49 // pstrUsagePageCameraControl ,
    +
    50 // pstrUsagePageArcade
    +
    51 //};
    +
    52 //const char *genDesktopTitles0[] PROGMEM =
    +
    53 //{
    +
    54 // pstrUsagePointer ,
    +
    55 // pstrUsageMouse ,
    +
    56 // pstrUsageJoystick ,
    +
    57 // pstrUsageGamePad ,
    +
    58 // pstrUsageKeyboard ,
    +
    59 // pstrUsageKeypad ,
    +
    60 // pstrUsageMultiAxisController ,
    +
    61 // pstrUsageTabletPCSystemControls
    +
    62 //
    +
    63 //};
    +
    64 //const char *genDesktopTitles1[] PROGMEM =
    +
    65 //{
    +
    66 // pstrUsageX ,
    +
    67 // pstrUsageY ,
    +
    68 // pstrUsageZ ,
    +
    69 // pstrUsageRx ,
    +
    70 // pstrUsageRy ,
    +
    71 // pstrUsageRz ,
    +
    72 // pstrUsageSlider ,
    +
    73 // pstrUsageDial ,
    +
    74 // pstrUsageWheel ,
    +
    75 // pstrUsageHatSwitch ,
    +
    76 // pstrUsageCountedBuffer ,
    +
    77 // pstrUsageByteCount ,
    +
    78 // pstrUsageMotionWakeup ,
    +
    79 // pstrUsageStart ,
    +
    80 // pstrUsageSelect ,
    +
    81 // pstrUsagePageReserved ,
    +
    82 // pstrUsageVx ,
    +
    83 // pstrUsageVy ,
    +
    84 // pstrUsageVz ,
    +
    85 // pstrUsageVbrx ,
    +
    86 // pstrUsageVbry ,
    +
    87 // pstrUsageVbrz ,
    +
    88 // pstrUsageVno ,
    +
    89 // pstrUsageFeatureNotification ,
    +
    90 // pstrUsageResolutionMultiplier
    +
    91 //};
    +
    92 //const char *genDesktopTitles2[] PROGMEM =
    +
    93 //{
    +
    94 // pstrUsageSystemControl ,
    +
    95 // pstrUsageSystemPowerDown ,
    +
    96 // pstrUsageSystemSleep ,
    +
    97 // pstrUsageSystemWakeup ,
    +
    98 // pstrUsageSystemContextMenu ,
    +
    99 // pstrUsageSystemMainMenu ,
    +
    100 // pstrUsageSystemAppMenu ,
    +
    101 // pstrUsageSystemMenuHelp ,
    +
    102 // pstrUsageSystemMenuExit ,
    +
    103 // pstrUsageSystemMenuSelect ,
    +
    104 // pstrUsageSystemMenuRight ,
    +
    105 // pstrUsageSystemMenuLeft ,
    +
    106 // pstrUsageSystemMenuUp ,
    +
    107 // pstrUsageSystemMenuDown ,
    +
    108 // pstrUsageSystemColdRestart ,
    +
    109 // pstrUsageSystemWarmRestart ,
    +
    110 // pstrUsageDPadUp ,
    +
    111 // pstrUsageDPadDown ,
    +
    112 // pstrUsageDPadRight ,
    +
    113 // pstrUsageDPadLeft
    +
    114 //};
    +
    115 //const char *genDesktopTitles3[] PROGMEM =
    +
    116 //{
    +
    117 // pstrUsageSystemDock ,
    +
    118 // pstrUsageSystemUndock ,
    +
    119 // pstrUsageSystemSetup ,
    +
    120 // pstrUsageSystemBreak ,
    +
    121 // pstrUsageSystemDebuggerBreak ,
    +
    122 // pstrUsageApplicationBreak ,
    +
    123 // pstrUsageApplicationDebuggerBreak,
    +
    124 // pstrUsageSystemSpeakerMute ,
    +
    125 // pstrUsageSystemHibernate
    +
    126 //};
    +
    127 //const char *genDesktopTitles4[] PROGMEM =
    +
    128 //{
    +
    129 // pstrUsageSystemDisplayInvert ,
    +
    130 // pstrUsageSystemDisplayInternal ,
    +
    131 // pstrUsageSystemDisplayExternal ,
    +
    132 // pstrUsageSystemDisplayBoth ,
    +
    133 // pstrUsageSystemDisplayDual ,
    +
    134 // pstrUsageSystemDisplayToggleIntExt ,
    +
    135 // pstrUsageSystemDisplaySwapPriSec ,
    +
    136 // pstrUsageSystemDisplayLCDAutoscale
    +
    137 //};
    +
    138 //const char *simuTitles0[] PROGMEM =
    +
    139 //{
    +
    140 // pstrUsageFlightSimulationDevice ,
    +
    141 // pstrUsageAutomobileSimulationDevice ,
    +
    142 // pstrUsageTankSimulationDevice ,
    +
    143 // pstrUsageSpaceshipSimulationDevice ,
    +
    144 // pstrUsageSubmarineSimulationDevice ,
    +
    145 // pstrUsageSailingSimulationDevice ,
    +
    146 // pstrUsageMotocicleSimulationDevice ,
    +
    147 // pstrUsageSportsSimulationDevice ,
    +
    148 // pstrUsageAirplaneSimulationDevice ,
    +
    149 // pstrUsageHelicopterSimulationDevice ,
    +
    150 // pstrUsageMagicCarpetSimulationDevice,
    +
    151 // pstrUsageBicycleSimulationDevice
    +
    152 //};
    +
    153 //const char *simuTitles1[] PROGMEM =
    +
    154 //{
    +
    155 // pstrUsageFlightControlStick ,
    +
    156 // pstrUsageFlightStick ,
    +
    157 // pstrUsageCyclicControl ,
    +
    158 // pstrUsageCyclicTrim ,
    +
    159 // pstrUsageFlightYoke ,
    +
    160 // pstrUsageTrackControl
    +
    161 //};
    +
    162 //const char *simuTitles2[] PROGMEM =
    +
    163 //{
    +
    164 // pstrUsageAileron ,
    +
    165 // pstrUsageAileronTrim ,
    +
    166 // pstrUsageAntiTorqueControl ,
    +
    167 // pstrUsageAutopilotEnable ,
    +
    168 // pstrUsageChaffRelease ,
    +
    169 // pstrUsageCollectiveControl ,
    +
    170 // pstrUsageDiveBrake ,
    +
    171 // pstrUsageElectronicCountermeasures ,
    +
    172 // pstrUsageElevator ,
    +
    173 // pstrUsageElevatorTrim ,
    +
    174 // pstrUsageRudder ,
    +
    175 // pstrUsageThrottle ,
    +
    176 // pstrUsageFlightCommunications ,
    +
    177 // pstrUsageFlareRelease ,
    +
    178 // pstrUsageLandingGear ,
    +
    179 // pstrUsageToeBrake ,
    +
    180 // pstrUsageTrigger ,
    +
    181 // pstrUsageWeaponsArm ,
    +
    182 // pstrUsageWeaponsSelect ,
    +
    183 // pstrUsageWingFlaps ,
    +
    184 // pstrUsageAccelerator ,
    +
    185 // pstrUsageBrake ,
    +
    186 // pstrUsageClutch ,
    +
    187 // pstrUsageShifter ,
    +
    188 // pstrUsageSteering ,
    +
    189 // pstrUsageTurretDirection ,
    +
    190 // pstrUsageBarrelElevation ,
    +
    191 // pstrUsageDivePlane ,
    +
    192 // pstrUsageBallast ,
    +
    193 // pstrUsageBicycleCrank ,
    +
    194 // pstrUsageHandleBars ,
    +
    195 // pstrUsageFrontBrake ,
    +
    196 // pstrUsageRearBrake
    +
    197 //};
    +
    198 //const char *vrTitles0[] PROGMEM =
    +
    199 //{
    +
    200 // pstrUsageBelt ,
    +
    201 // pstrUsageBodySuit ,
    +
    202 // pstrUsageFlexor ,
    +
    203 // pstrUsageGlove ,
    +
    204 // pstrUsageHeadTracker ,
    +
    205 // pstrUsageHeadMountedDisplay ,
    +
    206 // pstrUsageHandTracker ,
    +
    207 // pstrUsageOculometer ,
    +
    208 // pstrUsageVest ,
    +
    209 // pstrUsageAnimatronicDevice
    +
    210 //};
    +
    211 //const char *vrTitles1[] PROGMEM =
    +
    212 //{
    +
    213 // pstrUsageStereoEnable ,
    +
    214 // pstrUsageDisplayEnable
    +
    215 //};
    +
    216 //const char *sportsCtrlTitles0[] PROGMEM =
    +
    217 //{
    +
    218 // pstrUsageBaseballBat ,
    +
    219 // pstrUsageGolfClub ,
    +
    220 // pstrUsageRowingMachine ,
    +
    221 // pstrUsageTreadmill
    +
    222 //};
    +
    223 //const char *sportsCtrlTitles1[] PROGMEM =
    +
    224 //{
    +
    225 // pstrUsageOar ,
    +
    226 // pstrUsageSlope ,
    +
    227 // pstrUsageRate ,
    +
    228 // pstrUsageStickSpeed ,
    +
    229 // pstrUsageStickFaceAngle ,
    +
    230 // pstrUsageStickHeelToe ,
    +
    231 // pstrUsageStickFollowThough ,
    +
    232 // pstrUsageStickTempo ,
    +
    233 // pstrUsageStickType ,
    +
    234 // pstrUsageStickHeight
    +
    235 //};
    +
    236 //const char *sportsCtrlTitles2[] PROGMEM =
    +
    237 //{
    +
    238 // pstrUsagePutter ,
    +
    239 // pstrUsage1Iron ,
    +
    240 // pstrUsage2Iron ,
    +
    241 // pstrUsage3Iron ,
    +
    242 // pstrUsage4Iron ,
    +
    243 // pstrUsage5Iron ,
    +
    244 // pstrUsage6Iron ,
    +
    245 // pstrUsage7Iron ,
    +
    246 // pstrUsage8Iron ,
    +
    247 // pstrUsage9Iron ,
    +
    248 // pstrUsage10Iron ,
    +
    249 // pstrUsage11Iron ,
    +
    250 // pstrUsageSandWedge ,
    +
    251 // pstrUsageLoftWedge ,
    +
    252 // pstrUsagePowerWedge ,
    +
    253 // pstrUsage1Wood ,
    +
    254 // pstrUsage3Wood ,
    +
    255 // pstrUsage5Wood ,
    +
    256 // pstrUsage7Wood ,
    +
    257 // pstrUsage9Wood
    +
    258 //};
    +
    259 //const char *gameTitles0[] PROGMEM =
    +
    260 //{
    +
    261 // pstrUsage3DGameController ,
    +
    262 // pstrUsagePinballDevice ,
    +
    263 // pstrUsageGunDevice
    +
    264 //};
    +
    265 //const char *gameTitles1[] PROGMEM =
    +
    266 //{
    +
    267 // pstrUsagePointOfView ,
    +
    268 // pstrUsageTurnRightLeft ,
    +
    269 // pstrUsagePitchForwardBackward ,
    +
    270 // pstrUsageRollRightLeft ,
    +
    271 // pstrUsageMoveRightLeft ,
    +
    272 // pstrUsageMoveForwardBackward ,
    +
    273 // pstrUsageMoveUpDown ,
    +
    274 // pstrUsageLeanRightLeft ,
    +
    275 // pstrUsageLeanForwardBackward ,
    +
    276 // pstrUsageHeightOfPOV ,
    +
    277 // pstrUsageFlipper ,
    +
    278 // pstrUsageSecondaryFlipper ,
    +
    279 // pstrUsageBump ,
    +
    280 // pstrUsageNewGame ,
    +
    281 // pstrUsageShootBall ,
    +
    282 // pstrUsagePlayer ,
    +
    283 // pstrUsageGunBolt ,
    +
    284 // pstrUsageGunClip ,
    +
    285 // pstrUsageGunSelector ,
    +
    286 // pstrUsageGunSingleShot ,
    +
    287 // pstrUsageGunBurst ,
    +
    288 // pstrUsageGunAutomatic ,
    +
    289 // pstrUsageGunSafety ,
    +
    290 // pstrUsageGamepadFireJump ,
    +
    291 // pstrUsageGamepadTrigger
    +
    292 //};
    +
    293 //const char *genDevCtrlTitles[] PROGMEM =
    +
    294 //{
    +
    295 // pstrUsageBatteryStrength,
    +
    296 // pstrUsageWirelessChannel,
    +
    297 // pstrUsageWirelessID,
    +
    298 // pstrUsageDiscoverWirelessControl,
    +
    299 // pstrUsageSecurityCodeCharEntered,
    +
    300 // pstrUsageSecurityCodeCharErased,
    +
    301 // pstrUsageSecurityCodeCleared
    +
    302 //};
    +
    303 //const char *ledTitles[] PROGMEM =
    +
    304 //{
    +
    305 // pstrUsageNumLock ,
    +
    306 // pstrUsageCapsLock ,
    +
    307 // pstrUsageScrollLock ,
    +
    308 // pstrUsageCompose ,
    +
    309 // pstrUsageKana ,
    +
    310 // pstrUsagePower ,
    +
    311 // pstrUsageShift ,
    +
    312 // pstrUsageDoNotDisturb ,
    +
    313 // pstrUsageMute ,
    +
    314 // pstrUsageToneEnable ,
    +
    315 // pstrUsageHighCutFilter ,
    +
    316 // pstrUsageLowCutFilter ,
    +
    317 // pstrUsageEqualizerEnable ,
    +
    318 // pstrUsageSoundFieldOn ,
    +
    319 // pstrUsageSurroundOn ,
    +
    320 // pstrUsageRepeat ,
    +
    321 // pstrUsageStereo ,
    +
    322 // pstrUsageSamplingRateDetect ,
    +
    323 // pstrUsageSpinning ,
    +
    324 // pstrUsageCAV ,
    +
    325 // pstrUsageCLV ,
    +
    326 // pstrUsageRecordingFormatDetect ,
    +
    327 // pstrUsageOffHook ,
    +
    328 // pstrUsageRing ,
    +
    329 // pstrUsageMessageWaiting ,
    +
    330 // pstrUsageDataMode ,
    +
    331 // pstrUsageBatteryOperation ,
    +
    332 // pstrUsageBatteryOK ,
    +
    333 // pstrUsageBatteryLow ,
    +
    334 // pstrUsageSpeaker ,
    +
    335 // pstrUsageHeadSet ,
    +
    336 // pstrUsageHold ,
    +
    337 // pstrUsageMicrophone ,
    +
    338 // pstrUsageCoverage ,
    +
    339 // pstrUsageNightMode ,
    +
    340 // pstrUsageSendCalls ,
    +
    341 // pstrUsageCallPickup ,
    +
    342 // pstrUsageConference ,
    +
    343 // pstrUsageStandBy ,
    +
    344 // pstrUsageCameraOn ,
    +
    345 // pstrUsageCameraOff ,
    +
    346 // pstrUsageOnLine ,
    +
    347 // pstrUsageOffLine ,
    +
    348 // pstrUsageBusy ,
    +
    349 // pstrUsageReady ,
    +
    350 // pstrUsagePaperOut ,
    +
    351 // pstrUsagePaperJam ,
    +
    352 // pstrUsageRemote ,
    +
    353 // pstrUsageForward ,
    +
    354 // pstrUsageReverse ,
    +
    355 // pstrUsageStop ,
    +
    356 // pstrUsageRewind ,
    +
    357 // pstrUsageFastForward ,
    +
    358 // pstrUsagePlay ,
    +
    359 // pstrUsagePause ,
    +
    360 // pstrUsageRecord ,
    +
    361 // pstrUsageError ,
    +
    362 // pstrUsageSelectedIndicator ,
    +
    363 // pstrUsageInUseIndicator ,
    +
    364 // pstrUsageMultiModeIndicator ,
    +
    365 // pstrUsageIndicatorOn ,
    +
    366 // pstrUsageIndicatorFlash ,
    +
    367 // pstrUsageIndicatorSlowBlink ,
    +
    368 // pstrUsageIndicatorFastBlink ,
    +
    369 // pstrUsageIndicatorOff ,
    +
    370 // pstrUsageFlashOnTime ,
    +
    371 // pstrUsageSlowBlinkOnTime ,
    +
    372 // pstrUsageSlowBlinkOffTime ,
    +
    373 // pstrUsageFastBlinkOnTime ,
    +
    374 // pstrUsageFastBlinkOffTime ,
    +
    375 // pstrUsageIndicatorColor ,
    +
    376 // pstrUsageIndicatorRed ,
    +
    377 // pstrUsageIndicatorGreen ,
    +
    378 // pstrUsageIndicatorAmber ,
    +
    379 // pstrUsageGenericIndicator ,
    +
    380 // pstrUsageSystemSuspend ,
    +
    381 // pstrUsageExternalPowerConnected
    +
    382 //};
    +
    383 //const char *telTitles0 [] PROGMEM =
    +
    384 //{
    +
    385 // pstrUsagePhone ,
    +
    386 // pstrUsageAnsweringMachine ,
    +
    387 // pstrUsageMessageControls ,
    +
    388 // pstrUsageHandset ,
    +
    389 // pstrUsageHeadset ,
    +
    390 // pstrUsageTelephonyKeyPad ,
    +
    391 // pstrUsageProgrammableButton
    +
    392 //};
    +
    393 //const char *telTitles1 [] PROGMEM =
    +
    394 //{
    +
    395 // pstrUsageHookSwitch ,
    +
    396 // pstrUsageFlash ,
    +
    397 // pstrUsageFeature ,
    +
    398 // pstrUsageHold ,
    +
    399 // pstrUsageRedial ,
    +
    400 // pstrUsageTransfer ,
    +
    401 // pstrUsageDrop ,
    +
    402 // pstrUsagePark ,
    +
    403 // pstrUsageForwardCalls ,
    +
    404 // pstrUsageAlternateFunction ,
    +
    405 // pstrUsageLine ,
    +
    406 // pstrUsageSpeakerPhone ,
    +
    407 // pstrUsageConference ,
    +
    408 // pstrUsageRingEnable ,
    +
    409 // pstrUsageRingSelect ,
    +
    410 // pstrUsagePhoneMute ,
    +
    411 // pstrUsageCallerID ,
    +
    412 // pstrUsageSend
    +
    413 //};
    +
    414 //const char *telTitles2 [] PROGMEM =
    +
    415 //{
    +
    416 // pstrUsageSpeedDial ,
    +
    417 // pstrUsageStoreNumber ,
    +
    418 // pstrUsageRecallNumber ,
    +
    419 // pstrUsagePhoneDirectory
    +
    420 //};
    +
    421 //const char *telTitles3 [] PROGMEM =
    +
    422 //{
    +
    423 // pstrUsageVoiceMail ,
    +
    424 // pstrUsageScreenCalls ,
    +
    425 // pstrUsageDoNotDisturb ,
    +
    426 // pstrUsageMessage ,
    +
    427 // pstrUsageAnswerOnOff
    +
    428 //};
    +
    429 //const char *telTitles4 [] PROGMEM =
    +
    430 //{
    +
    431 // pstrUsageInsideDialTone ,
    +
    432 // pstrUsageOutsideDialTone ,
    +
    433 // pstrUsageInsideRingTone ,
    +
    434 // pstrUsageOutsideRingTone ,
    +
    435 // pstrUsagePriorityRingTone ,
    +
    436 // pstrUsageInsideRingback ,
    +
    437 // pstrUsagePriorityRingback ,
    +
    438 // pstrUsageLineBusyTone ,
    +
    439 // pstrUsageReorderTone ,
    +
    440 // pstrUsageCallWaitingTone ,
    +
    441 // pstrUsageConfirmationTone1 ,
    +
    442 // pstrUsageConfirmationTone2 ,
    +
    443 // pstrUsageTonesOff ,
    +
    444 // pstrUsageOutsideRingback ,
    +
    445 // pstrUsageRinger
    +
    446 //};
    +
    447 //const char *telTitles5 [] PROGMEM =
    +
    448 //{
    +
    449 // pstrUsagePhoneKey0 ,
    +
    450 // pstrUsagePhoneKey1 ,
    +
    451 // pstrUsagePhoneKey2 ,
    +
    452 // pstrUsagePhoneKey3 ,
    +
    453 // pstrUsagePhoneKey4 ,
    +
    454 // pstrUsagePhoneKey5 ,
    +
    455 // pstrUsagePhoneKey6 ,
    +
    456 // pstrUsagePhoneKey7 ,
    +
    457 // pstrUsagePhoneKey8 ,
    +
    458 // pstrUsagePhoneKey9 ,
    +
    459 // pstrUsagePhoneKeyStar ,
    +
    460 // pstrUsagePhoneKeyPound ,
    +
    461 // pstrUsagePhoneKeyA ,
    +
    462 // pstrUsagePhoneKeyB ,
    +
    463 // pstrUsagePhoneKeyC ,
    +
    464 // pstrUsagePhoneKeyD
    +
    465 //};
    +
    466 //const char *consTitles0[] PROGMEM =
    +
    467 //{
    +
    468 // pstrUsageConsumerControl,
    +
    469 // pstrUsageNumericKeyPad,
    +
    470 // pstrUsageProgrammableButton,
    +
    471 // pstrUsageMicrophone,
    +
    472 // pstrUsageHeadphone,
    +
    473 // pstrUsageGraphicEqualizer
    +
    474 //};
    +
    475 //const char *consTitles1[] PROGMEM =
    +
    476 //{
    +
    477 // pstrUsagePlus10 ,
    +
    478 // pstrUsagePlus100,
    +
    479 // pstrUsageAMPM
    +
    480 //};
    +
    481 //const char *consTitles2[] PROGMEM =
    +
    482 //{
    +
    483 // pstrUsagePower ,
    +
    484 // pstrUsageReset ,
    +
    485 // pstrUsageSleep ,
    +
    486 // pstrUsageSleepAfter ,
    +
    487 // pstrUsageSleepMode ,
    +
    488 // pstrUsageIllumination ,
    +
    489 // pstrUsageFunctionButtons
    +
    490 //
    +
    491 //};
    +
    492 //const char *consTitles3[] PROGMEM =
    +
    493 //{
    +
    494 // pstrUsageMenu ,
    +
    495 // pstrUsageMenuPick ,
    +
    496 // pstrUsageMenuUp ,
    +
    497 // pstrUsageMenuDown ,
    +
    498 // pstrUsageMenuLeft ,
    +
    499 // pstrUsageMenuRight ,
    +
    500 // pstrUsageMenuEscape ,
    +
    501 // pstrUsageMenuValueIncrease,
    +
    502 // pstrUsageMenuValueDecrease
    +
    503 //};
    +
    504 //const char *consTitles4[] PROGMEM =
    +
    505 //{
    +
    506 // pstrUsageDataOnScreen ,
    +
    507 // pstrUsageClosedCaption ,
    +
    508 // pstrUsageClosedCaptionSelect,
    +
    509 // pstrUsageVCRTV ,
    +
    510 // pstrUsageBroadcastMode ,
    +
    511 // pstrUsageSnapshot ,
    +
    512 // pstrUsageStill
    +
    513 //};
    +
    514 //const char *consTitles5[] PROGMEM =
    +
    515 //{
    +
    516 // pstrUsageSelection ,
    +
    517 // pstrUsageAssignSelection ,
    +
    518 // pstrUsageModeStep ,
    +
    519 // pstrUsageRecallLast ,
    +
    520 // pstrUsageEnterChannel ,
    +
    521 // pstrUsageOrderMovie ,
    +
    522 // pstrUsageChannel ,
    +
    523 // pstrUsageMediaSelection ,
    +
    524 // pstrUsageMediaSelectComputer ,
    +
    525 // pstrUsageMediaSelectTV ,
    +
    526 // pstrUsageMediaSelectWWW ,
    +
    527 // pstrUsageMediaSelectDVD ,
    +
    528 // pstrUsageMediaSelectTelephone ,
    +
    529 // pstrUsageMediaSelectProgramGuide ,
    +
    530 // pstrUsageMediaSelectVideoPhone ,
    +
    531 // pstrUsageMediaSelectGames ,
    +
    532 // pstrUsageMediaSelectMessages ,
    +
    533 // pstrUsageMediaSelectCD ,
    +
    534 // pstrUsageMediaSelectVCR ,
    +
    535 // pstrUsageMediaSelectTuner ,
    +
    536 // pstrUsageQuit ,
    +
    537 // pstrUsageHelp ,
    +
    538 // pstrUsageMediaSelectTape ,
    +
    539 // pstrUsageMediaSelectCable ,
    +
    540 // pstrUsageMediaSelectSatellite ,
    +
    541 // pstrUsageMediaSelectSecurity ,
    +
    542 // pstrUsageMediaSelectHome ,
    +
    543 // pstrUsageMediaSelectCall ,
    +
    544 // pstrUsageChannelIncrement ,
    +
    545 // pstrUsageChannelDecrement ,
    +
    546 // pstrUsageMediaSelectSAP ,
    +
    547 // pstrUsagePageReserved ,
    +
    548 // pstrUsageVCRPlus ,
    +
    549 // pstrUsageOnce ,
    +
    550 // pstrUsageDaily ,
    +
    551 // pstrUsageWeekly ,
    +
    552 // pstrUsageMonthly
    +
    553 //};
    +
    554 //const char *consTitles6[] PROGMEM =
    +
    555 //{
    +
    556 // pstrUsagePlay ,
    +
    557 // pstrUsagePause ,
    +
    558 // pstrUsageRecord ,
    +
    559 // pstrUsageFastForward ,
    +
    560 // pstrUsageRewind ,
    +
    561 // pstrUsageScanNextTrack ,
    +
    562 // pstrUsageScanPreviousTrack ,
    +
    563 // pstrUsageStop ,
    +
    564 // pstrUsageEject ,
    +
    565 // pstrUsageRandomPlay ,
    +
    566 // pstrUsageSelectDisk ,
    +
    567 // pstrUsageEnterDisk ,
    +
    568 // pstrUsageRepeat ,
    +
    569 // pstrUsageTracking ,
    +
    570 // pstrUsageTrackNormal ,
    +
    571 // pstrUsageSlowTracking ,
    +
    572 // pstrUsageFrameForward ,
    +
    573 // pstrUsageFrameBackwards ,
    +
    574 // pstrUsageMark ,
    +
    575 // pstrUsageClearMark ,
    +
    576 // pstrUsageRepeatFromMark ,
    +
    577 // pstrUsageReturnToMark ,
    +
    578 // pstrUsageSearchMarkForward ,
    +
    579 // pstrUsageSearchMarkBackwards ,
    +
    580 // pstrUsageCounterReset ,
    +
    581 // pstrUsageShowCounter ,
    +
    582 // pstrUsageTrackingIncrement ,
    +
    583 // pstrUsageTrackingDecrement ,
    +
    584 // pstrUsageStopEject ,
    +
    585 // pstrUsagePlayPause ,
    +
    586 // pstrUsagePlaySkip
    +
    587 //};
    +
    588 //const char *consTitles7[] PROGMEM =
    +
    589 //{
    +
    590 // pstrUsageVolume ,
    +
    591 // pstrUsageBalance ,
    +
    592 // pstrUsageMute ,
    +
    593 // pstrUsageBass ,
    +
    594 // pstrUsageTreble ,
    +
    595 // pstrUsageBassBoost ,
    +
    596 // pstrUsageSurroundMode ,
    +
    597 // pstrUsageLoudness ,
    +
    598 // pstrUsageMPX ,
    +
    599 // pstrUsageVolumeIncrement ,
    +
    600 // pstrUsageVolumeDecrement
    +
    601 //};
    +
    602 //const char *consTitles8[] PROGMEM =
    +
    603 //{
    +
    604 // pstrUsageSpeedSelect ,
    +
    605 // pstrUsagePlaybackSpeed ,
    +
    606 // pstrUsageStandardPlay ,
    +
    607 // pstrUsageLongPlay ,
    +
    608 // pstrUsageExtendedPlay ,
    +
    609 // pstrUsageSlow
    +
    610 //};
    +
    611 //const char *consTitles9[] PROGMEM =
    +
    612 //{
    +
    613 // pstrUsageFanEnable ,
    +
    614 // pstrUsageFanSpeed ,
    +
    615 // pstrUsageLightEnable ,
    +
    616 // pstrUsageLightIlluminationLevel ,
    +
    617 // pstrUsageClimateControlEnable ,
    +
    618 // pstrUsageRoomTemperature ,
    +
    619 // pstrUsageSecurityEnable ,
    +
    620 // pstrUsageFireAlarm ,
    +
    621 // pstrUsagePoliceAlarm ,
    +
    622 // pstrUsageProximity ,
    +
    623 // pstrUsageMotion ,
    +
    624 // pstrUsageDuresAlarm ,
    +
    625 // pstrUsageHoldupAlarm ,
    +
    626 // pstrUsageMedicalAlarm
    +
    627 //};
    +
    628 //const char *consTitlesA[] PROGMEM =
    +
    629 //{
    +
    630 // pstrUsageBalanceRight ,
    +
    631 // pstrUsageBalanceLeft ,
    +
    632 // pstrUsageBassIncrement ,
    +
    633 // pstrUsageBassDecrement ,
    +
    634 // pstrUsageTrebleIncrement ,
    +
    635 // pstrUsageTrebleDecrement
    +
    636 //};
    +
    637 //const char *consTitlesB[] PROGMEM =
    +
    638 //{
    +
    639 // pstrUsageSpeakerSystem ,
    +
    640 // pstrUsageChannelLeft ,
    +
    641 // pstrUsageChannelRight ,
    +
    642 // pstrUsageChannelCenter ,
    +
    643 // pstrUsageChannelFront ,
    +
    644 // pstrUsageChannelCenterFront ,
    +
    645 // pstrUsageChannelSide ,
    +
    646 // pstrUsageChannelSurround ,
    +
    647 // pstrUsageChannelLowFreqEnhancement ,
    +
    648 // pstrUsageChannelTop ,
    +
    649 // pstrUsageChannelUnknown
    +
    650 //};
    +
    651 //const char *consTitlesC[] PROGMEM =
    +
    652 //{
    +
    653 // pstrUsageSubChannel ,
    +
    654 // pstrUsageSubChannelIncrement ,
    +
    655 // pstrUsageSubChannelDecrement ,
    +
    656 // pstrUsageAlternateAudioIncrement ,
    +
    657 // pstrUsageAlternateAudioDecrement
    +
    658 //};
    +
    659 //const char *consTitlesD[] PROGMEM =
    +
    660 //{
    +
    661 // pstrUsageApplicationLaunchButtons ,
    +
    662 // pstrUsageALLaunchButtonConfigTool ,
    +
    663 // pstrUsageALProgrammableButton ,
    +
    664 // pstrUsageALConsumerControlConfig ,
    +
    665 // pstrUsageALWordProcessor ,
    +
    666 // pstrUsageALTextEditor ,
    +
    667 // pstrUsageALSpreadsheet ,
    +
    668 // pstrUsageALGraphicsEditor ,
    +
    669 // pstrUsageALPresentationApp ,
    +
    670 // pstrUsageALDatabaseApp ,
    +
    671 // pstrUsageALEmailReader ,
    +
    672 // pstrUsageALNewsreader ,
    +
    673 // pstrUsageALVoicemail ,
    +
    674 // pstrUsageALContactsAddressBook ,
    +
    675 // pstrUsageALCalendarSchedule ,
    +
    676 // pstrUsageALTaskProjectManager ,
    +
    677 // pstrUsageALLogJournalTimecard ,
    +
    678 // pstrUsageALCheckbookFinance ,
    +
    679 // pstrUsageALCalculator ,
    +
    680 // pstrUsageALAVCapturePlayback ,
    +
    681 // pstrUsageALLocalMachineBrowser ,
    +
    682 // pstrUsageALLANWANBrow ,
    +
    683 // pstrUsageALInternetBrowser ,
    +
    684 // pstrUsageALRemoteNetISPConnect ,
    +
    685 // pstrUsageALNetworkConference ,
    +
    686 // pstrUsageALNetworkChat ,
    +
    687 // pstrUsageALTelephonyDialer ,
    +
    688 // pstrUsageALLogon ,
    +
    689 // pstrUsageALLogoff ,
    +
    690 // pstrUsageALLogonLogoff ,
    +
    691 // pstrUsageALTermLockScrSav ,
    +
    692 // pstrUsageALControlPannel ,
    +
    693 // pstrUsageALCommandLineProcessorRun ,
    +
    694 // pstrUsageALProcessTaskManager ,
    +
    695 // pstrUsageALSelectTaskApplication ,
    +
    696 // pstrUsageALNextTaskApplication ,
    +
    697 // pstrUsageALPreviousTaskApplication ,
    +
    698 // pstrUsageALPreemptiveHaltTaskApp ,
    +
    699 // pstrUsageALIntegratedHelpCenter ,
    +
    700 // pstrUsageALDocuments ,
    +
    701 // pstrUsageALThesaurus ,
    +
    702 // pstrUsageALDictionary ,
    +
    703 // pstrUsageALDesktop ,
    +
    704 // pstrUsageALSpellCheck ,
    +
    705 // pstrUsageALGrammarCheck ,
    +
    706 // pstrUsageALWirelessStatus ,
    +
    707 // pstrUsageALKeyboardLayout ,
    +
    708 // pstrUsageALVirusProtection ,
    +
    709 // pstrUsageALEncryption ,
    +
    710 // pstrUsageALScreenSaver ,
    +
    711 // pstrUsageALAlarms ,
    +
    712 // pstrUsageALClock ,
    +
    713 // pstrUsageALFileBrowser ,
    +
    714 // pstrUsageALPowerStatus ,
    +
    715 // pstrUsageALImageBrowser ,
    +
    716 // pstrUsageALAudioBrowser ,
    +
    717 // pstrUsageALMovieBrowser ,
    +
    718 // pstrUsageALDigitalRightsManager ,
    +
    719 // pstrUsageALDigitalWallet ,
    +
    720 // pstrUsagePageReserved ,
    +
    721 // pstrUsageALInstantMessaging ,
    +
    722 // pstrUsageALOEMFeaturesBrowser ,
    +
    723 // pstrUsageALOEMHelp ,
    +
    724 // pstrUsageALOnlineCommunity ,
    +
    725 // pstrUsageALEntertainmentContentBrow ,
    +
    726 // pstrUsageALOnlineShoppingBrowser ,
    +
    727 // pstrUsageALSmartCardInfoHelp ,
    +
    728 // pstrUsageALMarketMonitorFinBrowser ,
    +
    729 // pstrUsageALCustomCorpNewsBrowser ,
    +
    730 // pstrUsageALOnlineActivityBrowser ,
    +
    731 // pstrUsageALResearchSearchBrowser ,
    +
    732 // pstrUsageALAudioPlayer
    +
    733 //};
    +
    734 //const char *consTitlesE[] PROGMEM =
    +
    735 //{
    +
    736 // pstrUsageGenericGUIAppControls ,
    +
    737 // pstrUsageACNew ,
    +
    738 // pstrUsageACOpen ,
    +
    739 // pstrUsageACClose ,
    +
    740 // pstrUsageACExit ,
    +
    741 // pstrUsageACMaximize ,
    +
    742 // pstrUsageACMinimize ,
    +
    743 // pstrUsageACSave ,
    +
    744 // pstrUsageACPrint ,
    +
    745 // pstrUsageACProperties ,
    +
    746 // pstrUsageACUndo ,
    +
    747 // pstrUsageACCopy ,
    +
    748 // pstrUsageACCut ,
    +
    749 // pstrUsageACPaste ,
    +
    750 // pstrUsageACSelectAll ,
    +
    751 // pstrUsageACFind ,
    +
    752 // pstrUsageACFindAndReplace ,
    +
    753 // pstrUsageACSearch ,
    +
    754 // pstrUsageACGoto ,
    +
    755 // pstrUsageACHome ,
    +
    756 // pstrUsageACBack ,
    +
    757 // pstrUsageACForward ,
    +
    758 // pstrUsageACStop ,
    +
    759 // pstrUsageACRefresh ,
    +
    760 // pstrUsageACPreviousLink ,
    +
    761 // pstrUsageACNextLink ,
    +
    762 // pstrUsageACBookmarks ,
    +
    763 // pstrUsageACHistory ,
    +
    764 // pstrUsageACSubscriptions ,
    +
    765 // pstrUsageACZoomIn ,
    +
    766 // pstrUsageACZoomOut ,
    +
    767 // pstrUsageACZoom ,
    +
    768 // pstrUsageACFullScreenView ,
    +
    769 // pstrUsageACNormalView ,
    +
    770 // pstrUsageACViewToggle ,
    +
    771 // pstrUsageACScrollUp ,
    +
    772 // pstrUsageACScrollDown ,
    +
    773 // pstrUsageACScroll ,
    +
    774 // pstrUsageACPanLeft ,
    +
    775 // pstrUsageACPanRight ,
    +
    776 // pstrUsageACPan ,
    +
    777 // pstrUsageACNewWindow ,
    +
    778 // pstrUsageACTileHoriz ,
    +
    779 // pstrUsageACTileVert ,
    +
    780 // pstrUsageACFormat ,
    +
    781 // pstrUsageACEdit ,
    +
    782 // pstrUsageACBold ,
    +
    783 // pstrUsageACItalics ,
    +
    784 // pstrUsageACUnderline ,
    +
    785 // pstrUsageACStrikethrough ,
    +
    786 // pstrUsageACSubscript ,
    +
    787 // pstrUsageACSuperscript ,
    +
    788 // pstrUsageACAllCaps ,
    +
    789 // pstrUsageACRotate ,
    +
    790 // pstrUsageACResize ,
    +
    791 // pstrUsageACFlipHorizontal ,
    +
    792 // pstrUsageACFlipVertical ,
    +
    793 // pstrUsageACMirrorHorizontal ,
    +
    794 // pstrUsageACMirrorVertical ,
    +
    795 // pstrUsageACFontSelect ,
    +
    796 // pstrUsageACFontColor ,
    +
    797 // pstrUsageACFontSize ,
    +
    798 // pstrUsageACJustifyLeft ,
    +
    799 // pstrUsageACJustifyCenterH ,
    +
    800 // pstrUsageACJustifyRight ,
    +
    801 // pstrUsageACJustifyBlockH ,
    +
    802 // pstrUsageACJustifyTop ,
    +
    803 // pstrUsageACJustifyCenterV ,
    +
    804 // pstrUsageACJustifyBottom ,
    +
    805 // pstrUsageACJustifyBlockV ,
    +
    806 // pstrUsageACIndentDecrease ,
    +
    807 // pstrUsageACIndentIncrease ,
    +
    808 // pstrUsageACNumberedList ,
    +
    809 // pstrUsageACRestartNumbering ,
    +
    810 // pstrUsageACBulletedList ,
    +
    811 // pstrUsageACPromote ,
    +
    812 // pstrUsageACDemote ,
    +
    813 // pstrUsageACYes ,
    +
    814 // pstrUsageACNo ,
    +
    815 // pstrUsageACCancel ,
    +
    816 // pstrUsageACCatalog ,
    +
    817 // pstrUsageACBuyChkout ,
    +
    818 // pstrUsageACAddToCart ,
    +
    819 // pstrUsageACExpand ,
    +
    820 // pstrUsageACExpandAll ,
    +
    821 // pstrUsageACCollapse ,
    +
    822 // pstrUsageACCollapseAll ,
    +
    823 // pstrUsageACPrintPreview ,
    +
    824 // pstrUsageACPasteSpecial ,
    +
    825 // pstrUsageACInsertMode ,
    +
    826 // pstrUsageACDelete ,
    +
    827 // pstrUsageACLock ,
    +
    828 // pstrUsageACUnlock ,
    +
    829 // pstrUsageACProtect ,
    +
    830 // pstrUsageACUnprotect ,
    +
    831 // pstrUsageACAttachComment ,
    +
    832 // pstrUsageACDeleteComment ,
    +
    833 // pstrUsageACViewComment ,
    +
    834 // pstrUsageACSelectWord ,
    +
    835 // pstrUsageACSelectSentence ,
    +
    836 // pstrUsageACSelectParagraph ,
    +
    837 // pstrUsageACSelectColumn ,
    +
    838 // pstrUsageACSelectRow ,
    +
    839 // pstrUsageACSelectTable ,
    +
    840 // pstrUsageACSelectObject ,
    +
    841 // pstrUsageACRedoRepeat ,
    +
    842 // pstrUsageACSort ,
    +
    843 // pstrUsageACSortAscending ,
    +
    844 // pstrUsageACSortDescending ,
    +
    845 // pstrUsageACFilter ,
    +
    846 // pstrUsageACSetClock ,
    +
    847 // pstrUsageACViewClock ,
    +
    848 // pstrUsageACSelectTimeZone ,
    +
    849 // pstrUsageACEditTimeZone ,
    +
    850 // pstrUsageACSetAlarm ,
    +
    851 // pstrUsageACClearAlarm ,
    +
    852 // pstrUsageACSnoozeAlarm ,
    +
    853 // pstrUsageACResetAlarm ,
    +
    854 // pstrUsageACSyncronize ,
    +
    855 // pstrUsageACSendReceive ,
    +
    856 // pstrUsageACSendTo ,
    +
    857 // pstrUsageACReply ,
    +
    858 // pstrUsageACReplyAll ,
    +
    859 // pstrUsageACForwardMessage ,
    +
    860 // pstrUsageACSend ,
    +
    861 // pstrUsageACAttachFile ,
    +
    862 // pstrUsageACUpload ,
    +
    863 // pstrUsageACDownload ,
    +
    864 // pstrUsageACSetBorders ,
    +
    865 // pstrUsageACInsertRow ,
    +
    866 // pstrUsageACInsertColumn ,
    +
    867 // pstrUsageACInsertFile ,
    +
    868 // pstrUsageACInsertPicture ,
    +
    869 // pstrUsageACInsertObject ,
    +
    870 // pstrUsageACInsertSymbol ,
    +
    871 // pstrUsageACSaveAndClose ,
    +
    872 // pstrUsageACRename ,
    +
    873 // pstrUsageACMerge ,
    +
    874 // pstrUsageACSplit ,
    +
    875 // pstrUsageACDistributeHorizontaly ,
    +
    876 // pstrUsageACDistributeVerticaly
    +
    877 //};
    +
    878 //const char *digitTitles0[] PROGMEM =
    +
    879 //{
    +
    880 // pstrUsageDigitizer ,
    +
    881 // pstrUsagePen ,
    +
    882 // pstrUsageLightPen ,
    +
    883 // pstrUsageTouchScreen ,
    +
    884 // pstrUsageTouchPad ,
    +
    885 // pstrUsageWhiteBoard ,
    +
    886 // pstrUsageCoordinateMeasuringMachine ,
    +
    887 // pstrUsage3DDigitizer ,
    +
    888 // pstrUsageStereoPlotter ,
    +
    889 // pstrUsageArticulatedArm ,
    +
    890 // pstrUsageArmature ,
    +
    891 // pstrUsageMultiplePointDigitizer ,
    +
    892 // pstrUsageFreeSpaceWand
    +
    893 //};
    +
    894 //const char *digitTitles1[] PROGMEM =
    +
    895 //{
    +
    896 // pstrUsageStylus ,
    +
    897 // pstrUsagePuck ,
    +
    898 // pstrUsageFinger
    +
    899 //
    +
    900 //};
    +
    901 //const char *digitTitles2[] PROGMEM =
    +
    902 //{
    +
    903 // pstrUsageTipPressure ,
    +
    904 // pstrUsageBarrelPressure ,
    +
    905 // pstrUsageInRange ,
    +
    906 // pstrUsageTouch ,
    +
    907 // pstrUsageUntouch ,
    +
    908 // pstrUsageTap ,
    +
    909 // pstrUsageQuality ,
    +
    910 // pstrUsageDataValid ,
    +
    911 // pstrUsageTransducerIndex ,
    +
    912 // pstrUsageTabletFunctionKeys ,
    +
    913 // pstrUsageProgramChangeKeys ,
    +
    914 // pstrUsageBatteryStrength ,
    +
    915 // pstrUsageInvert ,
    +
    916 // pstrUsageXTilt ,
    +
    917 // pstrUsageYTilt ,
    +
    918 // pstrUsageAzimuth ,
    +
    919 // pstrUsageAltitude ,
    +
    920 // pstrUsageTwist ,
    +
    921 // pstrUsageTipSwitch ,
    +
    922 // pstrUsageSecondaryTipSwitch ,
    +
    923 // pstrUsageBarrelSwitch ,
    +
    924 // pstrUsageEraser ,
    +
    925 // pstrUsageTabletPick
    +
    926 //};
    +
    927 //const char *aplphanumTitles0[] PROGMEM =
    +
    928 //{
    +
    929 // pstrUsageAlphanumericDisplay,
    +
    930 // pstrUsageBitmappedDisplay
    +
    931 //};
    +
    932 //const char *aplphanumTitles1[] PROGMEM =
    +
    933 //{
    +
    934 // pstrUsageDisplayAttributesReport ,
    +
    935 // pstrUsageASCIICharacterSet ,
    +
    936 // pstrUsageDataReadBack ,
    +
    937 // pstrUsageFontReadBack ,
    +
    938 // pstrUsageDisplayControlReport ,
    +
    939 // pstrUsageClearDisplay ,
    +
    940 // pstrUsageDisplayEnable ,
    +
    941 // pstrUsageScreenSaverDelay ,
    +
    942 // pstrUsageScreenSaverEnable ,
    +
    943 // pstrUsageVerticalScroll ,
    +
    944 // pstrUsageHorizontalScroll ,
    +
    945 // pstrUsageCharacterReport ,
    +
    946 // pstrUsageDisplayData ,
    +
    947 // pstrUsageDisplayStatus ,
    +
    948 // pstrUsageStatusNotReady ,
    +
    949 // pstrUsageStatusReady ,
    +
    950 // pstrUsageErrorNotALoadableCharacter ,
    +
    951 // pstrUsageErrorFotDataCanNotBeRead ,
    +
    952 // pstrUsageCursorPositionReport ,
    +
    953 // pstrUsageRow ,
    +
    954 // pstrUsageColumn ,
    +
    955 // pstrUsageRows ,
    +
    956 // pstrUsageColumns ,
    +
    957 // pstrUsageCursorPixelPosition ,
    +
    958 // pstrUsageCursorMode ,
    +
    959 // pstrUsageCursorEnable ,
    +
    960 // pstrUsageCursorBlink ,
    +
    961 // pstrUsageFontReport ,
    +
    962 // pstrUsageFontData ,
    +
    963 // pstrUsageCharacterWidth ,
    +
    964 // pstrUsageCharacterHeight ,
    +
    965 // pstrUsageCharacterSpacingHorizontal ,
    +
    966 // pstrUsageCharacterSpacingVertical ,
    +
    967 // pstrUsageUnicodeCharset ,
    +
    968 // pstrUsageFont7Segment ,
    +
    969 // pstrUsage7SegmentDirectMap ,
    +
    970 // pstrUsageFont14Segment ,
    +
    971 // pstrUsage14SegmentDirectMap ,
    +
    972 // pstrUsageDisplayBrightness ,
    +
    973 // pstrUsageDisplayContrast ,
    +
    974 // pstrUsageCharacterAttribute ,
    +
    975 // pstrUsageAttributeReadback ,
    +
    976 // pstrUsageAttributeData ,
    +
    977 // pstrUsageCharAttributeEnhance ,
    +
    978 // pstrUsageCharAttributeUnderline ,
    +
    979 // pstrUsageCharAttributeBlink
    +
    980 //};
    +
    981 //const char *aplphanumTitles2[] PROGMEM =
    +
    982 //{
    +
    983 // pstrUsageBitmapSizeX ,
    +
    984 // pstrUsageBitmapSizeY ,
    +
    985 // pstrUsagePageReserved ,
    +
    986 // pstrUsageBitDepthFormat ,
    +
    987 // pstrUsageDisplayOrientation ,
    +
    988 // pstrUsagePaletteReport ,
    +
    989 // pstrUsagePaletteDataSize ,
    +
    990 // pstrUsagePaletteDataOffset ,
    +
    991 // pstrUsagePaletteData ,
    +
    992 // pstrUsageBlitReport ,
    +
    993 // pstrUsageBlitRectangleX1 ,
    +
    994 // pstrUsageBlitRectangleY1 ,
    +
    995 // pstrUsageBlitRectangleX2 ,
    +
    996 // pstrUsageBlitRectangleY2 ,
    +
    997 // pstrUsageBlitData ,
    +
    998 // pstrUsageSoftButton ,
    +
    999 // pstrUsageSoftButtonID ,
    +
    1000 // pstrUsageSoftButtonSide ,
    +
    1001 // pstrUsageSoftButtonOffset1 ,
    +
    1002 // pstrUsageSoftButtonOffset2 ,
    +
    1003 // pstrUsageSoftButtonReport
    +
    1004 //};
    +
    1005 //const char *medInstrTitles0[] PROGMEM =
    +
    1006 //{
    +
    1007 // pstrUsageVCRAcquisition ,
    +
    1008 // pstrUsageFreezeThaw ,
    +
    1009 // pstrUsageClipStore ,
    +
    1010 // pstrUsageUpdate ,
    +
    1011 // pstrUsageNext ,
    +
    1012 // pstrUsageSave ,
    +
    1013 // pstrUsagePrint ,
    +
    1014 // pstrUsageMicrophoneEnable
    +
    1015 //};
    +
    1016 //const char *medInstrTitles1[] PROGMEM =
    +
    1017 //{
    +
    1018 // pstrUsageCine ,
    +
    1019 // pstrUsageTransmitPower ,
    +
    1020 // pstrUsageVolume ,
    +
    1021 // pstrUsageFocus ,
    +
    1022 // pstrUsageDepth
    +
    1023 //};
    +
    1024 //const char *medInstrTitles2[] PROGMEM =
    +
    1025 //{
    +
    1026 // pstrUsageSoftStepPrimary ,
    +
    1027 // pstrUsageSoftStepSecondary
    +
    1028 //};
    +
    1029 //const char *medInstrTitles3[] PROGMEM =
    +
    1030 //{
    +
    1031 // pstrUsageZoomSelect ,
    +
    1032 // pstrUsageZoomAdjust ,
    +
    1033 // pstrUsageSpectralDopplerModeSelect ,
    +
    1034 // pstrUsageSpectralDopplerModeAdjust ,
    +
    1035 // pstrUsageColorDopplerModeSelect ,
    +
    1036 // pstrUsageColorDopplerModeAdjust ,
    +
    1037 // pstrUsageMotionModeSelect ,
    +
    1038 // pstrUsageMotionModeAdjust ,
    +
    1039 // pstrUsage2DModeSelect ,
    +
    1040 // pstrUsage2DModeAdjust
    +
    1041 //};
    +
    1042 //const char *medInstrTitles4[] PROGMEM =
    +
    1043 //{
    +
    1044 // pstrUsageSoftControlSelect ,
    +
    1045 // pstrUsageSoftControlAdjust
    +
    1046 //};
    +
    1047 
    +
    1048 #endif // __HIDUSAGETITLEARRAYS_H__
    diff --git a/hierarchy.html b/hierarchy.html index 1d477dd8..f1090cc9 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Hierarchy + @@ -31,7 +32,7 @@ - + @@ -73,7 +74,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -100,99 +101,102 @@ This inheritance list is sorted roughly, but not completely, alphabetically: CSinkParser< BASE_CLASS, LEN_TYPE, OFFSET_TYPE >  CBASICCDB  CBluetoothService - CBTHID - CPS4BT - CPS3BT - CSPP - CWII - CByteSkipper - CCALL_MGMNT_FUNC_DESCR - CCapacity - CCDB10 - CCDB12 - CCDB6 - CCDB_LBA32_16 - CCDB_LBA64_16 - CCDCAsyncOper - CCLASS_NOTIFICATION - CCommandBlockWrapperBase - CCommandBlockWrapper - CCommandStatusWrapper - CEpInfo - CFTDIAsyncOper - CHID_CLASS_DESCRIPTOR_LEN_AND_TYPE - CHidItemPrefix - CHIDReportParser - CKeyboardReportParser - CMouseReportParser - CUniversalReportParser - CHubDescriptor - CHubEvent - CInquiryResponse - CKBDINFO - CKBDLEDS - CLINE_CODING - CMainItemIOFeature - CMAX3421e< SPI_SS, INTR > - CUSB - CMODIFIERKEYS - CMOUSEINFO - CMultiByteValueParser - CMultiValueBuffer - CPrint - CMax_LCD - CPS4Buttons - CPS4Data - CPS4Output - CPS4Parser - CPS4BT - CPS4USB - CPS4Status - CPSBUZZButtons - CPTPListParser - CRequestSenseResponce - CSETUP_PKT - CSPi< SPI_CLK, SPI_MOSI, SPI_MISO, SPI_SS > - CStream - CSPP - CTEL_RINGER_FUNC_DESCR - CtouchpadXY - CUSB_CONFIGURATION_DESCRIPTOR - CUSB_DEVICE_DESCRIPTOR - CUSB_ENDPOINT_DESCRIPTOR - CUSB_HID_DESCRIPTOR - CUSB_INTERFACE_DESCRIPTOR - CUsbConfigXtracter - CACM - CPL2303 - CADK - CBTD - CBulkOnly - CFTDI - CHID - CHIDBoot< BOOT_PROTOCOL > - CHIDUniversal - CPS4USB - CPSBuzz - CUsbDevice - CUsbDeviceAddress - CUSBDeviceConfig - CACM - CADK - CBTD - CBulkOnly - CFTDI - CHID - CPS3USB - CUSBHub - CXBOXOLD - CXBOXRECV - CXBOXUSB - CUSBReadParser - CConfigDescParser< CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK > - CReportDescParserBase - CReportDescParser - CReportDescParser2 + CBTHID + CPS4BT + CPS3BT + CSPP + CWII + CByteSkipper + CCALL_MGMNT_FUNC_DESCR + CCapacity + CCDB10 + CCDB12 + CCDB6 + CCDB_LBA32_16 + CCDB_LBA64_16 + CCDCAsyncOper + CCLASS_NOTIFICATION + CCommandBlockWrapperBase + CCommandBlockWrapper + CCommandStatusWrapper + CEpInfo + CFTDIAsyncOper + CHID_CLASS_DESCRIPTOR_LEN_AND_TYPE + CHidItemPrefix + CHIDReportParser + CKeyboardReportParser + CMouseReportParser + CUniversalReportParser + CHubDescriptor + CHubEvent + CInquiryResponse + CKBDINFO + CKBDLEDS + CLINE_CODING + CMainItemIOFeature + CMAX3421e< SPI_SS, INTR > + CUSB + CMODIFIERKEYS + CMOUSEINFO + CMultiByteValueParser + CMultiValueBuffer + CPrint + CMax_LCD + CPS4Buttons + CPS4Data + CPS4Output + CPS4Parser + CPS4BT + CPS4USB + CPS4Status + CPSBUZZButtons + CPTPListParser + CRequestSenseResponce + CSETUP_PKT + CSPi< SPI_CLK, SPI_MOSI, SPI_MISO, SPI_SS > + CStream + CSPP + CTEL_RINGER_FUNC_DESCR + CtouchpadXY + Ctty_features + CUSB_CONFIGURATION_DESCRIPTOR + CUSB_DEVICE_DESCRIPTOR + CUSB_ENDPOINT_DESCRIPTOR + CUSB_HID_DESCRIPTOR + CUSB_INTERFACE_DESCRIPTOR + CUsbConfigXtracter + CACM + CPL2303 + CXR21B1411 + CADK + CBTD + CBulkOnly + CFTDI + CHID + CHIDBoot< BOOT_PROTOCOL > + CHIDUniversal + CPS4USB + CPSBuzz + CUsbDevice + CUsbDeviceAddress + CUSBDeviceConfig + CACM + CADK + CBTD + CBulkOnly + CFTDI + CHID + CPS3USB + CUSBHub + CXBOXOLD + CXBOXONE + CXBOXRECV + CXBOXUSB + CUSBReadParser + CConfigDescParser< CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK > + CReportDescParserBase + CReportDescParser + CReportDescParser2
    @@ -200,7 +204,7 @@ This inheritance list is sorted roughly, but not completely, alphabetically: diff --git a/index.html b/index.html index a3dd15f3..02145b4a 100644 --- a/index.html +++ b/index.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Main Page + @@ -31,7 +32,7 @@ - + @@ -65,7 +66,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -86,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

    Some information can also be found at: http://blog.tkjelectronics.dk/.

    The shield can be purchased at the main site: http://www.circuitsathome.com/products-page/arduino-shields or from TKJ Electronics: http://shop.tkjelectronics.dk/product_info.php?products_id=43.

    -USB Host Shield +USB Host Shield

    For more information about the hardware see the Hardware Manual.

    Developed By

    @@ -104,6 +105,38 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • Major contributor to mass storage code
  • +
  • guruthree +
  • + +

    Donate

    +

    Help yourself by helping us support you! Many thousands of hours have been spent developing the USB Host Shield library. Since you find it useful, please consider donating via the button below. Donations will allow us to support you by ensuring hardware that you have can be acquired in order to add support for your microcontroller board.

    +

    +

    Table of Contents

    +

    How to include the library

    First download the library by clicking on the following link: https://github.com/felis/USB_Host_Shield_2.0/archive/master.zip.

    @@ -121,7 +154,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

    Now quit the Arduino IDE and reopen it.

    Now you should be able to go open all the examples codes by navigating to "File>Examples>USB\_Host\_Shield\_20" and then select the example you will like to open.

    -

    For more information visit the following site: http://arduino.cc/en/Guide/Libraries.

    +

    For more information visit the following sites: http://arduino.cc/en/Guide/Libraries and https://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use.

    How to use the library

    Documentation

    Documentation for the library can be found at the following link: http://felis.github.com/USB_Host_Shield_2.0/.

    @@ -132,8 +165,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

    Currently the following boards are supported by the library:

    diff --git a/inherit_graph_45.map b/inherit_graph_45.map index d3c2ebdf..c9fa69ac 100644 --- a/inherit_graph_45.map +++ b/inherit_graph_45.map @@ -1,3 +1,3 @@ - + diff --git a/inherit_graph_45.md5 b/inherit_graph_45.md5 index 159342ba..188d85ce 100644 --- a/inherit_graph_45.md5 +++ b/inherit_graph_45.md5 @@ -1 +1 @@ -1c7a9b5b86003e92c3bf0c8685c00950 \ No newline at end of file +02fed3113bdea3a5e53c82b05dd542ab \ No newline at end of file diff --git a/inherit_graph_45.png b/inherit_graph_45.png index 108b2179..9637db9a 100644 Binary files a/inherit_graph_45.png and b/inherit_graph_45.png differ diff --git a/inherit_graph_46.map b/inherit_graph_46.map index 9924f8c5..d3c2ebdf 100644 --- a/inherit_graph_46.map +++ b/inherit_graph_46.map @@ -1,3 +1,3 @@ - + diff --git a/inherit_graph_46.md5 b/inherit_graph_46.md5 index c674602a..159342ba 100644 --- a/inherit_graph_46.md5 +++ b/inherit_graph_46.md5 @@ -1 +1 @@ -8d5846296d9d341acf795a87b1f5cb3c \ No newline at end of file +1c7a9b5b86003e92c3bf0c8685c00950 \ No newline at end of file diff --git a/inherit_graph_46.png b/inherit_graph_46.png index 272b475f..108b2179 100644 Binary files a/inherit_graph_46.png and b/inherit_graph_46.png differ diff --git a/inherit_graph_47.map b/inherit_graph_47.map index 97446a12..9924f8c5 100644 --- a/inherit_graph_47.map +++ b/inherit_graph_47.map @@ -1,3 +1,3 @@ - + diff --git a/inherit_graph_47.md5 b/inherit_graph_47.md5 index 10babc4f..c674602a 100644 --- a/inherit_graph_47.md5 +++ b/inherit_graph_47.md5 @@ -1 +1 @@ -36b8ffb823d725e2c783a2b7a8202aae \ No newline at end of file +8d5846296d9d341acf795a87b1f5cb3c \ No newline at end of file diff --git a/inherit_graph_47.png b/inherit_graph_47.png index 024b00ad..272b475f 100644 Binary files a/inherit_graph_47.png and b/inherit_graph_47.png differ diff --git a/inherit_graph_48.map b/inherit_graph_48.map index de5f7633..97446a12 100644 --- a/inherit_graph_48.map +++ b/inherit_graph_48.map @@ -1,3 +1,3 @@ - + diff --git a/inherit_graph_48.md5 b/inherit_graph_48.md5 index 449e6996..10babc4f 100644 --- a/inherit_graph_48.md5 +++ b/inherit_graph_48.md5 @@ -1 +1 @@ -868b020ace8c41333293b31d6f4ba3db \ No newline at end of file +36b8ffb823d725e2c783a2b7a8202aae \ No newline at end of file diff --git a/inherit_graph_48.png b/inherit_graph_48.png index 3f4ec196..024b00ad 100644 Binary files a/inherit_graph_48.png and b/inherit_graph_48.png differ diff --git a/inherit_graph_49.map b/inherit_graph_49.map index 3cd215b0..de5f7633 100644 --- a/inherit_graph_49.map +++ b/inherit_graph_49.map @@ -1,3 +1,3 @@ - + diff --git a/inherit_graph_49.md5 b/inherit_graph_49.md5 index b88e057d..449e6996 100644 --- a/inherit_graph_49.md5 +++ b/inherit_graph_49.md5 @@ -1 +1 @@ -5c3434b4140d15887c2ce9b803ff2b94 \ No newline at end of file +868b020ace8c41333293b31d6f4ba3db \ No newline at end of file diff --git a/inherit_graph_49.png b/inherit_graph_49.png index f860dc47..3f4ec196 100644 Binary files a/inherit_graph_49.png and b/inherit_graph_49.png differ diff --git a/inherit_graph_50.map b/inherit_graph_50.map index 648c5372..3cd215b0 100644 --- a/inherit_graph_50.map +++ b/inherit_graph_50.map @@ -1,3 +1,3 @@ - + diff --git a/inherit_graph_50.md5 b/inherit_graph_50.md5 index 39b032ef..b88e057d 100644 --- a/inherit_graph_50.md5 +++ b/inherit_graph_50.md5 @@ -1 +1 @@ -f7bc24c0b02011f24f977e7adc86dd70 \ No newline at end of file +5c3434b4140d15887c2ce9b803ff2b94 \ No newline at end of file diff --git a/inherit_graph_50.png b/inherit_graph_50.png index bde5017c..f860dc47 100644 Binary files a/inherit_graph_50.png and b/inherit_graph_50.png differ diff --git a/inherit_graph_51.map b/inherit_graph_51.map index 1a2a3836..648c5372 100644 --- a/inherit_graph_51.map +++ b/inherit_graph_51.map @@ -1,3 +1,3 @@ - + diff --git a/inherit_graph_51.md5 b/inherit_graph_51.md5 index 54a30c4d..39b032ef 100644 --- a/inherit_graph_51.md5 +++ b/inherit_graph_51.md5 @@ -1 +1 @@ -1f37fdf36af1f7a4626fdb6e529e6fce \ No newline at end of file +f7bc24c0b02011f24f977e7adc86dd70 \ No newline at end of file diff --git a/inherit_graph_51.png b/inherit_graph_51.png index cca1320d..bde5017c 100644 Binary files a/inherit_graph_51.png and b/inherit_graph_51.png differ diff --git a/inherit_graph_52.map b/inherit_graph_52.map index 18d4090c..1a2a3836 100644 --- a/inherit_graph_52.map +++ b/inherit_graph_52.map @@ -1,27 +1,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/inherit_graph_52.md5 b/inherit_graph_52.md5 index 08a49cf5..54a30c4d 100644 --- a/inherit_graph_52.md5 +++ b/inherit_graph_52.md5 @@ -1 +1 @@ -e4445773b5106a04d2bf2621be8f242a \ No newline at end of file +1f37fdf36af1f7a4626fdb6e529e6fce \ No newline at end of file diff --git a/inherit_graph_52.png b/inherit_graph_52.png index 73fd6ca2..cca1320d 100644 Binary files a/inherit_graph_52.png and b/inherit_graph_52.png differ diff --git a/inherit_graph_53.map b/inherit_graph_53.map index 1afdcd61..c8040b18 100644 --- a/inherit_graph_53.map +++ b/inherit_graph_53.map @@ -1,7 +1,29 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inherit_graph_53.md5 b/inherit_graph_53.md5 index 9e0b9eae..bbdef3a1 100644 --- a/inherit_graph_53.md5 +++ b/inherit_graph_53.md5 @@ -1 +1 @@ -0ffd2b6d2b4510d83bb6613deb8d2a78 \ No newline at end of file +b6eb6599ec3fa784957794c8b757b828 \ No newline at end of file diff --git a/inherit_graph_53.png b/inherit_graph_53.png index 0ef1f944..f3a83859 100644 Binary files a/inherit_graph_53.png and b/inherit_graph_53.png differ diff --git a/inherit_graph_54.map b/inherit_graph_54.map new file mode 100644 index 00000000..1afdcd61 --- /dev/null +++ b/inherit_graph_54.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/inherit_graph_54.md5 b/inherit_graph_54.md5 new file mode 100644 index 00000000..9e0b9eae --- /dev/null +++ b/inherit_graph_54.md5 @@ -0,0 +1 @@ +0ffd2b6d2b4510d83bb6613deb8d2a78 \ No newline at end of file diff --git a/inherit_graph_54.png b/inherit_graph_54.png new file mode 100644 index 00000000..0ef1f944 Binary files /dev/null and b/inherit_graph_54.png differ diff --git a/inherits.html b/inherits.html index d0926ddb..07fc3fd0 100644 --- a/inherits.html +++ b/inherits.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Class Hierarchy + @@ -31,7 +32,7 @@ - + @@ -73,7 +74,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -270,39 +271,43 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - + + + + + - + - + - + - + - + - + - + - + - + @@ -312,7 +317,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/jquery.js b/jquery.js index 6aa2e4c2..1f4d0b47 100644 --- a/jquery.js +++ b/jquery.js @@ -13,27 +13,56 @@ * * Date: Mon Nov 21 21:11:03 2011 -0500 */ -(function(bb,L){var av=bb.document,bu=bb.navigator,bl=bb.location;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bb.jQuery,bH=bb.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
    a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
    ";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
    t
    ";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
    ";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType; -if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); +(function(bb,L){var av=bb.document,bu=bb.navigator,bl=bb.location;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bb.jQuery,bH=bb.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
    a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
    ";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
    t
    ";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
    ";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); /*! * Sizzle CSS Selector Engine * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ -(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1 -},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

    ";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
    ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},ac=a(av); -ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
    ","
    "]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length; -if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
    ").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b -})}})(window); -/*! +(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

    ";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
    ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/
    ",""],legend:[1,"
    ","
    "],thead:[1,"
    ","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
    ","
    "]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
    ").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/*! + * jQuery UI 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! + * jQuery UI Widget 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! + * jQuery UI Mouse 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
    ');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! + * jQuery hashchange event - v1.3 - 7/21/2010 + * http://benalman.com/projects/jquery-hashchange-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$(' + + + +
    +
    +
    tty_features Member List
    +
    +
    + +

    This is the complete list of members for tty_features, including all inherited members.

    +
    + + + + + + + +
    autoflow_DSRtty_features
    autoflow_RTStty_features
    autoflow_XONtty_features
    enhancedtty_features
    half_duplextty_features
    ttytty_features
    widetty_features
    + + + + diff --git a/structtty__features.html b/structtty__features.html new file mode 100644 index 00000000..da33e44f --- /dev/null +++ b/structtty__features.html @@ -0,0 +1,246 @@ + + + + + + +USB Host Shield 2.0: tty_features Struct Reference + + + + + + + + + + + +
    +
    + + + + + + +
    +
    USB Host Shield 2.0 +
    +
    +
    + + + + + + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    tty_features Struct Reference
    +
    +
    + +

    #include <cdcacm.h>

    + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    union {
       uint8_t   tty
     
       struct {
          bool   enhanced: 1
     
          bool   wide: 1
     
          bool   autoflow_RTS: 1
     
          bool   autoflow_DSR: 1
     
          bool   autoflow_XON: 1
     
          bool   half_duplex: 1
     
       } 
     
    }; 
     
    +

    Detailed Description

    +

    This structure is used to report the extended capabilities of the connected device. It is also used to report the current status. Regular CDC-ACM reports all as false.

    + +

    Definition at line 143 of file cdcacm.h.

    +

    Member Data Documentation

    + +
    +
    + + + + +
    uint8_t tty_features::tty
    +
    + +

    Definition at line 146 of file cdcacm.h.

    + +
    +
    + +
    +
    + + + + +
    bool tty_features::enhanced
    +
    + +

    Definition at line 149 of file cdcacm.h.

    + +
    +
    + +
    +
    + + + + +
    bool tty_features::wide
    +
    + +

    Definition at line 152 of file cdcacm.h.

    + +
    +
    + +
    +
    + + + + +
    bool tty_features::autoflow_RTS
    +
    + +

    Definition at line 153 of file cdcacm.h.

    + +
    +
    + +
    +
    + + + + +
    bool tty_features::autoflow_DSR
    +
    + +

    Definition at line 154 of file cdcacm.h.

    + +
    +
    + +
    +
    + + + + +
    bool tty_features::autoflow_XON
    +
    + +

    Definition at line 155 of file cdcacm.h.

    + +
    +
    + +
    +
    + + + + +
    bool tty_features::half_duplex
    +
    + +

    Definition at line 156 of file cdcacm.h.

    + +
    +
    + +
    +
    + + + + +
    union { ... }
    +
    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/union_p_s4_buttons-members.html b/union_p_s4_buttons-members.html index 9451cd2c..a6bcd886 100644 --- a/union_p_s4_buttons-members.html +++ b/union_p_s4_buttons-members.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@ - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -112,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/union_p_s4_buttons.html b/union_p_s4_buttons.html index 891c0bd5..1a0b6895 100644 --- a/union_p_s4_buttons.html +++ b/union_p_s4_buttons.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: PS4Buttons Union Reference + @@ -31,7 +32,7 @@
    - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -95,41 +96,41 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Attributes

    struct {
       uint8_t   dpad: 4
     
       uint8_t   square: 1
     
       uint8_t   cross: 1
     
       uint8_t   circle: 1
     
       uint8_t   triangle: 1
     
       uint8_t   l1: 1
     
       uint8_t   r1: 1
     
       uint8_t   l2: 1
     
       uint8_t   r2: 1
     
       uint8_t   share: 1
     
       uint8_t   options: 1
     
       uint8_t   l3: 1
     
       uint8_t   r3: 1
     
       uint8_t   ps: 1
     
       uint8_t   touchpad: 1
     
       uint8_t   reportCounter: 6
     
    }; 
     
    struct {
       uint8_t   dpad: 4
     
       uint8_t   square: 1
     
       uint8_t   cross: 1
     
       uint8_t   circle: 1
     
       uint8_t   triangle: 1
     
       uint8_t   l1: 1
     
       uint8_t   r1: 1
     
       uint8_t   l2: 1
     
       uint8_t   r2: 1
     
       uint8_t   share: 1
     
       uint8_t   options: 1
     
       uint8_t   l3: 1
     
       uint8_t   r3: 1
     
       uint8_t   ps: 1
     
       uint8_t   touchpad: 1
     
       uint8_t   reportCounter: 6
     
    }; 
     
    uint32_t val: 24
     
    @@ -361,7 +362,7 @@ Public Attributes
    - +
    @@ -395,7 +396,7 @@ Public Attributes diff --git a/union_p_s_b_u_z_z_buttons-members.html b/union_p_s_b_u_z_z_buttons-members.html index 7116f7f8..7e9ba56d 100644 --- a/union_p_s_b_u_z_z_buttons-members.html +++ b/union_p_s_b_u_z_z_buttons-members.html @@ -3,15 +3,16 @@ - +USB Host Shield 2.0: Member List + @@ -31,7 +32,7 @@
    - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
    +
    @@ -91,7 +92,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

    This is the complete list of members for PSBUZZButtons, including all inherited members.

    - + @@ -102,7 +103,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/union_p_s_b_u_z_z_buttons.html b/union_p_s_b_u_z_z_buttons.html index 060a5b64..4c822d51 100644 --- a/union_p_s_b_u_z_z_buttons.html +++ b/union_p_s_b_u_z_z_buttons.html @@ -3,15 +3,16 @@ - +USB Host Shield 2.0: PSBUZZButtons Union Reference + @@ -31,7 +32,7 @@
    bluePSBUZZButtons
    btnPSBUZZButtons
    btnPSBUZZButtons
    greenPSBUZZButtons
    orangePSBUZZButtons
    redPSBUZZButtons
    - + @@ -72,7 +73,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -95,19 +96,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - - - - - - - - - - - - - + + + + + + + + + + + + +

    Public Attributes

    struct {
       uint8_t   red: 1
     
       uint8_t   yellow: 1
     
       uint8_t   green: 1
     
       uint8_t   orange: 1
     
       uint8_t   blue: 1
     
    btn [4]
     
    struct {
       uint8_t   red: 1
     
       uint8_t   yellow: 1
     
       uint8_t   green: 1
     
       uint8_t   orange: 1
     
       uint8_t   blue: 1
     
    btn [4]
     
    uint32_t val: 20
     
    @@ -186,7 +187,7 @@ Public Attributes
    - +
    @@ -220,7 +221,7 @@ Public Attributes diff --git a/usb__ch9_8h.html b/usb__ch9_8h.html index 3917d368..9698e710 100644 --- a/usb__ch9_8h.html +++ b/usb__ch9_8h.html @@ -3,15 +3,16 @@ - +USB Host Shield 2.0: usb_ch9.h File Reference + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
    +
    @@ -887,7 +888,7 @@ Macros diff --git a/usb__ch9_8h_source.html b/usb__ch9_8h_source.html index 119419ce..94e96d08 100644 --- a/usb__ch9_8h_source.html +++ b/usb__ch9_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: usb_ch9.h Source File + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -151,17 +152,17 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    60 
    61 /* USB descriptors */
    62 
    -
    63 #define USB_DESCRIPTOR_DEVICE 0x01 // bDescriptorType for a Device Descriptor.
    -
    64 #define USB_DESCRIPTOR_CONFIGURATION 0x02 // bDescriptorType for a Configuration Descriptor.
    -
    65 #define USB_DESCRIPTOR_STRING 0x03 // bDescriptorType for a String Descriptor.
    -
    66 #define USB_DESCRIPTOR_INTERFACE 0x04 // bDescriptorType for an Interface Descriptor.
    -
    67 #define USB_DESCRIPTOR_ENDPOINT 0x05 // bDescriptorType for an Endpoint Descriptor.
    -
    68 #define USB_DESCRIPTOR_DEVICE_QUALIFIER 0x06 // bDescriptorType for a Device Qualifier.
    -
    69 #define USB_DESCRIPTOR_OTHER_SPEED 0x07 // bDescriptorType for a Other Speed Configuration.
    -
    70 #define USB_DESCRIPTOR_INTERFACE_POWER 0x08 // bDescriptorType for Interface Power.
    -
    71 #define USB_DESCRIPTOR_OTG 0x09 // bDescriptorType for an OTG Descriptor.
    +
    63 #define USB_DESCRIPTOR_DEVICE 0x01 // bDescriptorType for a Device Descriptor.
    +
    64 #define USB_DESCRIPTOR_CONFIGURATION 0x02 // bDescriptorType for a Configuration Descriptor.
    +
    65 #define USB_DESCRIPTOR_STRING 0x03 // bDescriptorType for a String Descriptor.
    +
    66 #define USB_DESCRIPTOR_INTERFACE 0x04 // bDescriptorType for an Interface Descriptor.
    +
    67 #define USB_DESCRIPTOR_ENDPOINT 0x05 // bDescriptorType for an Endpoint Descriptor.
    +
    68 #define USB_DESCRIPTOR_DEVICE_QUALIFIER 0x06 // bDescriptorType for a Device Qualifier.
    +
    69 #define USB_DESCRIPTOR_OTHER_SPEED 0x07 // bDescriptorType for a Other Speed Configuration.
    +
    70 #define USB_DESCRIPTOR_INTERFACE_POWER 0x08 // bDescriptorType for Interface Power.
    +
    71 #define USB_DESCRIPTOR_OTG 0x09 // bDescriptorType for an OTG Descriptor.
    72 
    -
    73 #define HID_DESCRIPTOR_HID 0x21
    +
    73 #define HID_DESCRIPTOR_HID 0x21
    74 
    75 
    76 
    @@ -312,7 +313,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/usbhost_8h.html b/usbhost_8h.html index 8543887c..f7b8d37e 100644 --- a/usbhost_8h.html +++ b/usbhost_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: usbhost.h File Reference + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -126,7 +127,7 @@ Enumerations -

    Definition at line 81 of file usbhost.h.

    +

    Definition at line 104 of file usbhost.h.

    @@ -135,7 +136,7 @@ Enumerations diff --git a/usbhost_8h_source.html b/usbhost_8h_source.html index 72668e0b..0907c205 100644 --- a/usbhost_8h_source.html +++ b/usbhost_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: usbhost.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -121,484 +122,561 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    30 /* SPI initialization */
    31 template< typename SPI_CLK, typename SPI_MOSI, typename SPI_MISO, typename SPI_SS > class SPi {
    32 public:
    -
    33 #if USING_SPI4TEENSY3
    +
    33 #if SPI_HAS_TRANSACTION
    34  static void init() {
    -
    35  // spi4teensy3 inits everything for us, except /SS
    -
    36  // CLK, MOSI and MISO are hard coded for now.
    -
    37  // spi4teensy3::init(0,0,0); // full speed, cpol 0, cpha 0
    -
    38  spi4teensy3::init(); // full speed, cpol 0, cpha 0
    -
    39  SPI_SS::SetDirWrite();
    -
    40  SPI_SS::Set();
    -
    41  }
    -
    42 #elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)
    -
    43  static void init() {
    -
    44  SPI_SS::SetDirWrite();
    -
    45  SPI_SS::Set();
    -
    46  SPI.begin();
    -
    47  SPI.setClockDivider(4); // Set speed to 84MHz/4=21MHz - the MAX3421E can handle up to 26MHz
    -
    48  }
    -
    49 #else
    -
    50  static void init() {
    -
    51  //uint8_t tmp;
    -
    52  SPI_CLK::SetDirWrite();
    -
    53  SPI_MOSI::SetDirWrite();
    -
    54  SPI_MISO::SetDirRead();
    -
    55  SPI_SS::SetDirWrite();
    -
    56  /* mode 00 (CPOL=0, CPHA=0) master, fclk/2. Mode 11 (CPOL=11, CPHA=11) is also supported by MAX3421E */
    -
    57  SPCR = 0x50;
    -
    58  SPSR = 0x01; // 0x01
    -
    59 
    -
    60  //tmp = SPSR;
    -
    61  //tmp = SPDR;
    +
    35  SPI.begin(); // The SPI library with transaction will take care of setting up the pins - settings is set in beginTransaction()
    +
    36  }
    +
    37 #elif USING_SPI4TEENSY3
    +
    38  static void init() {
    +
    39  // spi4teensy3 inits everything for us, except /SS
    +
    40  // CLK, MOSI and MISO are hard coded for now.
    +
    41  // spi4teensy3::init(0,0,0); // full speed, cpol 0, cpha 0
    +
    42  spi4teensy3::init(); // full speed, cpol 0, cpha 0
    +
    43  SPI_SS::SetDirWrite();
    +
    44  SPI_SS::Set();
    +
    45  }
    +
    46 #elif !defined(SPDR)
    +
    47  static void init() {
    +
    48  SPI_SS::SetDirWrite();
    +
    49  SPI_SS::Set();
    +
    50  SPI.begin();
    +
    51 #if defined(__MIPSEL__)
    +
    52  SPI.setClockDivider(1);
    +
    53 #elif defined(__ARDUINO_X86__)
    +
    54  #ifdef SPI_CLOCK_1M // Hack used to check if setClockSpeed is available
    +
    55  SPI.setClockSpeed(12000000); // The MAX3421E can handle up to 26MHz, but in practice this was the maximum that I could reliably use
    +
    56  #else
    +
    57  SPI.setClockDivider(SPI_CLOCK_DIV2); // This will set the SPI frequency to 8MHz - it could be higher, but it is not supported in the old API
    +
    58  #endif
    +
    59 #else
    +
    60  SPI.setClockDivider(4); // Set speed to 84MHz/4=21MHz - the MAX3421E can handle up to 26MHz
    +
    61 #endif
    62  }
    -
    63 #endif
    -
    64 };
    -
    65 
    -
    66 /* SPI pin definitions. see avrpins.h */
    -
    67 #if defined(__AVR_ATmega1280__) || (__AVR_ATmega2560__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
    -
    68 typedef SPi< Pb1, Pb2, Pb3, Pb0 > spi;
    -
    69 #elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
    -
    70 typedef SPi< Pb5, Pb3, Pb4, Pb2 > spi;
    -
    71 #elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)
    -
    72 typedef SPi< Pb7, Pb5, Pb6, Pb4 > spi;
    -
    73 #elif defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__))
    -
    74 typedef SPi< P13, P11, P12, P10 > spi;
    -
    75 #elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)
    -
    76 typedef SPi< P76, P75, P74, P10 > spi;
    -
    77 #else
    -
    78 #error "No SPI entry in usbhost.h"
    -
    79 #endif
    -
    80 
    -
    81 typedef enum {
    -
    82  vbus_on = 0,
    - -
    84 } VBUS_t;
    -
    85 
    -
    86 template< typename SPI_SS, typename INTR > class MAX3421e /* : public spi */ {
    -
    87  static uint8_t vbusState;
    -
    88 
    -
    89 public:
    -
    90  MAX3421e();
    -
    91  void regWr(uint8_t reg, uint8_t data);
    -
    92  uint8_t* bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p);
    -
    93  void gpioWr(uint8_t data);
    -
    94  uint8_t regRd(uint8_t reg);
    -
    95  uint8_t* bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p);
    -
    96  uint8_t gpioRd();
    -
    97  uint16_t reset();
    -
    98  int8_t Init();
    -
    99  int8_t Init(int mseconds);
    -
    100 
    -
    101  void vbusPower(VBUS_t state) {
    -
    102  regWr(rPINCTL, (bmFDUPSPI | bmINTLEVEL | state));
    -
    103  }
    -
    104 
    -
    105  uint8_t getVbusState(void) {
    -
    106  return vbusState;
    -
    107  };
    -
    108  void busprobe();
    -
    109  uint8_t GpxHandler();
    -
    110  uint8_t IntHandler();
    -
    111  uint8_t Task();
    -
    112 };
    -
    113 
    -
    114 template< typename SPI_SS, typename INTR >
    - -
    116 
    -
    117 /* constructor */
    -
    118 template< typename SPI_SS, typename INTR >
    - -
    120  // Leaving ADK hardware setup in here, for now. This really belongs with the other parts.
    -
    121 #ifdef BOARD_MEGA_ADK
    -
    122  // For Mega ADK, which has a Max3421e on-board, set MAX_RESET to output mode, and then set it to HIGH
    -
    123  P55::SetDirWrite();
    -
    124  P55::Set();
    -
    125 #endif
    -
    126 };
    +
    63 #elif defined(RBL_NRF51822)
    +
    64  static void init() {
    +
    65  SPI_SS::SetDirWrite();
    +
    66  SPI_SS::Set();
    +
    67  SPI.begin();
    +
    68  // SPI.setFrequency(SPI_FREQUENCY_8M);
    +
    69  }
    +
    70 #else
    +
    71  static void init() {
    +
    72  //uint8_t tmp;
    +
    73  SPI_CLK::SetDirWrite();
    +
    74  SPI_MOSI::SetDirWrite();
    +
    75  SPI_MISO::SetDirRead();
    +
    76  SPI_SS::SetDirWrite();
    +
    77  /* mode 00 (CPOL=0, CPHA=0) master, fclk/2. Mode 11 (CPOL=11, CPHA=11) is also supported by MAX3421E */
    +
    78  SPCR = 0x50;
    +
    79  SPSR = 0x01; // 0x01
    +
    80 
    +
    81  //tmp = SPSR;
    +
    82  //tmp = SPDR;
    +
    83  }
    +
    84 #endif
    +
    85 };
    +
    86 
    +
    87 /* SPI pin definitions. see avrpins.h */
    +
    88 #if defined(__AVR_ATmega1280__) || (__AVR_ATmega2560__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
    +
    89 typedef SPi< Pb1, Pb2, Pb3, Pb0 > spi;
    +
    90 #elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
    +
    91 typedef SPi< Pb5, Pb3, Pb4, Pb2 > spi;
    +
    92 #elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)
    +
    93 typedef SPi< Pb7, Pb5, Pb6, Pb4 > spi;
    +
    94 #elif (defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__))) || defined(__ARDUINO_X86__) || defined(__MIPSEL__)
    +
    95 typedef SPi< P13, P11, P12, P10 > spi;
    +
    96 #elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)
    +
    97 typedef SPi< P76, P75, P74, P10 > spi;
    +
    98 #elif defined(RBL_NRF51822)
    +
    99 typedef SPi< P16, P18, P17, P10 > spi;
    +
    100 #else
    +
    101 #error "No SPI entry in usbhost.h"
    +
    102 #endif
    +
    103 
    +
    104 typedef enum {
    +
    105  vbus_on = 0,
    + +
    107 } VBUS_t;
    +
    108 
    +
    109 template< typename SPI_SS, typename INTR > class MAX3421e /* : public spi */ {
    +
    110  static uint8_t vbusState;
    +
    111 
    +
    112 public:
    +
    113  MAX3421e();
    +
    114  void regWr(uint8_t reg, uint8_t data);
    +
    115  uint8_t* bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p);
    +
    116  void gpioWr(uint8_t data);
    +
    117  uint8_t regRd(uint8_t reg);
    +
    118  uint8_t* bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p);
    +
    119  uint8_t gpioRd();
    +
    120  uint16_t reset();
    +
    121  int8_t Init();
    +
    122  int8_t Init(int mseconds);
    +
    123 
    +
    124  void vbusPower(VBUS_t state) {
    +
    125  regWr(rPINCTL, (bmFDUPSPI | bmINTLEVEL | state));
    +
    126  }
    127 
    -
    128 /* write single byte into MAX3421 register */
    -
    129 template< typename SPI_SS, typename INTR >
    -
    130 void MAX3421e< SPI_SS, INTR >::regWr(uint8_t reg, uint8_t data) {
    - -
    132  SPI_SS::Clear();
    -
    133 #if USING_SPI4TEENSY3
    -
    134  uint8_t c[2];
    -
    135  c[0] = reg | 0x02;
    -
    136  c[1] = data;
    -
    137  spi4teensy3::send(c, 2);
    -
    138 #elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)
    -
    139  SPI.transfer(reg | 0x02);
    -
    140  SPI.transfer(data);
    -
    141 #else
    -
    142  SPDR = (reg | 0x02);
    -
    143  while(!(SPSR & (1 << SPIF)));
    -
    144  SPDR = data;
    -
    145  while(!(SPSR & (1 << SPIF)));
    -
    146 #endif
    -
    147  SPI_SS::Set();
    - -
    149  return;
    -
    150 };
    -
    151 /* multiple-byte write */
    -
    152 
    -
    153 /* returns a pointer to memory position after last written */
    -
    154 template< typename SPI_SS, typename INTR >
    -
    155 uint8_t* MAX3421e< SPI_SS, INTR >::bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p) {
    - -
    157  SPI_SS::Clear();
    -
    158 #if USING_SPI4TEENSY3
    -
    159  spi4teensy3::send(reg | 0x02);
    -
    160  spi4teensy3::send(data_p, nbytes);
    -
    161  data_p += nbytes;
    -
    162 #elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)
    -
    163  SPI.transfer(reg | 0x02);
    -
    164  while(nbytes) {
    -
    165  SPI.transfer(*data_p);
    -
    166  nbytes--;
    -
    167  data_p++; // advance data pointer
    -
    168  }
    -
    169 #else
    -
    170  SPDR = (reg | 0x02); //set WR bit and send register number
    -
    171  while(nbytes) {
    -
    172  while(!(SPSR & (1 << SPIF))); //check if previous byte was sent
    -
    173  SPDR = (*data_p); // send next data byte
    -
    174  nbytes--;
    -
    175  data_p++; // advance data pointer
    -
    176  }
    +
    128  uint8_t getVbusState(void) {
    +
    129  return vbusState;
    +
    130  };
    +
    131  void busprobe();
    +
    132  uint8_t GpxHandler();
    +
    133  uint8_t IntHandler();
    +
    134  uint8_t Task();
    +
    135 };
    +
    136 
    +
    137 template< typename SPI_SS, typename INTR >
    + +
    139 
    +
    140 /* constructor */
    +
    141 template< typename SPI_SS, typename INTR >
    + +
    143  // Leaving ADK hardware setup in here, for now. This really belongs with the other parts.
    +
    144 #ifdef BOARD_MEGA_ADK
    +
    145  // For Mega ADK, which has a Max3421e on-board, set MAX_RESET to output mode, and then set it to HIGH
    +
    146  P55::SetDirWrite();
    +
    147  P55::Set();
    +
    148 #endif
    +
    149 };
    +
    150 
    +
    151 /* write single byte into MAX3421 register */
    +
    152 template< typename SPI_SS, typename INTR >
    +
    153 void MAX3421e< SPI_SS, INTR >::regWr(uint8_t reg, uint8_t data) {
    + +
    155 #if SPI_HAS_TRANSACTION
    +
    156  SPI.beginTransaction(SPISettings(26000000, MSBFIRST, SPI_MODE0)); // The MAX3421E can handle up to 26MHz, use MSB First and SPI mode 0
    +
    157 #endif
    +
    158  SPI_SS::Clear();
    +
    159 
    +
    160 #if SPI_HAS_TRANSACTION
    +
    161  uint8_t c[2];
    +
    162  c[0] = reg | 0x02;
    +
    163  c[1] = data;
    +
    164  SPI.transfer(c, 2);
    +
    165 #elif USING_SPI4TEENSY3
    +
    166  uint8_t c[2];
    +
    167  c[0] = reg | 0x02;
    +
    168  c[1] = data;
    +
    169  spi4teensy3::send(c, 2);
    +
    170 #elif !defined(SPDR)
    +
    171  SPI.transfer(reg | 0x02);
    +
    172  SPI.transfer(data);
    +
    173 #else
    +
    174  SPDR = (reg | 0x02);
    +
    175  while(!(SPSR & (1 << SPIF)));
    +
    176  SPDR = data;
    177  while(!(SPSR & (1 << SPIF)));
    178 #endif
    -
    179  SPI_SS::Set();
    - -
    181  return ( data_p);
    -
    182 }
    -
    183 /* GPIO write */
    -
    184 /*GPIO byte is split between 2 registers, so two writes are needed to write one byte */
    -
    185 
    -
    186 /* GPOUT bits are in the low nibble. 0-3 in IOPINS1, 4-7 in IOPINS2 */
    -
    187 template< typename SPI_SS, typename INTR >
    - -
    189  regWr(rIOPINS1, data);
    -
    190  data >>= 4;
    -
    191  regWr(rIOPINS2, data);
    -
    192  return;
    -
    193 }
    -
    194 
    -
    195 /* single host register read */
    -
    196 template< typename SPI_SS, typename INTR >
    -
    197 uint8_t MAX3421e< SPI_SS, INTR >::regRd(uint8_t reg) {
    - -
    199  SPI_SS::Clear();
    -
    200 #if USING_SPI4TEENSY3
    -
    201  spi4teensy3::send(reg);
    -
    202  uint8_t rv = spi4teensy3::receive();
    -
    203  SPI_SS::Set();
    -
    204 #elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)
    -
    205  SPI.transfer(reg);
    -
    206  uint8_t rv = SPI.transfer(0);
    -
    207  SPI_SS::Set();
    -
    208 #else
    -
    209  SPDR = reg;
    -
    210  while(!(SPSR & (1 << SPIF)));
    -
    211  SPDR = 0; //send empty byte
    -
    212  while(!(SPSR & (1 << SPIF)));
    -
    213  SPI_SS::Set();
    -
    214  uint8_t rv = SPDR;
    -
    215 #endif
    - -
    217  return (rv);
    -
    218 }
    -
    219 /* multiple-byte register read */
    -
    220 
    -
    221 /* returns a pointer to a memory position after last read */
    -
    222 template< typename SPI_SS, typename INTR >
    -
    223 uint8_t* MAX3421e< SPI_SS, INTR >::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p) {
    - -
    225  SPI_SS::Clear();
    -
    226 #if USING_SPI4TEENSY3
    -
    227  spi4teensy3::send(reg);
    -
    228  spi4teensy3::receive(data_p, nbytes);
    -
    229  data_p += nbytes;
    -
    230 #elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)
    -
    231  SPI.transfer(reg);
    -
    232  while(nbytes) {
    -
    233  *data_p++ = SPI.transfer(0);
    -
    234  nbytes--;
    -
    235  }
    -
    236 #else
    -
    237  SPDR = reg;
    -
    238  while(!(SPSR & (1 << SPIF))); //wait
    -
    239  while(nbytes) {
    -
    240  SPDR = 0; //send empty byte
    -
    241  nbytes--;
    -
    242  while(!(SPSR & (1 << SPIF)));
    -
    243 #if 0
    -
    244  {
    -
    245  *data_p = SPDR;
    -
    246  printf("%2.2x ", *data_p);
    -
    247  }
    -
    248  data_p++;
    -
    249  }
    -
    250  printf("\r\n");
    -
    251 #else
    -
    252  *data_p++ = SPDR;
    -
    253  }
    -
    254 #endif
    -
    255 #endif
    -
    256  SPI_SS::Set();
    - -
    258  return ( data_p);
    -
    259 }
    -
    260 /* GPIO read. See gpioWr for explanation */
    -
    261 
    -
    262 /* GPIN pins are in high nibbles of IOPINS1, IOPINS2 */
    -
    263 template< typename SPI_SS, typename INTR >
    - -
    265  uint8_t gpin = 0;
    -
    266  gpin = regRd(rIOPINS2); //pins 4-7
    -
    267  gpin &= 0xf0; //clean lower nibble
    -
    268  gpin |= (regRd(rIOPINS1) >> 4); //shift low bits and OR with upper from previous operation.
    -
    269  return ( gpin);
    -
    270 }
    -
    271 
    -
    272 /* reset MAX3421E. Returns number of cycles it took for PLL to stabilize after reset
    -
    273  or zero if PLL haven't stabilized in 65535 cycles */
    -
    274 template< typename SPI_SS, typename INTR >
    - -
    276  uint16_t i = 0;
    -
    277  regWr(rUSBCTL, bmCHIPRES);
    -
    278  regWr(rUSBCTL, 0x00);
    -
    279  while(++i) {
    -
    280  if((regRd(rUSBIRQ) & bmOSCOKIRQ)) {
    -
    281  break;
    -
    282  }
    -
    283  }
    -
    284  return ( i);
    -
    285 }
    -
    286 
    -
    287 /* initialize MAX3421E. Set Host mode, pullups, and stuff. Returns 0 if success, -1 if not */
    -
    288 template< typename SPI_SS, typename INTR >
    - - -
    291  // Moved here.
    -
    292  // you really should not init hardware in the constructor when it involves locks.
    -
    293  // Also avoids the vbus flicker issue confusing some devices.
    -
    294  /* pin and peripheral setup */
    -
    295  SPI_SS::SetDirWrite();
    -
    296  SPI_SS::Set();
    -
    297  spi::init();
    -
    298  INTR::SetDirRead();
    - -
    300  /* MAX3421E - full-duplex SPI, level interrupt */
    -
    301  // GPX pin on. Moved here, otherwise we flicker the vbus.
    -
    302  regWr(rPINCTL, (bmFDUPSPI | bmINTLEVEL));
    -
    303 
    -
    304  if(reset() == 0) { //OSCOKIRQ hasn't asserted in time
    -
    305  return ( -1);
    -
    306  }
    -
    307 
    -
    308  regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST); // set pull-downs, Host
    -
    309 
    -
    310  regWr(rHIEN, bmCONDETIE | bmFRAMEIE); //connection detection
    -
    311 
    -
    312  /* check if device is connected */
    -
    313  regWr(rHCTL, bmSAMPLEBUS); // sample USB bus
    -
    314  while(!(regRd(rHCTL) & bmSAMPLEBUS)); //wait for sample operation to finish
    -
    315 
    -
    316  busprobe(); //check if anything is connected
    -
    317 
    -
    318  regWr(rHIRQ, bmCONDETIRQ); //clear connection detect interrupt
    -
    319  regWr(rCPUCTL, 0x01); //enable interrupt pin
    -
    320 
    -
    321  return ( 0);
    -
    322 }
    -
    323 
    -
    324 /* initialize MAX3421E. Set Host mode, pullups, and stuff. Returns 0 if success, -1 if not */
    -
    325 template< typename SPI_SS, typename INTR >
    -
    326 int8_t MAX3421e< SPI_SS, INTR >::Init(int mseconds) {
    - -
    328  // Moved here.
    -
    329  // you really should not init hardware in the constructor when it involves locks.
    -
    330  // Also avoids the vbus flicker issue confusing some devices.
    -
    331  /* pin and peripheral setup */
    -
    332  SPI_SS::SetDirWrite();
    -
    333  SPI_SS::Set();
    -
    334  spi::init();
    -
    335  INTR::SetDirRead();
    - -
    337  /* MAX3421E - full-duplex SPI, level interrupt, vbus off */
    -
    338  regWr(rPINCTL, (bmFDUPSPI | bmINTLEVEL | GPX_VBDET));
    -
    339 
    -
    340  if(reset() == 0) { //OSCOKIRQ hasn't asserted in time
    -
    341  return ( -1);
    -
    342  }
    -
    343 
    -
    344  // Delay a minimum of 1 second to ensure any capacitors are drained.
    -
    345  // 1 second is required to make sure we do not smoke a Microdrive!
    -
    346  if(mseconds < 1000) mseconds = 1000;
    -
    347  delay(mseconds);
    +
    179 
    +
    180  SPI_SS::Set();
    +
    181 #if SPI_HAS_TRANSACTION
    +
    182  SPI.endTransaction();
    +
    183 #endif
    + +
    185  return;
    +
    186 };
    +
    187 /* multiple-byte write */
    +
    188 
    +
    189 /* returns a pointer to memory position after last written */
    +
    190 template< typename SPI_SS, typename INTR >
    +
    191 uint8_t* MAX3421e< SPI_SS, INTR >::bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p) {
    + +
    193 #if SPI_HAS_TRANSACTION
    +
    194  SPI.beginTransaction(SPISettings(26000000, MSBFIRST, SPI_MODE0)); // The MAX3421E can handle up to 26MHz, use MSB First and SPI mode 0
    +
    195 #endif
    +
    196  SPI_SS::Clear();
    +
    197 
    +
    198 #if SPI_HAS_TRANSACTION
    +
    199  SPI.transfer(reg | 0x02);
    +
    200  SPI.transfer(data_p, nbytes);
    +
    201  data_p += nbytes;
    +
    202 #elif USING_SPI4TEENSY3
    +
    203  spi4teensy3::send(reg | 0x02);
    +
    204  spi4teensy3::send(data_p, nbytes);
    +
    205  data_p += nbytes;
    +
    206 #elif defined(__ARDUINO_X86__)
    +
    207  SPI.transfer(reg | 0x02);
    +
    208  SPI.transferBuffer(data_p, NULL, nbytes);
    +
    209  data_p += nbytes;
    +
    210 #elif !defined(SPDR)
    +
    211  SPI.transfer(reg | 0x02);
    +
    212  while(nbytes) {
    +
    213  SPI.transfer(*data_p);
    +
    214  nbytes--;
    +
    215  data_p++; // advance data pointer
    +
    216  }
    +
    217 #else
    +
    218  SPDR = (reg | 0x02); //set WR bit and send register number
    +
    219  while(nbytes) {
    +
    220  while(!(SPSR & (1 << SPIF))); //check if previous byte was sent
    +
    221  SPDR = (*data_p); // send next data byte
    +
    222  nbytes--;
    +
    223  data_p++; // advance data pointer
    +
    224  }
    +
    225  while(!(SPSR & (1 << SPIF)));
    +
    226 #endif
    +
    227 
    +
    228  SPI_SS::Set();
    +
    229 #if SPI_HAS_TRANSACTION
    +
    230  SPI.endTransaction();
    +
    231 #endif
    + +
    233  return ( data_p);
    +
    234 }
    +
    235 /* GPIO write */
    +
    236 /*GPIO byte is split between 2 registers, so two writes are needed to write one byte */
    +
    237 
    +
    238 /* GPOUT bits are in the low nibble. 0-3 in IOPINS1, 4-7 in IOPINS2 */
    +
    239 template< typename SPI_SS, typename INTR >
    + +
    241  regWr(rIOPINS1, data);
    +
    242  data >>= 4;
    +
    243  regWr(rIOPINS2, data);
    +
    244  return;
    +
    245 }
    +
    246 
    +
    247 /* single host register read */
    +
    248 template< typename SPI_SS, typename INTR >
    +
    249 uint8_t MAX3421e< SPI_SS, INTR >::regRd(uint8_t reg) {
    + +
    251 #if SPI_HAS_TRANSACTION
    +
    252  SPI.beginTransaction(SPISettings(26000000, MSBFIRST, SPI_MODE0)); // The MAX3421E can handle up to 26MHz, use MSB First and SPI mode 0
    +
    253 #endif
    +
    254  SPI_SS::Clear();
    +
    255 
    +
    256 #if !defined(SPDR) || SPI_HAS_TRANSACTION
    +
    257  SPI.transfer(reg);
    +
    258  uint8_t rv = SPI.transfer(0); // Send empty byte
    +
    259  SPI_SS::Set();
    +
    260 #elif USING_SPI4TEENSY3
    +
    261  spi4teensy3::send(reg);
    +
    262  uint8_t rv = spi4teensy3::receive();
    +
    263  SPI_SS::Set();
    +
    264 #else
    +
    265  SPDR = reg;
    +
    266  while(!(SPSR & (1 << SPIF)));
    +
    267  SPDR = 0; // Send empty byte
    +
    268  while(!(SPSR & (1 << SPIF)));
    +
    269  SPI_SS::Set();
    +
    270  uint8_t rv = SPDR;
    +
    271 #endif
    +
    272 
    +
    273 #if SPI_HAS_TRANSACTION
    +
    274  SPI.endTransaction();
    +
    275 #endif
    + +
    277  return (rv);
    +
    278 }
    +
    279 /* multiple-byte register read */
    +
    280 
    +
    281 /* returns a pointer to a memory position after last read */
    +
    282 template< typename SPI_SS, typename INTR >
    +
    283 uint8_t* MAX3421e< SPI_SS, INTR >::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p) {
    + +
    285 #if SPI_HAS_TRANSACTION
    +
    286  SPI.beginTransaction(SPISettings(26000000, MSBFIRST, SPI_MODE0)); // The MAX3421E can handle up to 26MHz, use MSB First and SPI mode 0
    +
    287 #endif
    +
    288  SPI_SS::Clear();
    +
    289 
    +
    290 #if SPI_HAS_TRANSACTION
    +
    291  SPI.transfer(reg);
    +
    292  memset(data_p, 0, nbytes); // Make sure we send out empty bytes
    +
    293  SPI.transfer(data_p, nbytes);
    +
    294  data_p += nbytes;
    +
    295 #elif USING_SPI4TEENSY3
    +
    296  spi4teensy3::send(reg);
    +
    297  spi4teensy3::receive(data_p, nbytes);
    +
    298  data_p += nbytes;
    +
    299 #elif defined(__ARDUINO_X86__)
    +
    300  SPI.transfer(reg);
    +
    301  SPI.transferBuffer(NULL, data_p, nbytes);
    +
    302  data_p += nbytes;
    +
    303 #elif !defined(SPDR)
    +
    304  SPI.transfer(reg);
    +
    305  while(nbytes) {
    +
    306  *data_p++ = SPI.transfer(0);
    +
    307  nbytes--;
    +
    308  }
    +
    309 #else
    +
    310  SPDR = reg;
    +
    311  while(!(SPSR & (1 << SPIF))); //wait
    +
    312  while(nbytes) {
    +
    313  SPDR = 0; // Send empty byte
    +
    314  nbytes--;
    +
    315  while(!(SPSR & (1 << SPIF)));
    +
    316 #if 0
    +
    317  {
    +
    318  *data_p = SPDR;
    +
    319  printf("%2.2x ", *data_p);
    +
    320  }
    +
    321  data_p++;
    +
    322  }
    +
    323  printf("\r\n");
    +
    324 #else
    +
    325  *data_p++ = SPDR;
    +
    326  }
    +
    327 #endif
    +
    328 #endif
    +
    329 
    +
    330  SPI_SS::Set();
    +
    331 #if SPI_HAS_TRANSACTION
    +
    332  SPI.endTransaction();
    +
    333 #endif
    + +
    335  return ( data_p);
    +
    336 }
    +
    337 /* GPIO read. See gpioWr for explanation */
    +
    338 
    +
    339 /* GPIN pins are in high nibbles of IOPINS1, IOPINS2 */
    +
    340 template< typename SPI_SS, typename INTR >
    + +
    342  uint8_t gpin = 0;
    +
    343  gpin = regRd(rIOPINS2); //pins 4-7
    +
    344  gpin &= 0xf0; //clean lower nibble
    +
    345  gpin |= (regRd(rIOPINS1) >> 4); //shift low bits and OR with upper from previous operation.
    +
    346  return ( gpin);
    +
    347 }
    348 
    -
    349  regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST); // set pull-downs, Host
    -
    350 
    -
    351  regWr(rHIEN, bmCONDETIE | bmFRAMEIE); //connection detection
    -
    352 
    -
    353  /* check if device is connected */
    -
    354  regWr(rHCTL, bmSAMPLEBUS); // sample USB bus
    -
    355  while(!(regRd(rHCTL) & bmSAMPLEBUS)); //wait for sample operation to finish
    -
    356 
    -
    357  busprobe(); //check if anything is connected
    -
    358 
    -
    359  regWr(rHIRQ, bmCONDETIRQ); //clear connection detect interrupt
    -
    360  regWr(rCPUCTL, 0x01); //enable interrupt pin
    -
    361 
    -
    362  // GPX pin on. This is done here so that busprobe will fail if we have a switch connected.
    -
    363  regWr(rPINCTL, (bmFDUPSPI | bmINTLEVEL));
    -
    364 
    -
    365  return ( 0);
    -
    366 }
    -
    367 
    -
    368 /* probe bus to determine device presence and speed and switch host to this speed */
    -
    369 template< typename SPI_SS, typename INTR >
    - -
    371  uint8_t bus_sample;
    -
    372  bus_sample = regRd(rHRSL); //Get J,K status
    -
    373  bus_sample &= (bmJSTATUS | bmKSTATUS); //zero the rest of the byte
    -
    374  switch(bus_sample) { //start full-speed or low-speed host
    -
    375  case( bmJSTATUS):
    -
    376  if((regRd(rMODE) & bmLOWSPEED) == 0) {
    -
    377  regWr(rMODE, MODE_FS_HOST); //start full-speed host
    -
    378  vbusState = FSHOST;
    -
    379  } else {
    -
    380  regWr(rMODE, MODE_LS_HOST); //start low-speed host
    -
    381  vbusState = LSHOST;
    -
    382  }
    -
    383  break;
    -
    384  case( bmKSTATUS):
    -
    385  if((regRd(rMODE) & bmLOWSPEED) == 0) {
    -
    386  regWr(rMODE, MODE_LS_HOST); //start low-speed host
    -
    387  vbusState = LSHOST;
    -
    388  } else {
    -
    389  regWr(rMODE, MODE_FS_HOST); //start full-speed host
    -
    390  vbusState = FSHOST;
    -
    391  }
    -
    392  break;
    -
    393  case( bmSE1): //illegal state
    -
    394  vbusState = SE1;
    -
    395  break;
    -
    396  case( bmSE0): //disconnected state
    -
    397  regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST | bmSEPIRQ);
    -
    398  vbusState = SE0;
    -
    399  break;
    -
    400  }//end switch( bus_sample )
    -
    401 }
    -
    402 
    -
    403 /* MAX3421 state change task and interrupt handler */
    -
    404 template< typename SPI_SS, typename INTR >
    - -
    406  uint8_t rcode = 0;
    -
    407  uint8_t pinvalue;
    -
    408  //USB_HOST_SERIAL.print("Vbus state: ");
    -
    409  //USB_HOST_SERIAL.println( vbusState, HEX );
    -
    410  pinvalue = INTR::IsSet(); //Read();
    -
    411  //pinvalue = digitalRead( MAX_INT );
    -
    412  if(pinvalue == 0) {
    -
    413  rcode = IntHandler();
    -
    414  }
    -
    415  // pinvalue = digitalRead( MAX_GPX );
    -
    416  // if( pinvalue == LOW ) {
    -
    417  // GpxHandler();
    -
    418  // }
    -
    419  // usbSM(); //USB state machine
    -
    420  return ( rcode);
    -
    421 }
    -
    422 
    -
    423 template< typename SPI_SS, typename INTR >
    - -
    425  uint8_t HIRQ;
    -
    426  uint8_t HIRQ_sendback = 0x00;
    -
    427  HIRQ = regRd(rHIRQ); //determine interrupt source
    -
    428  //if( HIRQ & bmFRAMEIRQ ) { //->1ms SOF interrupt handler
    -
    429  // HIRQ_sendback |= bmFRAMEIRQ;
    -
    430  //}//end FRAMEIRQ handling
    -
    431  if(HIRQ & bmCONDETIRQ) {
    -
    432  busprobe();
    -
    433  HIRQ_sendback |= bmCONDETIRQ;
    -
    434  }
    -
    435  /* End HIRQ interrupts handling, clear serviced IRQs */
    -
    436  regWr(rHIRQ, HIRQ_sendback);
    -
    437  return ( HIRQ_sendback);
    -
    438 }
    -
    439 //template< typename SPI_SS, typename INTR >
    -
    440 //uint8_t MAX3421e< SPI_SS, INTR >::GpxHandler()
    -
    441 //{
    -
    442 // uint8_t GPINIRQ = regRd( rGPINIRQ ); //read GPIN IRQ register
    -
    449 // return( GPINIRQ );
    -
    450 //}
    -
    451 
    -
    452 #endif //_USBHOST_H_
    -
    #define GPX_VBDET
    Definition: max3421e.h:80
    -
    #define rIOPINS1
    Definition: max3421e.h:86
    -
    void busprobe()
    Definition: usbhost.h:370
    -
    #define rHIEN
    Definition: max3421e.h:153
    -
    #define FSHOST
    Definition: max3421e.h:35
    -
    #define rHCTL
    Definition: max3421e.h:179
    -
    #define bmCONDETIRQ
    Definition: max3421e.h:149
    -
    #define bmCONDETIE
    Definition: max3421e.h:161
    -
    #define bmSE1
    Definition: max3421e.h:209
    -
    #define bmCHIPRES
    Definition: max3421e.h:62
    -
    uint8_t getVbusState(void)
    Definition: usbhost.h:105
    - -
    #define rCPUCTL
    Definition: max3421e.h:65
    -
    #define bmJSTATUS
    Definition: max3421e.h:207
    -
    uint16_t reset()
    Definition: usbhost.h:275
    - -
    #define MODE_LS_HOST
    Definition: max3421e.h:230
    -
    #define bmINTLEVEL
    Definition: max3421e.h:74
    -
    void gpioWr(uint8_t data)
    Definition: usbhost.h:188
    -
    uint8_t Task()
    Definition: usbhost.h:405
    -
    #define rUSBCTL
    Definition: max3421e.h:60
    -
    #define bmSE0
    Definition: max3421e.h:208
    -
    #define bmHOST
    Definition: max3421e.h:168
    -
    #define bmSEPIRQ
    Definition: max3421e.h:172
    -
    uint8_t gpioRd()
    Definition: usbhost.h:264
    -
    int8_t Init()
    Definition: usbhost.h:289
    +
    349 /* reset MAX3421E. Returns number of cycles it took for PLL to stabilize after reset
    +
    350  or zero if PLL haven't stabilized in 65535 cycles */
    +
    351 template< typename SPI_SS, typename INTR >
    + +
    353  uint16_t i = 0;
    +
    354  regWr(rUSBCTL, bmCHIPRES);
    +
    355  regWr(rUSBCTL, 0x00);
    +
    356  while(++i) {
    +
    357  if((regRd(rUSBIRQ) & bmOSCOKIRQ)) {
    +
    358  break;
    +
    359  }
    +
    360  }
    +
    361  return ( i);
    +
    362 }
    +
    363 
    +
    364 /* initialize MAX3421E. Set Host mode, pullups, and stuff. Returns 0 if success, -1 if not */
    +
    365 template< typename SPI_SS, typename INTR >
    + + +
    368  // Moved here.
    +
    369  // you really should not init hardware in the constructor when it involves locks.
    +
    370  // Also avoids the vbus flicker issue confusing some devices.
    +
    371  /* pin and peripheral setup */
    +
    372  SPI_SS::SetDirWrite();
    +
    373  SPI_SS::Set();
    +
    374  spi::init();
    +
    375  INTR::SetDirRead();
    + +
    377  /* MAX3421E - full-duplex SPI, level interrupt */
    +
    378  // GPX pin on. Moved here, otherwise we flicker the vbus.
    +
    379  regWr(rPINCTL, (bmFDUPSPI | bmINTLEVEL));
    +
    380 
    +
    381  if(reset() == 0) { //OSCOKIRQ hasn't asserted in time
    +
    382  return ( -1);
    +
    383  }
    +
    384 
    +
    385  regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST); // set pull-downs, Host
    +
    386 
    +
    387  regWr(rHIEN, bmCONDETIE | bmFRAMEIE); //connection detection
    +
    388 
    +
    389  /* check if device is connected */
    +
    390  regWr(rHCTL, bmSAMPLEBUS); // sample USB bus
    +
    391  while(!(regRd(rHCTL) & bmSAMPLEBUS)); //wait for sample operation to finish
    +
    392 
    +
    393  busprobe(); //check if anything is connected
    +
    394 
    +
    395  regWr(rHIRQ, bmCONDETIRQ); //clear connection detect interrupt
    +
    396  regWr(rCPUCTL, 0x01); //enable interrupt pin
    +
    397 
    +
    398  return ( 0);
    +
    399 }
    +
    400 
    +
    401 /* initialize MAX3421E. Set Host mode, pullups, and stuff. Returns 0 if success, -1 if not */
    +
    402 template< typename SPI_SS, typename INTR >
    +
    403 int8_t MAX3421e< SPI_SS, INTR >::Init(int mseconds) {
    + +
    405  // Moved here.
    +
    406  // you really should not init hardware in the constructor when it involves locks.
    +
    407  // Also avoids the vbus flicker issue confusing some devices.
    +
    408  /* pin and peripheral setup */
    +
    409  SPI_SS::SetDirWrite();
    +
    410  SPI_SS::Set();
    +
    411  spi::init();
    +
    412  INTR::SetDirRead();
    + +
    414  /* MAX3421E - full-duplex SPI, level interrupt, vbus off */
    +
    415  regWr(rPINCTL, (bmFDUPSPI | bmINTLEVEL | GPX_VBDET));
    +
    416 
    +
    417  if(reset() == 0) { //OSCOKIRQ hasn't asserted in time
    +
    418  return ( -1);
    +
    419  }
    +
    420 
    +
    421  // Delay a minimum of 1 second to ensure any capacitors are drained.
    +
    422  // 1 second is required to make sure we do not smoke a Microdrive!
    +
    423  if(mseconds < 1000) mseconds = 1000;
    +
    424  delay(mseconds);
    +
    425 
    +
    426  regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST); // set pull-downs, Host
    +
    427 
    +
    428  regWr(rHIEN, bmCONDETIE | bmFRAMEIE); //connection detection
    +
    429 
    +
    430  /* check if device is connected */
    +
    431  regWr(rHCTL, bmSAMPLEBUS); // sample USB bus
    +
    432  while(!(regRd(rHCTL) & bmSAMPLEBUS)); //wait for sample operation to finish
    +
    433 
    +
    434  busprobe(); //check if anything is connected
    +
    435 
    +
    436  regWr(rHIRQ, bmCONDETIRQ); //clear connection detect interrupt
    +
    437  regWr(rCPUCTL, 0x01); //enable interrupt pin
    +
    438 
    +
    439  // GPX pin on. This is done here so that busprobe will fail if we have a switch connected.
    +
    440  regWr(rPINCTL, (bmFDUPSPI | bmINTLEVEL));
    +
    441 
    +
    442  return ( 0);
    +
    443 }
    +
    444 
    +
    445 /* probe bus to determine device presence and speed and switch host to this speed */
    +
    446 template< typename SPI_SS, typename INTR >
    + +
    448  uint8_t bus_sample;
    +
    449  bus_sample = regRd(rHRSL); //Get J,K status
    +
    450  bus_sample &= (bmJSTATUS | bmKSTATUS); //zero the rest of the byte
    +
    451  switch(bus_sample) { //start full-speed or low-speed host
    +
    452  case( bmJSTATUS):
    +
    453  if((regRd(rMODE) & bmLOWSPEED) == 0) {
    +
    454  regWr(rMODE, MODE_FS_HOST); //start full-speed host
    +
    455  vbusState = FSHOST;
    +
    456  } else {
    +
    457  regWr(rMODE, MODE_LS_HOST); //start low-speed host
    +
    458  vbusState = LSHOST;
    +
    459  }
    +
    460  break;
    +
    461  case( bmKSTATUS):
    +
    462  if((regRd(rMODE) & bmLOWSPEED) == 0) {
    +
    463  regWr(rMODE, MODE_LS_HOST); //start low-speed host
    +
    464  vbusState = LSHOST;
    +
    465  } else {
    +
    466  regWr(rMODE, MODE_FS_HOST); //start full-speed host
    +
    467  vbusState = FSHOST;
    +
    468  }
    +
    469  break;
    +
    470  case( bmSE1): //illegal state
    +
    471  vbusState = SE1;
    +
    472  break;
    +
    473  case( bmSE0): //disconnected state
    +
    474  regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST | bmSEPIRQ);
    +
    475  vbusState = SE0;
    +
    476  break;
    +
    477  }//end switch( bus_sample )
    +
    478 }
    +
    479 
    +
    480 /* MAX3421 state change task and interrupt handler */
    +
    481 template< typename SPI_SS, typename INTR >
    + +
    483  uint8_t rcode = 0;
    +
    484  uint8_t pinvalue;
    +
    485  //USB_HOST_SERIAL.print("Vbus state: ");
    +
    486  //USB_HOST_SERIAL.println( vbusState, HEX );
    +
    487  pinvalue = INTR::IsSet(); //Read();
    +
    488  //pinvalue = digitalRead( MAX_INT );
    +
    489  if(pinvalue == 0) {
    +
    490  rcode = IntHandler();
    +
    491  }
    +
    492  // pinvalue = digitalRead( MAX_GPX );
    +
    493  // if( pinvalue == LOW ) {
    +
    494  // GpxHandler();
    +
    495  // }
    +
    496  // usbSM(); //USB state machine
    +
    497  return ( rcode);
    +
    498 }
    +
    499 
    +
    500 template< typename SPI_SS, typename INTR >
    + +
    502  uint8_t HIRQ;
    +
    503  uint8_t HIRQ_sendback = 0x00;
    +
    504  HIRQ = regRd(rHIRQ); //determine interrupt source
    +
    505  //if( HIRQ & bmFRAMEIRQ ) { //->1ms SOF interrupt handler
    +
    506  // HIRQ_sendback |= bmFRAMEIRQ;
    +
    507  //}//end FRAMEIRQ handling
    +
    508  if(HIRQ & bmCONDETIRQ) {
    +
    509  busprobe();
    +
    510  HIRQ_sendback |= bmCONDETIRQ;
    +
    511  }
    +
    512  /* End HIRQ interrupts handling, clear serviced IRQs */
    +
    513  regWr(rHIRQ, HIRQ_sendback);
    +
    514  return ( HIRQ_sendback);
    +
    515 }
    +
    516 //template< typename SPI_SS, typename INTR >
    +
    517 //uint8_t MAX3421e< SPI_SS, INTR >::GpxHandler()
    +
    518 //{
    +
    519 // uint8_t GPINIRQ = regRd( rGPINIRQ ); //read GPIN IRQ register
    +
    526 // return( GPINIRQ );
    +
    527 //}
    +
    528 
    +
    529 #endif // _USBHOST_H_
    +
    #define GPX_VBDET
    Definition: max3421e.h:75
    +
    #define rIOPINS1
    Definition: max3421e.h:81
    +
    void busprobe()
    Definition: usbhost.h:447
    +
    #define rHIEN
    Definition: max3421e.h:148
    +
    #define FSHOST
    Definition: max3421e.h:30
    +
    #define rHCTL
    Definition: max3421e.h:174
    +
    #define bmCONDETIRQ
    Definition: max3421e.h:144
    +
    #define bmCONDETIE
    Definition: max3421e.h:156
    +
    #define bmSE1
    Definition: max3421e.h:204
    +
    #define bmCHIPRES
    Definition: max3421e.h:57
    +
    uint8_t getVbusState(void)
    Definition: usbhost.h:128
    + +
    #define rCPUCTL
    Definition: max3421e.h:60
    +
    #define bmJSTATUS
    Definition: max3421e.h:202
    +
    uint16_t reset()
    Definition: usbhost.h:352
    + +
    #define MODE_LS_HOST
    Definition: max3421e.h:225
    +
    #define bmINTLEVEL
    Definition: max3421e.h:69
    +
    void gpioWr(uint8_t data)
    Definition: usbhost.h:240
    +
    uint8_t Task()
    Definition: usbhost.h:482
    +
    #define rUSBCTL
    Definition: max3421e.h:55
    +
    #define bmSE0
    Definition: max3421e.h:203
    +
    #define bmHOST
    Definition: max3421e.h:163
    +
    #define bmSEPIRQ
    Definition: max3421e.h:167
    +
    uint8_t gpioRd()
    Definition: usbhost.h:341
    +
    int8_t Init()
    Definition: usbhost.h:366
    uint8_t GpxHandler()
    -
    #define LSHOST
    Definition: max3421e.h:36
    -
    #define rMODE
    Definition: max3421e.h:165
    -
    #define MODE_FS_HOST
    Definition: max3421e.h:229
    -
    void vbusPower(VBUS_t state)
    Definition: usbhost.h:101
    -
    #define bmKSTATUS
    Definition: max3421e.h:206
    -
    #define rHRSL
    Definition: max3421e.h:201
    -
    uint8_t * bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p)
    Definition: usbhost.h:223
    -
    #define XMEM_ACQUIRE_SPI()
    Definition: settings.h:123
    -
    #define bmLOWSPEED
    Definition: max3421e.h:169
    -
    uint8_t * bytesWr(uint8_t reg, uint8_t nbytes, uint8_t *data_p)
    Definition: usbhost.h:155
    +
    #define LSHOST
    Definition: max3421e.h:31
    +
    #define rMODE
    Definition: max3421e.h:160
    +
    #define MODE_FS_HOST
    Definition: max3421e.h:224
    +
    void vbusPower(VBUS_t state)
    Definition: usbhost.h:124
    +
    #define bmKSTATUS
    Definition: max3421e.h:201
    +
    #define rHRSL
    Definition: max3421e.h:196
    +
    uint8_t * bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p)
    Definition: usbhost.h:283
    +
    #define XMEM_ACQUIRE_SPI()
    Definition: settings.h:115
    +
    #define bmLOWSPEED
    Definition: max3421e.h:164
    +
    uint8_t * bytesWr(uint8_t reg, uint8_t nbytes, uint8_t *data_p)
    Definition: usbhost.h:191
    Definition: usbhost.h:31
    -
    #define rHIRQ
    Definition: max3421e.h:142
    -
    #define rUSBIRQ
    Definition: max3421e.h:48
    -
    #define XMEM_RELEASE_SPI()
    Definition: settings.h:124
    -
    #define bmFDUPSPI
    Definition: max3421e.h:73
    -
    #define rPINCTL
    Definition: max3421e.h:71
    -
    VBUS_t
    Definition: usbhost.h:81
    -
    void regWr(uint8_t reg, uint8_t data)
    Definition: usbhost.h:130
    -
    #define bmFRAMEIE
    Definition: max3421e.h:162
    -
    uint8_t IntHandler()
    Definition: usbhost.h:424
    -
    #define bmOSCOKIRQ
    Definition: max3421e.h:52
    -
    uint8_t regRd(uint8_t reg)
    Definition: usbhost.h:197
    -
    MAX3421e()
    Definition: usbhost.h:119
    - -
    #define SE0
    Definition: max3421e.h:33
    -
    #define rIOPINS2
    Definition: max3421e.h:98
    -
    #define bmDMPULLDN
    Definition: max3421e.h:174
    -
    #define SE1
    Definition: max3421e.h:34
    -
    #define bmSAMPLEBUS
    Definition: max3421e.h:183
    -
    static void init()
    Definition: usbhost.h:50
    -
    #define bmDPPULLDN
    Definition: max3421e.h:175
    +
    #define rHIRQ
    Definition: max3421e.h:137
    +
    #define rUSBIRQ
    Definition: max3421e.h:43
    +
    #define XMEM_RELEASE_SPI()
    Definition: settings.h:116
    +
    #define bmFDUPSPI
    Definition: max3421e.h:68
    +
    #define rPINCTL
    Definition: max3421e.h:66
    +
    VBUS_t
    Definition: usbhost.h:104
    +
    void regWr(uint8_t reg, uint8_t data)
    Definition: usbhost.h:153
    +
    #define bmFRAMEIE
    Definition: max3421e.h:157
    +
    uint8_t IntHandler()
    Definition: usbhost.h:501
    +
    #define bmOSCOKIRQ
    Definition: max3421e.h:47
    +
    uint8_t regRd(uint8_t reg)
    Definition: usbhost.h:249
    +
    MAX3421e()
    Definition: usbhost.h:142
    + +
    #define SE0
    Definition: max3421e.h:28
    +
    #define rIOPINS2
    Definition: max3421e.h:93
    +
    #define bmDMPULLDN
    Definition: max3421e.h:169
    +
    #define SE1
    Definition: max3421e.h:29
    +
    #define bmSAMPLEBUS
    Definition: max3421e.h:178
    +
    static void init()
    Definition: usbhost.h:47
    +
    #define bmDPPULLDN
    Definition: max3421e.h:170
    diff --git a/usbhub_8cpp.html b/usbhub_8cpp.html index 0ebd49b8..46de35c1 100644 --- a/usbhub_8cpp.html +++ b/usbhub_8cpp.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: usbhub.cpp File Reference + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -153,7 +154,7 @@ Functions diff --git a/usbhub_8cpp__incl.md5 b/usbhub_8cpp__incl.md5 index 3fe83bc5..10f8250c 100644 --- a/usbhub_8cpp__incl.md5 +++ b/usbhub_8cpp__incl.md5 @@ -1 +1 @@ -7bb3faf4e14385f717626e8dacb74409 \ No newline at end of file +d30f3e0393f05796b3f85b9b895576e7 \ No newline at end of file diff --git a/usbhub_8cpp_source.html b/usbhub_8cpp_source.html index 928319ff..f2c1dbfd 100644 --- a/usbhub_8cpp_source.html +++ b/usbhub_8cpp_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: usbhub.cpp Source File + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -344,9 +345,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    253  // rcode = GetHubStatus(1, 0, 1, 4, buf);
    254  // if (rcode)
    255  // {
    -
    256  // USB_HOST_SERIAL.print("GetHubStatus Error");
    -
    257  // USB_HOST_SERIAL.println(rcode, HEX);
    -
    258  // return rcode;
    +
    256  // USB_HOST_SERIAL.print("GetHubStatus Error");
    +
    257  // USB_HOST_SERIAL.println(rcode, HEX);
    +
    258  // return rcode;
    259  // }
    260  //}
    261  for(uint8_t port = 1, mask = 0x02; port < 8; mask <<= 1, port++) {
    @@ -514,7 +515,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    423  USB_HOST_SERIAL.print("RESET:\t\t");
    424  USB_HOST_SERIAL.println((evt.bmChange & bmHUB_PORT_STATUS_C_PORT_RESET) > 0, DEC);
    425 }
    -
    uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
    Definition: Usb.cpp:766
    +
    uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
    Definition: Usb.cpp:769
    #define bmHUB_PORT_STATE_CHECK_DISABLED
    Definition: usbhub.h:119
    #define bmHUB_PORT_EVENT_LS_RESET_COMPLETE
    Definition: usbhub.h:130
    @@ -522,7 +523,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    #define bmHUB_PORT_STATUS_C_PORT_SUSPEND
    Definition: usbhub.h:90
    EpInfo * epinfo
    Definition: address.h:76
    bool lowspeed
    Definition: address.h:79
    -
    #define USB_ERROR_EPINFO_IS_NULL
    Definition: UsbCore.h:81
    +
    #define USB_ERROR_EPINFO_IS_NULL
    Definition: UsbCore.h:83
    uint8_t bmNakPower
    Definition: address.h:42
    uint16_t bmChange
    Definition: usbhub.h:157
    @@ -534,21 +535,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    #define bmHUB_PORT_STATUS_PORT_SUSPEND
    Definition: usbhub.h:78
    #define HUB_FEATURE_C_PORT_RESET
    Definition: usbhub.h:58
    #define bmHUB_PORT_STATUS_PORT_OVER_CURRENT
    Definition: usbhub.h:79
    -
    uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
    Definition: Usb.cpp:805
    -
    virtual void ResetHubPort(uint8_t port)
    Definition: usbhub.cpp:307
    +
    uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
    Definition: Usb.cpp:808
    +
    void ResetHubPort(uint8_t port)
    Definition: usbhub.cpp:307
    uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
    Definition: Usb.cpp:64
    virtual void FreeAddress(uint8_t addr)=0
    #define bmHUB_PORT_STATUS_C_PORT_ENABLE
    Definition: usbhub.h:89
    uint8_t epAttribs
    Definition: address.h:37
    virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
    uint8_t bNbrPorts
    Definition: usbhub.h:136
    -
    uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
    Definition: Usb.cpp:796
    +
    uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
    Definition: Usb.cpp:799
    #define USB_HOST_SERIAL
    Definition: settings.h:34
    uint8_t epAddr
    Definition: address.h:33
    #define USB_NAK_MAX_POWER
    Definition: address.h:27
    #define bmHUB_PORT_STATE_DISABLED
    Definition: usbhub.h:122
    -
    void SetHubPreMask()
    Definition: UsbCore.h:198
    +
    void SetHubPreMask()
    Definition: UsbCore.h:205
    uint8_t GetHubDescriptor(uint8_t index, uint16_t nbytes, uint8_t *dataptr)
    Definition: usbhub.h:221
    #define bmHUB_PORT_STATUS_PORT_POWER
    Definition: usbhub.h:81
    @@ -560,10 +561,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint32_t bmEvent
    Definition: usbhub.h:159
    virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
    -
    #define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
    Definition: UsbCore.h:83
    +
    #define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
    Definition: UsbCore.h:85
    #define bmHUB_PORT_STATUS_C_PORT_RESET
    Definition: usbhub.h:92
    uint8_t bDeviceClass
    Definition: usb_ch9.h:102
    -
    virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
    Definition: usbhub.cpp:42
    +
    uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
    Definition: usbhub.cpp:42
    Definition: usbhub.h:164
    uint16_t bmStatus
    Definition: usbhub.h:156
    #define HUB_FEATURE_C_PORT_CONNECTION
    Definition: usbhub.h:54
    @@ -572,23 +573,23 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint8_t bmAddress
    Definition: address.h:62
    #define USB_NAK_NOWAIT
    Definition: address.h:29
    #define bmHUB_PORT_STATUS_PORT_RESET
    Definition: usbhub.h:80
    -
    #define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
    Definition: UsbCore.h:80
    +
    #define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
    Definition: UsbCore.h:82
    uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
    Definition: Usb.cpp:206
    -
    #define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
    Definition: UsbCore.h:75
    +
    #define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
    Definition: UsbCore.h:77
    uint8_t bmParent
    Definition: address.h:63
    uint8_t GetPortStatus(uint8_t port, uint16_t nbytes, uint8_t *dataptr)
    Definition: usbhub.h:231
    #define bmHUB_PORT_EVENT_CONNECT
    Definition: usbhub.h:125
    -
    virtual uint8_t Release()
    Definition: usbhub.cpp:214
    +
    uint8_t Release()
    Definition: usbhub.cpp:214
    #define HUB_FEATURE_PORT_RESET
    Definition: usbhub.h:51
    -
    #define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
    Definition: UsbCore.h:78
    +
    #define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
    Definition: UsbCore.h:80
    #define bmHUB_PORT_STATUS_PORT_ENABLE
    Definition: usbhub.h:77
    uint8_t maxPktSize
    Definition: address.h:34
    -
    AddressPool & GetAddressPool()
    Definition: UsbCore.h:206
    +
    AddressPool & GetAddressPool()
    Definition: UsbCore.h:213
    uint8_t Configuring(uint8_t parent, uint8_t port, bool lowspeed)
    Definition: Usb.cpp:652
    -
    Definition: UsbCore.h:190
    +
    Definition: UsbCore.h:197
    uint8_t evtBuff[4]
    Definition: usbhub.h:160
    #define bmHUB_PORT_STATUS_PORT_INDICATOR
    Definition: usbhub.h:85
    -
    uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
    Definition: UsbCore.h:210
    +
    uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
    Definition: UsbCore.h:217
    #define bmHUB_PORT_STATUS_PORT_TEST
    Definition: usbhub.h:84
    #define bmHUB_PORT_EVENT_LS_CONNECT
    Definition: usbhub.h:129
    @@ -597,11 +598,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint8_t SetPortFeature(uint8_t fid, uint8_t port, uint8_t sel=0)
    Definition: usbhub.h:246
    #define HUB_FEATURE_C_PORT_ENABLE
    Definition: usbhub.h:55
    #define USBTRACE(s)
    Definition: macros.h:75
    -
    uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
    defined(USB_METHODS_INLINE)
    Definition: Usb.cpp:761
    +
    uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
    defined(USB_METHODS_INLINE)
    Definition: Usb.cpp:764
    uint8_t bmHub
    Definition: address.h:64
    -
    virtual uint8_t Poll()
    Definition: usbhub.cpp:227
    +
    uint8_t Poll()
    Definition: usbhub.cpp:227
    USBHub(USB *p)
    Definition: usbhub.cpp:21
    -
    uint8_t ReleaseDevice(uint8_t addr)
    Definition: Usb.cpp:746
    +
    uint8_t ReleaseDevice(uint8_t addr)
    Definition: Usb.cpp:749
    #define bmHUB_PORT_EVENT_DISCONNECT
    Definition: usbhub.h:126
    @@ -610,7 +611,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/usbhub_8h.html b/usbhub_8h.html index ca051af9..1cc917d8 100644 --- a/usbhub_8h.html +++ b/usbhub_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: usbhub.h File Reference + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -260,23 +261,23 @@ Macros   #define HUB_ERROR_PORT_HAS_BEEN_RESET   0xb1   -#define bmHUB_PORT_STATUS_ALL_MAIN   ((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE | bmHUB_PORT_STATUS_C_PORT_SUSPEND | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_SUSPEND) +#define bmHUB_PORT_STATUS_ALL_MAIN   ((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE | bmHUB_PORT_STATUS_C_PORT_SUSPEND | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_SUSPEND)   #define bmHUB_PORT_STATE_CHECK_DISABLED   (0x0000 | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_SUSPEND)   #define bmHUB_PORT_STATE_DISABLED   (0x0000 | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION)   -#define bmHUB_PORT_EVENT_CONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION) +#define bmHUB_PORT_EVENT_CONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION)   -#define bmHUB_PORT_EVENT_DISCONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER) +#define bmHUB_PORT_EVENT_DISCONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER)   -#define bmHUB_PORT_EVENT_RESET_COMPLETE   (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION) +#define bmHUB_PORT_EVENT_RESET_COMPLETE   (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION)   -#define bmHUB_PORT_EVENT_LS_CONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED) +#define bmHUB_PORT_EVENT_LS_CONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)   -#define bmHUB_PORT_EVENT_LS_RESET_COMPLETE   (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED) +#define bmHUB_PORT_EVENT_LS_RESET_COMPLETE   (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)   -#define bmHUB_PORT_EVENT_LS_PORT_ENABLED   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED) +#define bmHUB_PORT_EVENT_LS_PORT_ENABLED   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)  

    @@ -1256,7 +1257,7 @@ Functions

    - +
    #define bmHUB_PORT_STATUS_ALL_MAIN   ((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE | bmHUB_PORT_STATUS_C_PORT_SUSPEND | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_SUSPEND)#define bmHUB_PORT_STATUS_ALL_MAIN   ((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE | bmHUB_PORT_STATUS_C_PORT_SUSPEND | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_SUSPEND)
    @@ -1298,7 +1299,7 @@ Functions
    - +
    #define bmHUB_PORT_EVENT_CONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION)#define bmHUB_PORT_EVENT_CONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION)
    @@ -1312,7 +1313,7 @@ Functions
    - +
    #define bmHUB_PORT_EVENT_DISCONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER)#define bmHUB_PORT_EVENT_DISCONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER)
    @@ -1326,7 +1327,7 @@ Functions
    - +
    #define bmHUB_PORT_EVENT_RESET_COMPLETE   (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION)#define bmHUB_PORT_EVENT_RESET_COMPLETE   (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION)
    @@ -1340,7 +1341,7 @@ Functions
    - +
    #define bmHUB_PORT_EVENT_LS_CONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)#define bmHUB_PORT_EVENT_LS_CONNECT   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)
    @@ -1354,7 +1355,7 @@ Functions
    - +
    #define bmHUB_PORT_EVENT_LS_RESET_COMPLETE   (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)#define bmHUB_PORT_EVENT_LS_RESET_COMPLETE   (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)
    @@ -1368,7 +1369,7 @@ Functions
    - +
    #define bmHUB_PORT_EVENT_LS_PORT_ENABLED   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)#define bmHUB_PORT_EVENT_LS_PORT_ENABLED   (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)
    @@ -1421,7 +1422,7 @@ Functions diff --git a/usbhub_8h__dep__incl.md5 b/usbhub_8h__dep__incl.md5 index ba39f868..f8e4934f 100644 --- a/usbhub_8h__dep__incl.md5 +++ b/usbhub_8h__dep__incl.md5 @@ -1 +1 @@ -f7805dd5aebe658aba38ee12c3ade2e3 \ No newline at end of file +600ba6d376b8fce703e559892c09ebf2 \ No newline at end of file diff --git a/usbhub_8h__incl.md5 b/usbhub_8h__incl.md5 index aadc2324..2966a465 100644 --- a/usbhub_8h__incl.md5 +++ b/usbhub_8h__incl.md5 @@ -1 +1 @@ -72cfd5a19df6b412213ae2c7400f96e8 \ No newline at end of file +dd1f2b59c87dcda8d5477cdc57930370 \ No newline at end of file diff --git a/usbhub_8h_source.html b/usbhub_8h_source.html index 11a1b9a7..55610232 100644 --- a/usbhub_8h_source.html +++ b/usbhub_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: usbhub.h Source File + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
    +
    @@ -110,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    19 
    20 #include "Usb.h"
    21 
    -
    22 #define USB_DESCRIPTOR_HUB 0x09 // Hub descriptor type
    +
    22 #define USB_DESCRIPTOR_HUB 0x09 // Hub descriptor type
    23 
    24 // Hub Requests
    25 #define bmREQ_CLEAR_HUB_FEATURE USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_DEVICE
    @@ -164,62 +165,62 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    73 #define HUB_PORT_INDICATOR_OFF 3
    74 
    75 // Hub Port Status Bitmasks
    -
    76 #define bmHUB_PORT_STATUS_PORT_CONNECTION 0x0001
    -
    77 #define bmHUB_PORT_STATUS_PORT_ENABLE 0x0002
    -
    78 #define bmHUB_PORT_STATUS_PORT_SUSPEND 0x0004
    -
    79 #define bmHUB_PORT_STATUS_PORT_OVER_CURRENT 0x0008
    -
    80 #define bmHUB_PORT_STATUS_PORT_RESET 0x0010
    -
    81 #define bmHUB_PORT_STATUS_PORT_POWER 0x0100
    -
    82 #define bmHUB_PORT_STATUS_PORT_LOW_SPEED 0x0200
    -
    83 #define bmHUB_PORT_STATUS_PORT_HIGH_SPEED 0x0400
    -
    84 #define bmHUB_PORT_STATUS_PORT_TEST 0x0800
    -
    85 #define bmHUB_PORT_STATUS_PORT_INDICATOR 0x1000
    +
    76 #define bmHUB_PORT_STATUS_PORT_CONNECTION 0x0001
    +
    77 #define bmHUB_PORT_STATUS_PORT_ENABLE 0x0002
    +
    78 #define bmHUB_PORT_STATUS_PORT_SUSPEND 0x0004
    +
    79 #define bmHUB_PORT_STATUS_PORT_OVER_CURRENT 0x0008
    +
    80 #define bmHUB_PORT_STATUS_PORT_RESET 0x0010
    +
    81 #define bmHUB_PORT_STATUS_PORT_POWER 0x0100
    +
    82 #define bmHUB_PORT_STATUS_PORT_LOW_SPEED 0x0200
    +
    83 #define bmHUB_PORT_STATUS_PORT_HIGH_SPEED 0x0400
    +
    84 #define bmHUB_PORT_STATUS_PORT_TEST 0x0800
    +
    85 #define bmHUB_PORT_STATUS_PORT_INDICATOR 0x1000
    86 
    87 // Hub Port Status Change Bitmasks (used one byte instead of two)
    -
    88 #define bmHUB_PORT_STATUS_C_PORT_CONNECTION 0x0001
    -
    89 #define bmHUB_PORT_STATUS_C_PORT_ENABLE 0x0002
    -
    90 #define bmHUB_PORT_STATUS_C_PORT_SUSPEND 0x0004
    +
    88 #define bmHUB_PORT_STATUS_C_PORT_CONNECTION 0x0001
    +
    89 #define bmHUB_PORT_STATUS_C_PORT_ENABLE 0x0002
    +
    90 #define bmHUB_PORT_STATUS_C_PORT_SUSPEND 0x0004
    91 #define bmHUB_PORT_STATUS_C_PORT_OVER_CURRENT 0x0008
    -
    92 #define bmHUB_PORT_STATUS_C_PORT_RESET 0x0010
    +
    92 #define bmHUB_PORT_STATUS_C_PORT_RESET 0x0010
    93 
    94 // Hub Status Bitmasks (used one byte instead of two)
    -
    95 #define bmHUB_STATUS_LOCAL_POWER_SOURCE 0x01
    -
    96 #define bmHUB_STATUS_OVER_CURRENT 0x12
    +
    95 #define bmHUB_STATUS_LOCAL_POWER_SOURCE 0x01
    +
    96 #define bmHUB_STATUS_OVER_CURRENT 0x12
    97 
    98 // Hub Status Change Bitmasks (used one byte instead of two)
    -
    99 #define bmHUB_STATUS_C_LOCAL_POWER_SOURCE 0x01
    -
    100 #define bmHUB_STATUS_C_OVER_CURRENT 0x12
    +
    99 #define bmHUB_STATUS_C_LOCAL_POWER_SOURCE 0x01
    +
    100 #define bmHUB_STATUS_C_OVER_CURRENT 0x12
    101 
    102 
    103 // Hub Port Configuring Substates
    -
    104 #define USB_STATE_HUB_PORT_CONFIGURING 0xb0
    -
    105 #define USB_STATE_HUB_PORT_POWERED_OFF 0xb1
    +
    104 #define USB_STATE_HUB_PORT_CONFIGURING 0xb0
    +
    105 #define USB_STATE_HUB_PORT_POWERED_OFF 0xb1
    106 #define USB_STATE_HUB_PORT_WAIT_FOR_POWER_GOOD 0xb2
    -
    107 #define USB_STATE_HUB_PORT_DISCONNECTED 0xb3
    -
    108 #define USB_STATE_HUB_PORT_DISABLED 0xb4
    -
    109 #define USB_STATE_HUB_PORT_RESETTING 0xb5
    -
    110 #define USB_STATE_HUB_PORT_ENABLED 0xb6
    +
    107 #define USB_STATE_HUB_PORT_DISCONNECTED 0xb3
    +
    108 #define USB_STATE_HUB_PORT_DISABLED 0xb4
    +
    109 #define USB_STATE_HUB_PORT_RESETTING 0xb5
    +
    110 #define USB_STATE_HUB_PORT_ENABLED 0xb6
    111 
    112 // Additional Error Codes
    -
    113 #define HUB_ERROR_PORT_HAS_BEEN_RESET 0xb1
    +
    113 #define HUB_ERROR_PORT_HAS_BEEN_RESET 0xb1
    114 
    115 // The bit mask to check for all necessary state bits
    -
    116 #define bmHUB_PORT_STATUS_ALL_MAIN ((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE | bmHUB_PORT_STATUS_C_PORT_SUSPEND | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_SUSPEND)
    +
    116 #define bmHUB_PORT_STATUS_ALL_MAIN ((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE | bmHUB_PORT_STATUS_C_PORT_SUSPEND | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_SUSPEND)
    117 
    118 // Bit mask to check for DISABLED state in HubEvent::bmStatus field
    -
    119 #define bmHUB_PORT_STATE_CHECK_DISABLED (0x0000 | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_SUSPEND)
    +
    119 #define bmHUB_PORT_STATE_CHECK_DISABLED (0x0000 | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_SUSPEND)
    120 
    121 // Hub Port States
    -
    122 #define bmHUB_PORT_STATE_DISABLED (0x0000 | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION)
    +
    122 #define bmHUB_PORT_STATE_DISABLED (0x0000 | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION)
    123 
    124 // Hub Port Events
    -
    125 #define bmHUB_PORT_EVENT_CONNECT (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION)
    -
    126 #define bmHUB_PORT_EVENT_DISCONNECT (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER)
    -
    127 #define bmHUB_PORT_EVENT_RESET_COMPLETE (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION)
    +
    125 #define bmHUB_PORT_EVENT_CONNECT (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION)
    +
    126 #define bmHUB_PORT_EVENT_DISCONNECT (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER)
    +
    127 #define bmHUB_PORT_EVENT_RESET_COMPLETE (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION)
    128 
    -
    129 #define bmHUB_PORT_EVENT_LS_CONNECT (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)
    -
    130 #define bmHUB_PORT_EVENT_LS_RESET_COMPLETE (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)
    -
    131 #define bmHUB_PORT_EVENT_LS_PORT_ENABLED (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)
    +
    129 #define bmHUB_PORT_EVENT_LS_CONNECT (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)
    +
    130 #define bmHUB_PORT_EVENT_LS_RESET_COMPLETE (((0UL | bmHUB_PORT_STATUS_C_PORT_RESET) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)
    +
    131 #define bmHUB_PORT_EVENT_LS_PORT_ENABLED (((0UL | bmHUB_PORT_STATUS_C_PORT_CONNECTION | bmHUB_PORT_STATUS_C_PORT_ENABLE) << 16) | bmHUB_PORT_STATUS_PORT_POWER | bmHUB_PORT_STATUS_PORT_ENABLE | bmHUB_PORT_STATUS_PORT_CONNECTION | bmHUB_PORT_STATUS_PORT_LOW_SPEED)
    132 
    134  uint8_t bDescLength; // descriptor length
    @@ -282,16 +283,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    191 
    192  void PrintHubStatus();
    193 
    -
    194  virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
    -
    195  virtual uint8_t Release();
    -
    196  virtual uint8_t Poll();
    -
    197  virtual void ResetHubPort(uint8_t port);
    +
    194  uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed);
    +
    195  uint8_t Release();
    +
    196  uint8_t Poll();
    +
    197  void ResetHubPort(uint8_t port);
    198 
    199  virtual uint8_t GetAddress() {
    200  return bAddress;
    201  };
    202 
    -
    203  virtual boolean DEVCLASSOK(uint8_t klass) {
    +
    203  virtual bool DEVCLASSOK(uint8_t klass) {
    204  return (klass == 0x09);
    205  }
    206 
    @@ -348,10 +349,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint8_t SetHubDescriptor(uint8_t port, uint16_t nbytes, uint8_t *dataptr)
    Definition: usbhub.h:236
    #define USB_REQUEST_CLEAR_FEATURE
    Definition: usb_ch9.h:34
    #define USB_REQUEST_GET_DESCRIPTOR
    Definition: usb_ch9.h:37
    -
    virtual void ResetHubPort(uint8_t port)
    Definition: usbhub.cpp:307
    +
    virtual bool DEVCLASSOK(uint8_t klass)
    Definition: usbhub.h:203
    +
    void ResetHubPort(uint8_t port)
    Definition: usbhub.cpp:307
    uint16_t OverCurrentProtectMode
    Definition: usbhub.h:141
    -
    virtual boolean DEVCLASSOK(uint8_t klass)
    Definition: usbhub.h:203
    - +
    #define bmREQ_GET_HUB_DESCRIPTOR
    Definition: usbhub.h:28
    uint8_t GetHubStatus(uint16_t nbytes, uint8_t *dataptr)
    Definition: usbhub.h:226
    @@ -372,7 +373,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint32_t bmEvent
    Definition: usbhub.h:159
    uint8_t bDescriptorType
    Definition: usbhub.h:135
    uint16_t PortIndicatorsSupported
    Definition: usbhub.h:143
    -
    virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
    Definition: usbhub.cpp:42
    +
    uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
    Definition: usbhub.cpp:42
    Definition: usbhub.h:164
    uint16_t bmStatus
    Definition: usbhub.h:156
    #define bmREQ_SET_HUB_DESCRIPTOR
    Definition: usbhub.h:32
    @@ -383,8 +384,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    uint16_t Reserved
    Definition: usbhub.h:144
    uint8_t GetPortStatus(uint8_t port, uint16_t nbytes, uint8_t *dataptr)
    Definition: usbhub.h:231
    uint16_t TTThinkTime
    Definition: usbhub.h:142
    -
    virtual uint8_t Release()
    Definition: usbhub.cpp:214
    -
    Definition: UsbCore.h:190
    +
    uint8_t Release()
    Definition: usbhub.cpp:214
    +
    Definition: UsbCore.h:197
    uint8_t evtBuff[4]
    Definition: usbhub.h:160
    uint16_t CompoundDevice
    Definition: usbhub.h:140
    uint16_t LogPwrSwitchMode
    Definition: usbhub.h:139
    @@ -392,14 +393,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    void PrintHubStatus()
    #define bmREQ_GET_PORT_STATUS
    Definition: usbhub.h:30
    uint8_t SetPortFeature(uint8_t fid, uint8_t port, uint8_t sel=0)
    Definition: usbhub.h:246
    -
    virtual uint8_t Poll()
    Definition: usbhub.cpp:227
    +
    uint8_t Poll()
    Definition: usbhub.cpp:227
    USBHub(USB *p)
    Definition: usbhub.cpp:21
    diff --git a/version__helper_8h.html b/version__helper_8h.html new file mode 100644 index 00000000..09f52012 --- /dev/null +++ b/version__helper_8h.html @@ -0,0 +1,1645 @@ + + + + + + +USB Host Shield 2.0: version_helper.h File Reference + + + + + + + + + + + +
    +
    + + + + + + +
    +
    USB Host Shield 2.0 +
    +
    +
    + + + + + + +
    +
    + + +
    + +
    + + +
    +
    + +
    +
    version_helper.h File Reference
    +
    +
    +
    #include <Arduino.h>
    +#include <inttypes.h>
    +
    +Include dependency graph for version_helper.h:
    +
    +
    +
    +
    +This graph shows which files directly or indirectly include this file:
    +
    +
    + + +
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Macros

    #define __PGMSPACE_H_   1
     
    #define PGM_P   const char *
     
    #define PSTR(str)   (str)
     
    #define F(str)   (str)
     
    #define _SFR_BYTE(n)   (n)
     
    #define memchr_P(str, c, len)   memchr((str), (c), (len))
     
    #define memcmp_P(a, b, n)   memcmp((a), (b), (n))
     
    #define memcpy_P(dest, src, num)   memcpy((dest), (src), (num))
     
    #define memmem_P(a, alen, b, blen)   memmem((a), (alen), (b), (blen))
     
    #define memrchr_P(str, val, len)   memrchr((str), (val), (len))
     
    #define strcat_P(dest, src)   strcat((dest), (src))
     
    #define strchr_P(str, c)   strchr((str), (c))
     
    #define strchrnul_P(str, c)   strchrnul((str), (c))
     
    #define strcmp_P(a, b)   strcmp((a), (b))
     
    #define strcpy_P(dest, src)   strcpy((dest), (src))
     
    #define strcasecmp_P(a, b)   strcasecmp((a), (b))
     
    #define strcasestr_P(a, b)   strcasestr((a), (b))
     
    #define strlcat_P(dest, src, len)   strlcat((dest), (src), (len))
     
    #define strlcpy_P(dest, src, len)   strlcpy((dest), (src), (len))
     
    #define strlen_P(s)   strlen((const char *)(s))
     
    #define strnlen_P(str, len)   strnlen((str), (len))
     
    #define strncmp_P(a, b, n)   strncmp((a), (b), (n))
     
    #define strncasecmp_P(a, b, n)   strncasecmp((a), (b), (n))
     
    #define strncat_P(a, b, n)   strncat((a), (b), (n))
     
    #define strncpy_P(a, b, n)   strncmp((a), (b), (n))
     
    #define strpbrk_P(str, chrs)   strpbrk((str), (chrs))
     
    #define strrchr_P(str, c)   strrchr((str), (c))
     
    #define strsep_P(strp, delim)   strsep((strp), (delim))
     
    #define strspn_P(str, chrs)   strspn((str), (chrs))
     
    #define strstr_P(a, b)   strstr((a), (b))
     
    #define sprintf_P(s, ...)   sprintf((s), __VA_ARGS__)
     
    #define vfprintf_P(s, ...)   vfprintf((s), __VA_ARGS__)
     
    #define printf_P(...)   printf(__VA_ARGS__)
     
    #define snprintf_P(s, n, ...)   ((s), (n), __VA_ARGS__)
     
    #define vsprintf_P(s, ...)   ((s),__VA_ARGS__)
     
    #define vsnprintf_P(s, n, ...)   ((s), (n),__VA_ARGS__)
     
    #define fprintf_P(s, ...)   ((s), __VA_ARGS__)
     
    #define pgm_read_byte(addr)   (*(const unsigned char *)(addr))
     
    #define pgm_read_word(addr)   (*(const unsigned short *)(addr))
     
    #define pgm_read_dword(addr)   (*(const unsigned long *)(addr))
     
    #define pgm_read_float(addr)   (*(const float *)(addr))
     
    #define pgm_read_byte_near(addr)   pgm_read_byte(addr)
     
    #define pgm_read_word_near(addr)   pgm_read_word(addr)
     
    #define pgm_read_dword_near(addr)   pgm_read_dword(addr)
     
    #define pgm_read_float_near(addr)   pgm_read_float(addr)
     
    #define pgm_read_byte_far(addr)   pgm_read_byte(addr)
     
    #define pgm_read_word_far(addr)   pgm_read_word(addr)
     
    #define pgm_read_dword_far(addr)   pgm_read_dword(addr)
     
    #define pgm_read_float_far(addr)   pgm_read_float(addr)
     
    #define pgm_read_pointer
     
    + + + + + + + + + + + + + + + + + + + +

    +Typedefs

    typedef void prog_void
     
    typedef char prog_char
     
    typedef unsigned char prog_uchar
     
    typedef int8_t prog_int8_t
     
    typedef uint8_t prog_uint8_t
     
    typedef int16_t prog_int16_t
     
    typedef uint16_t prog_uint16_t
     
    typedef int32_t prog_int32_t
     
    typedef uint32_t prog_uint32_t
     
    +

    Macro Definition Documentation

    + +
    +
    + + + + +
    #define __PGMSPACE_H_   1
    +
    + +

    Definition at line 36 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + +
    #define PGM_P   const char *
    +
    + +

    Definition at line 44 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define PSTR( str)   (str)
    +
    + +

    Definition at line 47 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define F( str)   (str)
    +
    + +

    Definition at line 50 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define _SFR_BYTE( n)   (n)
    +
    + +

    Definition at line 53 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define memchr_P( str,
     c,
     len 
    )   memchr((str), (c), (len))
    +
    + +

    Definition at line 85 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define memcmp_P( a,
     b,
     
    )   memcmp((a), (b), (n))
    +
    + +

    Definition at line 88 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define memcpy_P( dest,
     src,
     num 
    )   memcpy((dest), (src), (num))
    +
    + +

    Definition at line 91 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #define memmem_P( a,
     alen,
     b,
     blen 
    )   memmem((a), (alen), (b), (blen))
    +
    + +

    Definition at line 94 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define memrchr_P( str,
     val,
     len 
    )   memrchr((str), (val), (len))
    +
    + +

    Definition at line 97 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strcat_P( dest,
     src 
    )   strcat((dest), (src))
    +
    + +

    Definition at line 100 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strchr_P( str,
     
    )   strchr((str), (c))
    +
    + +

    Definition at line 103 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strchrnul_P( str,
     
    )   strchrnul((str), (c))
    +
    + +

    Definition at line 106 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strcmp_P( a,
     
    )   strcmp((a), (b))
    +
    + +

    Definition at line 109 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strcpy_P( dest,
     src 
    )   strcpy((dest), (src))
    +
    + +

    Definition at line 112 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strcasecmp_P( a,
     
    )   strcasecmp((a), (b))
    +
    + +

    Definition at line 115 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strcasestr_P( a,
     
    )   strcasestr((a), (b))
    +
    + +

    Definition at line 118 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define strlcat_P( dest,
     src,
     len 
    )   strlcat((dest), (src), (len))
    +
    + +

    Definition at line 121 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define strlcpy_P( dest,
     src,
     len 
    )   strlcpy((dest), (src), (len))
    +
    + +

    Definition at line 124 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define strlen_P( s)   strlen((const char *)(s))
    +
    + +

    Definition at line 127 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strnlen_P( str,
     len 
    )   strnlen((str), (len))
    +
    + +

    Definition at line 130 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define strncmp_P( a,
     b,
     
    )   strncmp((a), (b), (n))
    +
    + +

    Definition at line 133 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define strncasecmp_P( a,
     b,
     
    )   strncasecmp((a), (b), (n))
    +
    + +

    Definition at line 136 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define strncat_P( a,
     b,
     
    )   strncat((a), (b), (n))
    +
    + +

    Definition at line 139 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define strncpy_P( a,
     b,
     
    )   strncmp((a), (b), (n))
    +
    + +

    Definition at line 142 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strpbrk_P( str,
     chrs 
    )   strpbrk((str), (chrs))
    +
    + +

    Definition at line 145 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strrchr_P( str,
     
    )   strrchr((str), (c))
    +
    + +

    Definition at line 148 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strsep_P( strp,
     delim 
    )   strsep((strp), (delim))
    +
    + +

    Definition at line 151 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strspn_P( str,
     chrs 
    )   strspn((str), (chrs))
    +
    + +

    Definition at line 154 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define strstr_P( a,
     
    )   strstr((a), (b))
    +
    + +

    Definition at line 157 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define sprintf_P( s,
     ... 
    )   sprintf((s), __VA_ARGS__)
    +
    + +

    Definition at line 160 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define vfprintf_P( s,
     ... 
    )   vfprintf((s), __VA_ARGS__)
    +
    + +

    Definition at line 163 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define printf_P( ...)   printf(__VA_ARGS__)
    +
    + +

    Definition at line 166 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define snprintf_P( s,
     n,
     ... 
    )   ((s), (n), __VA_ARGS__)
    +
    + +

    Definition at line 169 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define vsprintf_P( s,
     ... 
    )   ((s),__VA_ARGS__)
    +
    + +

    Definition at line 172 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    #define vsnprintf_P( s,
     n,
     ... 
    )   ((s), (n),__VA_ARGS__)
    +
    + +

    Definition at line 175 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    #define fprintf_P( s,
     ... 
    )   ((s), __VA_ARGS__)
    +
    + +

    Definition at line 178 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_byte( addr)   (*(const unsigned char *)(addr))
    +
    + +

    Definition at line 182 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_word( addr)   (*(const unsigned short *)(addr))
    +
    + +

    Definition at line 185 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_dword( addr)   (*(const unsigned long *)(addr))
    +
    + +

    Definition at line 188 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_float( addr)   (*(const float *)(addr))
    +
    + +

    Definition at line 191 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_byte_near( addr)   pgm_read_byte(addr)
    +
    + +

    Definition at line 195 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_word_near( addr)   pgm_read_word(addr)
    +
    + +

    Definition at line 198 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_dword_near( addr)   pgm_read_dword(addr)
    +
    + +

    Definition at line 201 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_float_near( addr)   pgm_read_float(addr)
    +
    + +

    Definition at line 204 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_byte_far( addr)   pgm_read_byte(addr)
    +
    + +

    Definition at line 207 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_word_far( addr)   pgm_read_word(addr)
    +
    + +

    Definition at line 210 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_dword_far( addr)   pgm_read_dword(addr)
    +
    + +

    Definition at line 213 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + + + + + +
    #define pgm_read_float_far( addr)   pgm_read_float(addr)
    +
    + +

    Definition at line 216 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + +
    #define pgm_read_pointer
    +
    + +

    Definition at line 220 of file version_helper.h.

    + +
    +
    +

    Typedef Documentation

    + +
    +
    + + + + +
    typedef void prog_void
    +
    + +

    Definition at line 57 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + +
    typedef char prog_char
    +
    + +

    Definition at line 60 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + +
    typedef unsigned char prog_uchar
    +
    + +

    Definition at line 63 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + +
    typedef int8_t prog_int8_t
    +
    + +

    Definition at line 66 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + +
    typedef uint8_t prog_uint8_t
    +
    + +

    Definition at line 69 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + +
    typedef int16_t prog_int16_t
    +
    + +

    Definition at line 72 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + +
    typedef uint16_t prog_uint16_t
    +
    + +

    Definition at line 75 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + +
    typedef int32_t prog_int32_t
    +
    + +

    Definition at line 78 of file version_helper.h.

    + +
    +
    + +
    +
    + + + + +
    typedef uint32_t prog_uint32_t
    +
    + +

    Definition at line 81 of file version_helper.h.

    + +
    +
    +
    + + + + diff --git a/version__helper_8h__dep__incl.map b/version__helper_8h__dep__incl.map new file mode 100644 index 00000000..455934d4 --- /dev/null +++ b/version__helper_8h__dep__incl.map @@ -0,0 +1,3 @@ + + + diff --git a/version__helper_8h__dep__incl.md5 b/version__helper_8h__dep__incl.md5 new file mode 100644 index 00000000..f62c3636 --- /dev/null +++ b/version__helper_8h__dep__incl.md5 @@ -0,0 +1 @@ +7ffd9ab4c1f44f6844779ea69abf203a \ No newline at end of file diff --git a/version__helper_8h__dep__incl.png b/version__helper_8h__dep__incl.png new file mode 100644 index 00000000..e5506bb5 Binary files /dev/null and b/version__helper_8h__dep__incl.png differ diff --git a/version__helper_8h__incl.map b/version__helper_8h__incl.map new file mode 100644 index 00000000..a1a74984 --- /dev/null +++ b/version__helper_8h__incl.map @@ -0,0 +1,2 @@ + + diff --git a/version__helper_8h__incl.md5 b/version__helper_8h__incl.md5 new file mode 100644 index 00000000..9317a64a --- /dev/null +++ b/version__helper_8h__incl.md5 @@ -0,0 +1 @@ +b5906582666204e62305ef43411e2ee1 \ No newline at end of file diff --git a/version__helper_8h__incl.png b/version__helper_8h__incl.png new file mode 100644 index 00000000..d1b650d8 Binary files /dev/null and b/version__helper_8h__incl.png differ diff --git a/version__helper_8h_source.html b/version__helper_8h_source.html new file mode 100644 index 00000000..8f7203a7 --- /dev/null +++ b/version__helper_8h_source.html @@ -0,0 +1,332 @@ + + + + + + +USB Host Shield 2.0: version_helper.h Source File + + + + + + + + + + + +
    +
    + + + + + + +
    +
    USB Host Shield 2.0 +
    +
    +
    + + + + + + +
    +
    + + +
    + +
    + + +
    +
    +
    +
    version_helper.h
    +
    +
    +Go to the documentation of this file.
    1 /* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved.
    +
    2 
    +
    3 This software may be distributed and modified under the terms of the GNU
    +
    4 General Public License version 2 (GPL2) as published by the Free Software
    +
    5 Foundation and appearing in the file GPL2.TXT included in the packaging of
    +
    6 this file. Please note that GPL2 Section 2[b] requires that all works based
    +
    7 on this software must also be made publicly available under the terms of
    +
    8 the GPL2 ("Copyleft").
    +
    9 
    +
    10 Contact information
    +
    11 -------------------
    +
    12 
    +
    13 Circuits At Home, LTD
    +
    14 Web : http://www.circuitsathome.com
    +
    15 e-mail : support@circuitsathome.com
    +
    16  */
    +
    17 
    +
    18 /*
    +
    19  * Universal Arduino(tm) "IDE" fixups.
    +
    20  * Includes fixes for versions as low as 0023, used by Digilent.
    +
    21  */
    +
    22 
    +
    23 #if defined(ARDUINO) && ARDUINO >=100
    +
    24 #include <Arduino.h>
    +
    25 #else
    +
    26 #include <WProgram.h>
    +
    27 #include <pins_arduino.h>
    +
    28 #ifdef __AVR__
    +
    29 #include <avr/pgmspace.h>
    +
    30 #include <avr/io.h>
    +
    31 #else
    +
    32 #endif
    +
    33 #endif
    +
    34 
    +
    35 #ifndef __PGMSPACE_H_
    +
    36 #define __PGMSPACE_H_ 1
    +
    37 
    +
    38 #include <inttypes.h>
    +
    39 
    +
    40 #ifndef PROGMEM
    +
    41 #define PROGMEM
    +
    42 #endif
    +
    43 #ifndef PGM_P
    +
    44 #define PGM_P const char *
    +
    45 #endif
    +
    46 #ifndef PSTR
    +
    47 #define PSTR(str) (str)
    +
    48 #endif
    +
    49 #ifndef F
    +
    50 #define F(str) (str)
    +
    51 #endif
    +
    52 #ifndef _SFR_BYTE
    +
    53 #define _SFR_BYTE(n) (n)
    +
    54 #endif
    +
    55 
    +
    56 #ifndef prog_void
    +
    57 typedef void prog_void;
    +
    58 #endif
    +
    59 #ifndef prog_char
    +
    60 typedef char prog_char;
    +
    61 #endif
    +
    62 #ifndef prog_uchar
    +
    63 typedef unsigned char prog_uchar;
    +
    64 #endif
    +
    65 #ifndef prog_int8_t
    +
    66 typedef int8_t prog_int8_t;
    +
    67 #endif
    +
    68 #ifndef prog_uint8_t
    +
    69 typedef uint8_t prog_uint8_t;
    +
    70 #endif
    +
    71 #ifndef prog_int16_t
    +
    72 typedef int16_t prog_int16_t;
    +
    73 #endif
    +
    74 #ifndef prog_uint16_t
    +
    75 typedef uint16_t prog_uint16_t;
    +
    76 #endif
    +
    77 #ifndef prog_int32_t
    +
    78 typedef int32_t prog_int32_t;
    +
    79 #endif
    +
    80 #ifndef prog_uint32_t
    +
    81 typedef uint32_t prog_uint32_t;
    +
    82 #endif
    +
    83 
    +
    84 #ifndef memchr_P
    +
    85 #define memchr_P(str, c, len) memchr((str), (c), (len))
    +
    86 #endif
    +
    87 #ifndef memcmp_P
    +
    88 #define memcmp_P(a, b, n) memcmp((a), (b), (n))
    +
    89 #endif
    +
    90 #ifndef memcpy_P
    +
    91 #define memcpy_P(dest, src, num) memcpy((dest), (src), (num))
    +
    92 #endif
    +
    93 #ifndef memmem_P
    +
    94 #define memmem_P(a, alen, b, blen) memmem((a), (alen), (b), (blen))
    +
    95 #endif
    +
    96 #ifndef memrchr_P
    +
    97 #define memrchr_P(str, val, len) memrchr((str), (val), (len))
    +
    98 #endif
    +
    99 #ifndef strcat_P
    +
    100 #define strcat_P(dest, src) strcat((dest), (src))
    +
    101 #endif
    +
    102 #ifndef strchr_P
    +
    103 #define strchr_P(str, c) strchr((str), (c))
    +
    104 #endif
    +
    105 #ifndef strchrnul_P
    +
    106 #define strchrnul_P(str, c) strchrnul((str), (c))
    +
    107 #endif
    +
    108 #ifndef strcmp_P
    +
    109 #define strcmp_P(a, b) strcmp((a), (b))
    +
    110 #endif
    +
    111 #ifndef strcpy_P
    +
    112 #define strcpy_P(dest, src) strcpy((dest), (src))
    +
    113 #endif
    +
    114 #ifndef strcasecmp_P
    +
    115 #define strcasecmp_P(a, b) strcasecmp((a), (b))
    +
    116 #endif
    +
    117 #ifndef strcasestr_P
    +
    118 #define strcasestr_P(a, b) strcasestr((a), (b))
    +
    119 #endif
    +
    120 #ifndef strlcat_P
    +
    121 #define strlcat_P(dest, src, len) strlcat((dest), (src), (len))
    +
    122 #endif
    +
    123 #ifndef strlcpy_P
    +
    124 #define strlcpy_P(dest, src, len) strlcpy((dest), (src), (len))
    +
    125 #endif
    +
    126 #ifndef strlen_P
    +
    127 #define strlen_P(s) strlen((const char *)(s))
    +
    128 #endif
    +
    129 #ifndef strnlen_P
    +
    130 #define strnlen_P(str, len) strnlen((str), (len))
    +
    131 #endif
    +
    132 #ifndef strncmp_P
    +
    133 #define strncmp_P(a, b, n) strncmp((a), (b), (n))
    +
    134 #endif
    +
    135 #ifndef strncasecmp_P
    +
    136 #define strncasecmp_P(a, b, n) strncasecmp((a), (b), (n))
    +
    137 #endif
    +
    138 #ifndef strncat_P
    +
    139 #define strncat_P(a, b, n) strncat((a), (b), (n))
    +
    140 #endif
    +
    141 #ifndef strncpy_P
    +
    142 #define strncpy_P(a, b, n) strncmp((a), (b), (n))
    +
    143 #endif
    +
    144 #ifndef strpbrk_P
    +
    145 #define strpbrk_P(str, chrs) strpbrk((str), (chrs))
    +
    146 #endif
    +
    147 #ifndef strrchr_P
    +
    148 #define strrchr_P(str, c) strrchr((str), (c))
    +
    149 #endif
    +
    150 #ifndef strsep_P
    +
    151 #define strsep_P(strp, delim) strsep((strp), (delim))
    +
    152 #endif
    +
    153 #ifndef strspn_P
    +
    154 #define strspn_P(str, chrs) strspn((str), (chrs))
    +
    155 #endif
    +
    156 #ifndef strstr_P
    +
    157 #define strstr_P(a, b) strstr((a), (b))
    +
    158 #endif
    +
    159 #ifndef sprintf_P
    +
    160 #define sprintf_P(s, ...) sprintf((s), __VA_ARGS__)
    +
    161 #endif
    +
    162 #ifndef vfprintf_P
    +
    163 #define vfprintf_P(s, ...) vfprintf((s), __VA_ARGS__)
    +
    164 #endif
    +
    165 #ifndef printf_P
    +
    166 #define printf_P(...) printf(__VA_ARGS__)
    +
    167 #endif
    +
    168 #ifndef snprintf_P
    +
    169 #define snprintf_P(s, n, ...) ((s), (n), __VA_ARGS__)
    +
    170 #endif
    +
    171 #ifndef vsprintf_P
    +
    172 #define vsprintf_P(s, ...) ((s),__VA_ARGS__)
    +
    173 #endif
    +
    174 #ifndef vsnprintf_P
    +
    175 #define vsnprintf_P(s, n, ...) ((s), (n),__VA_ARGS__)
    +
    176 #endif
    +
    177 #ifndef fprintf_P
    +
    178 #define fprintf_P(s, ...) ((s), __VA_ARGS__)
    +
    179 #endif
    +
    180 
    +
    181 #ifndef pgm_read_byte
    +
    182 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
    +
    183 #endif
    +
    184 #ifndef pgm_read_word
    +
    185 #define pgm_read_word(addr) (*(const unsigned short *)(addr))
    +
    186 #endif
    +
    187 #ifndef pgm_read_dword
    +
    188 #define pgm_read_dword(addr) (*(const unsigned long *)(addr))
    +
    189 #endif
    +
    190 #ifndef pgm_read_float
    +
    191 #define pgm_read_float(addr) (*(const float *)(addr))
    +
    192 #endif
    +
    193 
    +
    194 #ifndef pgm_read_byte_near
    +
    195 #define pgm_read_byte_near(addr) pgm_read_byte(addr)
    +
    196 #endif
    +
    197 #ifndef pgm_read_word_near
    +
    198 #define pgm_read_word_near(addr) pgm_read_word(addr)
    +
    199 #endif
    +
    200 #ifndef pgm_read_dword_near
    +
    201 #define pgm_read_dword_near(addr) pgm_read_dword(addr)
    +
    202 #endif
    +
    203 #ifndef pgm_read_float_near
    +
    204 #define pgm_read_float_near(addr) pgm_read_float(addr)
    +
    205 #endif
    +
    206 #ifndef pgm_read_byte_far
    +
    207 #define pgm_read_byte_far(addr) pgm_read_byte(addr)
    +
    208 #endif
    +
    209 #ifndef pgm_read_word_far
    +
    210 #define pgm_read_word_far(addr) pgm_read_word(addr)
    +
    211 #endif
    +
    212 #ifndef pgm_read_dword_far
    +
    213 #define pgm_read_dword_far(addr) pgm_read_dword(addr)
    +
    214 #endif
    +
    215 #ifndef pgm_read_float_far
    +
    216 #define pgm_read_float_far(addr) pgm_read_float(addr)
    +
    217 #endif
    +
    218 
    +
    219 #ifndef pgm_read_pointer
    +
    220 #define pgm_read_pointer
    +
    221 #endif
    +
    222 #endif
    +
    void prog_void
    +
    int8_t prog_int8_t
    +
    int32_t prog_int32_t
    +
    uint8_t prog_uint8_t
    +
    int16_t prog_int16_t
    +
    uint32_t prog_uint32_t
    +
    uint16_t prog_uint16_t
    +
    unsigned char prog_uchar
    +
    char prog_char
    +
    + + + + diff --git a/xbox_enums_8h.html b/xbox_enums_8h.html index 7f5baa04..8b2f3e62 100644 --- a/xbox_enums_8h.html +++ b/xbox_enums_8h.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: xboxEnums.h File Reference + @@ -31,7 +32,7 @@
    - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
    +
    @@ -105,7 +106,7 @@ This graph shows which files directly or indirectly include this file:
    - +

    Go to the source code of this file.

    @@ -219,7 +220,7 @@ Variables diff --git a/xbox_enums_8h__dep__incl.map b/xbox_enums_8h__dep__incl.map index 3e8ddb68..b55e74f3 100644 --- a/xbox_enums_8h__dep__incl.map +++ b/xbox_enums_8h__dep__incl.map @@ -1,6 +1,8 @@ - - - - + + + + + + diff --git a/xbox_enums_8h__dep__incl.md5 b/xbox_enums_8h__dep__incl.md5 index 87776612..60b9cb6d 100644 --- a/xbox_enums_8h__dep__incl.md5 +++ b/xbox_enums_8h__dep__incl.md5 @@ -1 +1 @@ -0d6e097941f73a0223c1d6fb58d28848 \ No newline at end of file +37fbd5fbccd0c87996af0449ab2a7de6 \ No newline at end of file diff --git a/xbox_enums_8h__dep__incl.png b/xbox_enums_8h__dep__incl.png index c731a96a..df456f3f 100644 Binary files a/xbox_enums_8h__dep__incl.png and b/xbox_enums_8h__dep__incl.png differ diff --git a/xbox_enums_8h__incl.md5 b/xbox_enums_8h__incl.md5 index 11e9cde4..08a549aa 100644 --- a/xbox_enums_8h__incl.md5 +++ b/xbox_enums_8h__incl.md5 @@ -1 +1 @@ -9f9a08dc9bbd9533350f7cf79e5be9b5 \ No newline at end of file +befff066e79e637de52f84f14ca3f473 \ No newline at end of file diff --git a/xbox_enums_8h_source.html b/xbox_enums_8h_source.html index 452c51d0..bef2edad 100644 --- a/xbox_enums_8h_source.html +++ b/xbox_enums_8h_source.html @@ -3,15 +3,16 @@ - + USB Host Shield 2.0: xboxEnums.h Source File + @@ -31,7 +32,7 @@ - + @@ -70,7 +71,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages +
    @@ -164,7 +165,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');