First attempt at adding TMC Driver support. May need some cleanup.

master
domonoky 10 years ago
parent b55995aae8
commit 38500165ea

@ -0,0 +1,17 @@
#mac stuff
.DS_Store
#eclipse stuff
.classpath
.project
#processing stuff
generated/
examples/TMC26XMotorTester/processing/TMC26XMotorTest/application.*/
examples/TMC26XMotorTester/processing/TMC26XMotorTest/application.*
#eagle stuff
schematics/*.b#?
schematics/*.s#?
*.zip

@ -0,0 +1,1813 @@
# Doxyfile 1.7.6.1
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
#
# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (" ")
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
# iconv built into libc) for the transcoding. See
# http://www.gnu.org/software/libiconv for the list of possible encodings.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or sequence of words) that should
# identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces.
PROJECT_NAME = "Trinamic TMC26X Stepper Driver for Arduino"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER =
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
# a quick idea about the purpose of the project. Keep the description short.
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.
PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = /Users/marcus/Arduino/libraries/TMC26XStepper/documentation
# 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 putting all generated files in the same directory would
# otherwise cause performance problems for the file system.
CREATE_SUBDIRS = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
OUTPUT_LANGUAGE = English
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) 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.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES (the default) 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
# brief descriptions will be completely suppressed.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator
# that is used to form the text in various listings. Each string
# in this list, if found as the leading text of the brief description, will be
# stripped from the text and the result after processing the whole list, is
# used as the annotated text. Otherwise, the brief description is used as-is.
# If left blank, the following values are used ("$name" is automatically
# replaced with the name of the entity): "The $name class" "The $name widget"
# "The $name file" "is" "provides" "specifies" "contains"
# "represents" "a" "an" "the"
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# Doxygen will generate a detailed section even if there is only a brief
# description.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES then 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.
FULL_PATH_NAMES = YES
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user-defined part of the path. Stripping is
# only done if one of the specified strings matches the left-hand part of
# the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the
# path to strip.
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
# the path mentioned in the documentation of a class, which tells
# the reader which header file to include in order to use a class.
# If left blank only the name of the header file containing the class
# definition is used. Otherwise one should specify the include paths that
# are normally passed to the compiler using the -I flag.
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
# (but less readable) file names. This can be useful if your file system
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like regular Qt-style comments
# (thus requiring an explicit @brief command for a brief description.)
JAVADOC_AUTOBRIEF = NO
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
# interpret the first line (until the first dot) of a Qt-style
# comment as the brief description. If set to NO, the comments
# will behave just like regular Qt-style comments (thus requiring
# an explicit \brief command for a brief description.)
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
# comments) as a brief description. This used to be the default behaviour.
# The new default is to treat a multi-line C++ comment block as a detailed
# description. Set this tag to YES if you prefer the old behaviour instead.
MULTILINE_CPP_IS_BRIEF = NO
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
# re-implements.
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.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 8
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES =
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding
# "class=itcl::class" will allow you to use the command class in the
# itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
# of all members will be omitted, etc.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
# sources only. Doxygen will then generate output that is more tailored for
# Java. For instance, namespaces will be presented as packages, qualified
# scopes will look different, etc.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
# sources only. Doxygen will then generate output that is more tailored for
# Fortran.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
# sources. Doxygen will then generate output that is tailored for
# VHDL.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given extension.
# Doxygen has a built-in mapping, but you can override or extend it using this
# tag. The format is ext=language, where ext is a file extension, and language
# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For 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 that for custom extensions
# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
EXTENSION_MAPPING =
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should
# set this tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
# func(std::string) {}). This also makes the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
# Doxygen will parse them like normal C++ but will assume all classes use public
# instead of private inheritance when no explicit protection keyword is present.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate getter
# and setter methods for a property. Setting this option to YES (the default)
# will make doxygen replace the get and set methods by a property in the
# documentation. This will only work if the methods are indeed getting or
# setting a simple type. If this is not the case, or you want to show the
# methods anyway, you should set this option to 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
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
# the same type (for instance a group of public functions) to be put as a
# subgroup of that type (e.g. under the Public Functions section). Set it to
# NO to prevent subgrouping. Alternatively, this can be done per class using
# the \nosubgrouping command.
SUBGROUPING = YES
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
# unions are shown inside the group in which they are included (e.g. using
# @ingroup) instead of on a separate page (for HTML and Man pages) or
# section (for LaTeX and RTF).
INLINE_GROUPED_CLASSES = NO
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
# unions with only public data fields will be shown inline in the documentation
# of the scope in which they are defined (i.e. file, namespace, or group
# documentation), provided this scope is documented. If set to NO (the default),
# structs, classes, and unions are shown on a separate page (for HTML and Man
# pages) or section (for LaTeX and RTF).
INLINE_SIMPLE_STRUCTS = NO
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
# is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically
# be useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
TYPEDEF_HIDES_STRUCT = NO
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
# determine which symbols to keep in memory and which to flush to disk.
# When the cache is full, less often used symbols will be written to disk.
# For small to medium size projects (<1000 input files) the default value is
# probably good enough. For larger projects a too small cache size can cause
# doxygen to be busy swapping symbols to and from disk most of the time
# causing a significant performance penalty.
# If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on
# a logarithmic scale so increasing the size by one will roughly double the
# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols.
SYMBOL_CACHE_SIZE = 0
# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
# their name and scope. Since this can be an expensive process and often the
# same symbol appear multiple times in the code, doxygen keeps a cache of
# pre-resolved symbols. If the cache is too small doxygen will become slower.
# If the cache is too large, memory is wasted. The cache size is given by this
# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols.
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# 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 and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
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 only classes defined in header files are included.
EXTRACT_LOCAL_CLASSES = YES
# This flag is only useful for Objective-C code. When 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 (the default) only methods in the interface are included.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base
# name of the file that contains the anonymous namespace. By default
# anonymous namespaces are hidden.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
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 (the default) these classes will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
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 (the default) these declarations will be included in the
# documentation.
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 (the default) these blocks will be appended to the
# function's detailed documentation block.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
# to NO (the default) then the documentation will be excluded.
# Set it to YES to include the internal documentation.
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
# 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.
CASE_SENSE_NAMES = NO
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
HIDE_SCOPE_NAMES = NO
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
# will put a list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = YES
# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
# will list include files with double quotes in the documentation
# rather than with sharp brackets.
FORCE_LOCAL_INCLUDES = NO
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES (the default) 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.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
# brief documentation of file, namespace and class members alphabetically
# by member name. If set to NO (the default) the members will appear in
# declaration order.
SORT_BRIEF_DOCS = NO
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
# will sort the (brief and detailed) documentation of class members so that
# constructors and destructors are listed first. If set to NO (the default)
# the constructors will appear in the respective orders defined by
# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
SORT_MEMBERS_CTORS_1ST = NO
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
# hierarchy of group names into alphabetical order. If set to NO (the default)
# the group names will appear in their defined order.
SORT_GROUP_NAMES = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
# sorted by fully-qualified names, including namespaces. If set to
# NO (the default), the class list will be sorted only by class name,
# not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the
# alphabetical list.
SORT_BY_SCOPE_NAME = NO
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
# do proper type resolution of all parameters of a function it will reject a
# match between the prototype and the implementation of a member function even
# if there is only one candidate or it is obvious which candidate to choose
# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
# will still accept a match between prototype and implementation in such cases.
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.
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.
GENERATE_TESTLIST = YES
# 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.
GENERATE_BUGLIST = YES
# 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.
GENERATE_DEPRECATEDLIST= YES
# The ENABLED_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
# the initial value of a variable or macro consists of for it to appear in
# the documentation. If the initializer consists of more lines than specified
# here it will be hidden. Use a value of 0 to hide initializers completely.
# The appearance of the initializer of individual variables and macros in the
# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
MAX_INITIALIZER_LINES = 28
# 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.
SHOW_USED_FILES = YES
# If the sources in your project are distributed over multiple directories
# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
# in the documentation. The default is NO.
SHOW_DIRECTORIES = NO
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
# This will remove the Files entry from the Quick Index and from the
# Folder Tree View (if specified). The default is YES.
SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
# Namespaces page. This will remove the Namespaces entry from the Quick Index
# and from the Folder Tree View (if specified). The default is YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
# popen()) the command <command> <input-file>, where <command> is the value of
# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
# provided by doxygen. Whatever the program writes to standard output
# is used as the file version. See the manual for examples.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. The create the layout file
# that represents doxygen's defaults, run doxygen with the -l option.
# You can optionally specify a file name after the option, if omitted
# DoxygenLayout.xml will be used as the name of the layout file.
LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files
# containing the references data. This must be a list of .bib files. The
# .bib extension is automatically appended if omitted. Using this command
# requires the bibtex tool 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.
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
WARNINGS = YES
# If WARN_IF_UNDOCUMENTED 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.
WARN_IF_UNDOCUMENTED = YES
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some
# parameters in a documented function, or documenting parameters that
# don't exist or using markup commands wrongly.
WARN_IF_DOC_ERROR = YES
# The 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 (the default) doxygen will only warn about
# wrong or incomplete parameter documentation, but not about the absence of
# documentation.
WARN_NO_PARAMDOC = NO
# The WARN_FORMAT tag determines the format of the warning messages that
# doxygen can produce. The string should contain the $file, $line, and $text
# tags, which will be replaced by the file and line number from which the
# warning originated and the warning text. Optionally the format may contain
# $version, which will be replaced by the version of the file (if it could
# be obtained via FILE_VERSION_FILTER)
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning
# and error messages should be written. If left blank the output is written
# to stderr.
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = /Users/marcus/Arduino/libraries/TMC26XStepper
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
# also the default input encoding. Doxygen uses libiconv (or the iconv built
# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
# the list of possible encodings.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
# *.f90 *.f *.for *.vhd *.vhdl
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.d \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox \
*.py \
*.f90 \
*.f \
*.for \
*.vhd \
*.vhdl
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = NO
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories. Note that the wildcards are matched
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
EXAMPLE_PATTERNS = *
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude
# commands irrespective of the value of the RECURSIVE tag.
# Possible values are YES and NO. If left blank NO is used.
EXAMPLE_RECURSIVE = NO
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command <filter> <input-file>, where <filter>
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
# input file. Doxygen will then use the output that the filter program writes
# to standard output. If FILTER_PATTERNS is specified, this tag will be
# ignored.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
# filter if there is a match. The filters are a list of the form:
# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
# info on how filters are used. If FILTER_PATTERNS is empty or if
# non of the patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
# files to browse (i.e. when SOURCE_BROWSER is set to YES).
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
# and it is also possible to disable source filtering for a specific pattern
# using *.ext= (so without naming a filter). This option only has effect when
# FILTER_SOURCE_FILES is enabled.
FILTER_SOURCE_PATTERNS =
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
# Note: To get rid of all source code in the generated output, make sure also
# VERBATIM_HEADERS is set to NO.
SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES
# then for each documented function all documented
# functions referencing it will be listed.
REFERENCED_BY_RELATION = NO
# If the REFERENCES_RELATION tag is set to YES
# then for each documented function all documented entities
# called/used by that function will be listed.
REFERENCES_RELATION = NO
# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
# and SOURCE_BROWSER tag is set 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.
REFERENCES_LINK_SOURCE = YES
# If the USE_HTAGS tag is set to YES then the references to source code
# will point to the HTML generated by the htags(1) tool instead of doxygen
# built-in source browser. The htags tool is part of GNU's global source
# tagging system (see http://www.gnu.org/software/global/global.html). You
# will need version 4.8.6 or higher.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX = YES
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
# doxygen will generate files with .html extension.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header. Note that when using a custom header you are responsible
# for the proper inclusion of any scripts and style sheets that doxygen
# needs, which is dependent on the configuration options used.
# It is advised to generate a default header using "doxygen -w html
# header.html footer.html stylesheet.css YourConfigFile" and then modify
# that header. Note that the header is subject to change so you typically
# have to redo this when upgrading to a newer version of doxygen or when
# changing the value of configuration settings such as GENERATE_TREEVIEW!
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet. Note that doxygen will try to copy
# the style sheet file to the HTML output directory, so don't put your own
# style sheet in the HTML output directory as well, or it will be erased!
HTML_STYLESHEET =
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
# files. In the HTML_STYLESHEET file, use the file name only. Also note that
# the files will be copied as-is; there are no commands or markers available.
HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
# Doxygen 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 purple, and 360 is red again.
# The allowed range is 0 to 359.
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
# the colors in the HTML output. For a value of 0 the output will use
# grayscales only. A value of 255 will produce the most vivid colors.
HTML_COLORSTYLE_SAT = 100
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
# the luminance component of the colors in the HTML output. Values below
# 100 gradually make the output lighter, whereas values above 100 make
# the output darker. The value divided by 100 is the actual gamma applied,
# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
# and 100 does not change the gamma.
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting
# this to NO can help when comparing the output of multiple runs.
HTML_TIMESTAMP = YES
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded. For this to work a browser that supports
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
HTML_DYNAMIC_SECTIONS = NO
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
# integrated development environment, introduced with OSX 10.5 (Leopard).
# To create a documentation set, doxygen will generate a Makefile in the
# HTML output directory. Running make will produce the docset in that
# directory and running "make install" will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
# it at startup.
# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
GENERATE_DOCSET = NO
# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
# feed. A documentation feed provides an umbrella under which multiple
# documentation sets from a single provider (such as a company or product suite)
# can be grouped.
DOCSET_FEEDNAME = "Doxygen generated docs"
# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
# should uniquely identify the documentation set bundle. This should be a
# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
# will append .docset to the name.
DOCSET_BUNDLE_ID = org.doxygen.Project
# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
# the documentation publisher. This should be a reverse domain-name style
# string, e.g. com.mycompany.MyDocSet.documentation.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
# of the generated HTML documentation.
GENERATE_HTMLHELP = NO
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
# be used to specify the file name of the resulting .chm file. You
# can add a path in front of the file if the result should not be
# written to the html output directory.
CHM_FILE =
# If the GENERATE_HTMLHELP tag is set to YES, 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 doxygen will try to run
# the HTML help compiler on the generated index.hhp.
HHC_LOCATION =
# If the GENERATE_HTMLHELP tag is set to YES, 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).
GENERATE_CHI = NO
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
# is used to encode HtmlHelp index (hhk), content (hhc) and project file
# content.
CHM_INDEX_ENCODING =
# If the GENERATE_HTMLHELP tag is set to YES, 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.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members
# to the contents of the HTML help documentation and to the tree view.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
# that can be used as input for Qt's qhelpgenerator to generate a
# Qt Compressed Help (.qch) of the generated HTML documentation.
GENERATE_QHP = NO
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
# be used to specify the file name of the resulting .qch file.
# The path specified is relative to the HTML output folder.
QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
# http://doc.trolltech.com/qthelpproject.html#namespace
QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
# http://doc.trolltech.com/qthelpproject.html#virtual-folders
QHP_VIRTUAL_FOLDER = doc
# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
# add. For more information please see
# http://doc.trolltech.com/qthelpproject.html#custom-filters
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see
# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
# Qt Help Project / Custom Filters</a>.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's
# filter section matches.
# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
# Qt Help Project / Filter Attributes</a>.
QHP_SECT_FILTER_ATTRS =
# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
# be used to specify the location of Qt's qhelpgenerator.
# If non-empty doxygen will try to run qhelpgenerator on the generated
# .qhp file.
QHG_LOCATION =
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
# will be generated, which together with the HTML files, form an Eclipse help
# plugin. To install this plugin and make it available under the help contents
# menu in Eclipse, the contents of the directory containing the HTML and XML
# files needs to be copied into the plugins directory of eclipse. The name of
# the directory within the plugins directory should be the same as
# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
# the help appears.
GENERATE_ECLIPSEHELP = NO
# A unique identifier for the eclipse help plugin. When installing the plugin
# the directory name containing the HTML and XML files should also have
# this name.
ECLIPSE_DOC_ID = org.doxygen.Project
# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
# at top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it. Since the tabs have the same information as the
# navigation tree you can set this option to NO if you already set
# GENERATE_TREEVIEW to YES.
DISABLE_INDEX = NO
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information.
# If the tag value is set to YES, a side panel will be generated
# containing a tree-like 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.
# Since the tree basically has the same information as the tab index you
# could consider to set DISABLE_INDEX to NO when enabling this option.
GENERATE_TREEVIEW = NO
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
# (range [0,1..20]) that doxygen will group on one line in the generated HTML
# documentation. Note that a value of 0 will completely suppress the enum
# values from appearing in the overview section.
ENUM_VALUES_PER_LINE = 4
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
# and Class Hierarchy pages using a tree view instead of an ordered list.
USE_INLINE_TREES = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
TREEVIEW_WIDTH = 250
# When 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.
EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of Latex formulas included
# as images in the HTML documentation. The default is 10. Note that
# when you change the font size after a successful doxygen run you need
# to manually remove any form_*.png images from the HTML output directory
# to force them to be regenerated.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are
# not supported properly for IE 6.0, but are supported on all modern browsers.
# Note that when changing this option you need to delete any form_*.png files
# in the HTML output before the changes have effect.
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 installed or if you want to formulas look prettier in the HTML
# output. When enabled you also need to install MathJax separately and
# configure the path to it using the MATHJAX_RELPATH option.
USE_MATHJAX = NO
# When MathJax is enabled you need to specify the location relative to the
# HTML output directory using the MATHJAX_RELPATH option. The destination
# directory should contain the MathJax.js script. For instance, if the mathjax
# directory is located at the same level as the HTML output directory, then
# MATHJAX_RELPATH should be ../mathjax. The default value points to the
# mathjax.org site, so you can quickly see the result without installing
# MathJax, but it is strongly recommended to install a local copy of MathJax
# before deployment.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
# names that should be enabled during MathJax rendering.
MATHJAX_EXTENSIONS =
# When the SEARCHENGINE tag is enabled doxygen will generate a search box
# for the HTML output. The underlying search engine uses javascript
# and DHTML and should work on any modern browser. Note that when using
# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
# (GENERATE_DOCSET) there is already a search function so this one should
# typically be disabled. For large projects the javascript based search engine
# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
SEARCHENGINE = NO
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a PHP enabled web server instead of at the web client
# using Javascript. Doxygen will generate the search PHP script and index
# file to put on the web server. The advantage of the server
# based approach is that it scales better to large projects and allows
# full text search. The disadvantages are that it is more difficult to setup
# and does not have live searching capabilities.
SERVER_BASED_SEARCH = NO
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked. If left blank `latex' will be used as the default command name.
# Note that when enabling USE_PDFLATEX this option is only used for
# generating bitmaps for formulas in the HTML output, but not in the
# Makefile that is written to the output directory.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
# generate index for LaTeX. If left blank `makeindex' will be used as the
# default command name.
MAKEINDEX_CMD_NAME = makeindex
# 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.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
# by the printer. Possible values are: a4, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
# the generated latex document. The header should contain everything until
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
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. Notice: only use this tag if you know what you are doing!
LATEX_FOOTER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = YES
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = YES
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = NO
# If LATEX_HIDE_INDICES is set to YES then doxygen will not
# include the index chapters (such as File Index, Compound Index, etc.)
# in the output.
LATEX_HIDE_INDICES = NO
# If LATEX_SOURCE_CODE is set to YES then doxygen will include
# source code with syntax highlighting in the LaTeX output.
# Note that which sources are shown also depends on other settings
# such as SOURCE_BROWSER.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
# http://en.wikipedia.org/wiki/BibTeX for more info.
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 RTF output is optimized for Word 97 and may not look very pretty with
# other RTF readers or editors.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `rtf' will be used as the default path.
RTF_OUTPUT = 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.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
# will contain hyperlink fields. The RTF file will
# contain links (just like the HTML output) instead of page references.
# This makes the output suitable for online browsing using WORD or other
# programs which support those fields.
# Note: wordpad (write) and others do not support links.
RTF_HYPERLINKS = NO
# Load style sheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an rtf document.
# Syntax is similar to doxygen's config file.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `man' will be used as the default path.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .3
# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
# then it will generate one additional man file for each entity
# documented in the real man page(s). These additional files
# only source the real man page, but without them the man command
# would be unable to find the correct page. The default is NO.
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 captures the structure of
# the code including all documentation.
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `xml' will be used as the default path.
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify an XML schema,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_DTD =
# 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.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
# generate an AutoGen Definitions (see 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.
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 file that captures the structure of
# the code including all documentation. Note that this
# feature is still experimental and incomplete at the
# moment.
GENERATE_PERLMOD = NO
# 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.
PERLMOD_LATEX = NO
# 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 size of the Perl module output will be much smaller
# and Perl will parse it just the same.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file
# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
# This is useful so different doxyrules.make files included by the same
# Makefile don't overwrite each other's variables.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
# evaluate all C-preprocessor directives found in the sources and include
# files.
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 (the default) only conditional
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_DEFINED tags.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# pointed to by INCLUDE_PATH will be searched when a #include is found.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
# gcc). The argument of the tag is a list of macros of the form: name
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed. To prevent a macro definition from being
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition that
# overrules the definition found in the source code.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all references to function-like macros
# that are alone on a line, have an all uppercase name, and do not end with a
# semicolon, because these will confuse the parser if not removed.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
# The TAGFILES option can be used to specify one or more tagfiles.
# Optionally an initial location of the external documentation
# can be added for each tagfile. The format of a tag file without
# this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where "loc1" and "loc2" can be relative or absolute paths or
# URLs. If a location is present for each tag, the installdox tool
# does not have to be run to correct the links.
# Note that each tag file must have a unique name
# (where the name does NOT include the path)
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
# will be listed.
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 listed.
EXTERNAL_GROUPS = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in HTML, RTF 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 powerful graphs.
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see
# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
# 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.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = NO
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
# allowed to run in parallel. When set to 0 (the default) doxygen will
# base this on the number of processors available in the system. You can set it
# explicitly to a value larger than 0 to get control over the balance
# between CPU load and processing speed.
DOT_NUM_THREADS = 0
# By default doxygen will use the Helvetica font for all dot files that
# doxygen generates. When you want a differently looking font 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 setting DOT_FONTPATH to the
# directory containing the font.
DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the Helvetica font.
# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
# set the path where dot can find it.
DOT_FONTPATH =
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
# CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for groups, showing the direct groups dependencies
GROUP_GRAPHS = YES
# 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.
UML_LOOK = NO
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
TEMPLATE_RELATIONS = NO
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
# tags are set to YES then doxygen will generate a graph for each documented
# file showing the direct and indirect include dependencies of the file with
# other documented files.
INCLUDE_GRAPH = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
# documented header file showing the documented files that directly or
# indirectly include this file.
INCLUDED_BY_GRAPH = YES
# If the CALL_GRAPH and HAVE_DOT options are set to YES then
# doxygen will generate a call dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable call graphs
# for selected functions only using the \callgraph command.
CALL_GRAPH = NO
# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
# doxygen will generate a caller dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable caller
# graphs for selected functions only using the \callergraph command.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will generate a graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are svg, png, jpg, or gif.
# If left blank png will be used. If you choose svg you need to set
# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
# visible in IE 9+ (other browsers do not have this requirement).
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
# Note that this requires a modern browser other than Internet Explorer.
# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
# visible. Older versions of IE do not have SVG support.
INTERACTIVE_SVG = NO
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the
# \dotfile command).
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the
# \mscfile command).
MSCFILE_DIRS =
# 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 by representing a node as a red box. Note that doxygen if the
# number of direct children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
# from the root by following a path via at most 3 edges will be shown. Nodes
# that lay further from the root node will be omitted. Note that setting this
# option to 1 or 2 may greatly reduce the computation time needed for large
# code bases. Also note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not
# seem to support this out of the box. Warning: Depending on the platform used,
# enabling this option may lead to badly anti-aliased labels on the edges of
# a graph (i.e. they become hard to read).
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES 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.
DOT_MULTI_TARGETS = NO
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
# remove the intermediate dot files that are used to generate
# the various graphs.
DOT_CLEANUP = YES

@ -0,0 +1,10 @@
Copyright (c) 2012 Interactive Matter
based on the stepper library by Tom Igoe, et. al.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -0,0 +1,71 @@
Arduino TMC26X Stepper Motor Controller Library
===============================================
License
-------
TMC26XStepper.cpp - - TMC 260/261/262 Stepper library for Wiring/Arduino
based on the stepper library by Tom Igoe, et. al.
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
About
-----
The TMC26X is a stepper motor controller for bipolar stepper motors. From the trinamic web site:
The TMC262 is the first energy efficient high current high precision microstepping driver
IC for bipolar stepper motors. The unique high resolution sensorless load detection stallGuard2™
is used to for the worlds first integrated load dependent current control feature called coolStep™.
The ability to read out the load and detect an overload makes the TMC262 an optimum choice for
drives where a high reliability is desired at a low cost. The new patented spreadCycle PWM mixed
decay chopper scheme ensures best zero crossing performance as well as high speed operation.
The TMC262 can be driven with Step & Direction signals as well as by serial SPI™ interface.
Using the microPlyer allows to operate the motor with highest 256 μStep smoothness reducing the
input frequency to 16 μSteps. A full set of protection and diagnostic features makes this device
very rugged. It directly drives external MOSFETs for currents of up to 6A. This way it reaches
highest energy efficiency and allows driving of a high motor current without cooling measures
even at high environment temperatures.
The unique features of the TMC26X are that everything can (and must) be controlled in software:
* the motor current
* microstepping
* stall protection
* current reduction according to load
* stallGuard2™ sensorless load detection
* coolStep™ load dependent current control
* spreadCycle hysteresis PWM chopper
* microPlyer 16-to-256 μStep multiplier
* full protection and diagnostics
This makes the TMC26X a bit harder to use than other stepper motors but much more versatile.
This library resolves all the complicated stuff so that you can use TMC26X straight away.
Furthermore, all the settings are implemented in high level interfaces so that configuring your
motor is a breeze.
How to use
----------
Check out the Setup Guide here:
And the How To here:

@ -0,0 +1,999 @@
/*
TMC26XStepper.cpp - - TMC26X Stepper library for Wiring/Arduino
based on the stepper library by Tom Igoe, et. al.
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif
#include <SPI.h>
#include "TMC26XStepper.h"
//some default values used in initialization
#define DEFAULT_MICROSTEPPING_VALUE 32
//TMC26X register definitions
#define DRIVER_CONTROL_REGISTER 0x0ul
#define CHOPPER_CONFIG_REGISTER 0x80000ul
#define COOL_STEP_REGISTER 0xA0000ul
#define STALL_GUARD2_LOAD_MEASURE_REGISTER 0xC0000ul
#define DRIVER_CONFIG_REGISTER 0xE0000ul
#define REGISTER_BIT_PATTERN 0xFFFFFul
//definitions for the driver control register
#define MICROSTEPPING_PATTERN 0xFul
#define STEP_INTERPOLATION 0x200ul
#define DOUBLE_EDGE_STEP 0x100ul
#define VSENSE 0x40ul
#define READ_MICROSTEP_POSTION 0x0ul
#define READ_STALL_GUARD_READING 0x10ul
#define READ_STALL_GUARD_AND_COOL_STEP 0x20ul
#define READ_SELECTION_PATTERN 0x30ul
//definitions for the chopper config register
#define CHOPPER_MODE_STANDARD 0x0ul
#define CHOPPER_MODE_T_OFF_FAST_DECAY 0x4000ul
#define T_OFF_PATTERN 0xful
#define RANDOM_TOFF_TIME 0x2000ul
#define BLANK_TIMING_PATTERN 0x18000ul
#define BLANK_TIMING_SHIFT 15
#define HYSTERESIS_DECREMENT_PATTERN 0x1800ul
#define HYSTERESIS_DECREMENT_SHIFT 11
#define HYSTERESIS_LOW_VALUE_PATTERN 0x780ul
#define HYSTERESIS_LOW_SHIFT 7
#define HYSTERESIS_START_VALUE_PATTERN 0x78ul
#define HYSTERESIS_START_VALUE_SHIFT 4
#define T_OFF_TIMING_PATERN 0xFul
//definitions for cool step register
#define MINIMUM_CURRENT_FOURTH 0x8000ul
#define CURRENT_DOWN_STEP_SPEED_PATTERN 0x6000ul
#define SE_MAX_PATTERN 0xF00ul
#define SE_CURRENT_STEP_WIDTH_PATTERN 0x60ul
#define SE_MIN_PATTERN 0xful
//definitions for stall guard2 current register
#define STALL_GUARD_FILTER_ENABLED 0x10000ul
#define STALL_GUARD_TRESHHOLD_VALUE_PATTERN 0x17F00ul
#define CURRENT_SCALING_PATTERN 0x1Ful
#define STALL_GUARD_CONFIG_PATTERN 0x17F00ul
#define STALL_GUARD_VALUE_PATTERN 0x7F00ul
//definitions for the input from the TCM260
#define STATUS_STALL_GUARD_STATUS 0x1ul
#define STATUS_OVER_TEMPERATURE_SHUTDOWN 0x2ul
#define STATUS_OVER_TEMPERATURE_WARNING 0x4ul
#define STATUS_SHORT_TO_GROUND_A 0x8ul
#define STATUS_SHORT_TO_GROUND_B 0x10ul
#define STATUS_OPEN_LOAD_A 0x20ul
#define STATUS_OPEN_LOAD_B 0x40ul
#define STATUS_STAND_STILL 0x80ul
#define READOUT_VALUE_PATTERN 0xFFC00ul
//default values
#define INITIAL_MICROSTEPPING 0x3ul //32th microstepping
//debuging output
//#define DEBUG
/*
* Constructor
* number_of_steps - the steps per rotation
* cs_pin - the SPI client select pin
* dir_pin - the pin where the direction pin is connected
* step_pin - the pin where the step pin is connected
*/
TMC26XStepper::TMC26XStepper(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int current, unsigned int resistor)
{
//we are not started yet
started=false;
//by default cool step is not enabled
cool_step_enabled=false;
//save the pins for later use
this->cs_pin=cs_pin;
this->dir_pin=dir_pin;
this->step_pin = step_pin;
//store the current sense resistor value for later use
this->resistor = resistor;
//initizalize our status values
this->steps_left = 0;
this->direction = 0;
//initialize register values
driver_control_register_value=DRIVER_CONTROL_REGISTER | INITIAL_MICROSTEPPING;
chopper_config_register=CHOPPER_CONFIG_REGISTER;
//setting the default register values
driver_control_register_value=DRIVER_CONTROL_REGISTER|INITIAL_MICROSTEPPING;
microsteps = (1 << INITIAL_MICROSTEPPING);
chopper_config_register=CHOPPER_CONFIG_REGISTER;
cool_step_register_value=COOL_STEP_REGISTER;
stall_guard2_current_register_value=STALL_GUARD2_LOAD_MEASURE_REGISTER;
driver_configuration_register_value = DRIVER_CONFIG_REGISTER | READ_STALL_GUARD_READING;
//set the current
setCurrent(current);
//set to a conservative start value
setConstantOffTimeChopper(7, 54, 13,12,1);
//set a nice microstepping value
setMicrosteps(DEFAULT_MICROSTEPPING_VALUE);
//save the number of steps
this->number_of_steps = number_of_steps;
}
/*
* start & configure the stepper driver
* just must be called.
*/
void TMC26XStepper::start() {
#ifdef DEBUG
Serial.println("TMC26X stepper library");
Serial.print("CS pin: ");
Serial.println(cs_pin);
Serial.print("DIR pin: ");
Serial.println(dir_pin);
Serial.print("STEP pin: ");
Serial.println(step_pin);
Serial.print("current scaling: ");
Serial.println(current_scaling,DEC);
#endif
//set the pins as output & its initial value
pinMode(step_pin, OUTPUT);
pinMode(dir_pin, OUTPUT);
pinMode(cs_pin, OUTPUT);
digitalWrite(step_pin, LOW);
digitalWrite(dir_pin, LOW);
digitalWrite(cs_pin, HIGH);
//configure the SPI interface
SPI.setBitOrder(MSBFIRST);
SPI.setClockDivider(SPI_CLOCK_DIV8);
//todo this does not work reliably - find a way to foolprof set it (e.g. while communicating
//SPI.setDataMode(SPI_MODE3);
SPI.begin();
//set the initial values
send262(driver_control_register_value);
send262(chopper_config_register);
send262(cool_step_register_value);
send262(stall_guard2_current_register_value);
send262(driver_configuration_register_value);
//save that we are in running mode
started=true;
}
/*
Mark the driver as unstarted to be able to start it again
*/
void TMC26XStepper::un_start() {
started=false;
}
/*
Sets the speed in revs per minute
*/
void TMC26XStepper::setSpeed(unsigned int whatSpeed)
{
this->speed = whatSpeed;
this->step_delay = (60UL * 1000UL * 1000UL) / ((unsigned long)this->number_of_steps * (unsigned long)whatSpeed * (unsigned long)this->microsteps);
#ifdef DEBUG
Serial.print("Step delay in micros: ");
Serial.println(this->step_delay);
#endif
//update the next step time
this->next_step_time = this->last_step_time+this->step_delay;
}
unsigned int TMC26XStepper::getSpeed(void) {
return this->speed;
}
/*
Moves the motor steps_to_move steps. If the number is negative,
the motor moves in the reverse direction.
*/
char TMC26XStepper::step(int steps_to_move)
{
if (this->steps_left==0) {
this->steps_left = abs(steps_to_move); // how many steps to take
// determine direction based on whether steps_to_mode is + or -:
if (steps_to_move > 0) {
this->direction = 1;
} else if (steps_to_move < 0) {
this->direction = 0;
}
return 0;
} else {
return -1;
}
}
char TMC26XStepper::move(void) {
// decrement the number of steps, moving one step each time:
if(this->steps_left>0) {
unsigned long time = micros();
// move only if the appropriate delay has passed:
if (time >= this->next_step_time) {
// increment or decrement the step number,
// depending on direction:
if (this->direction == 1) {
digitalWrite(step_pin, HIGH);
} else {
digitalWrite(dir_pin, HIGH);
digitalWrite(step_pin, HIGH);
}
// get the timeStamp of when you stepped:
this->last_step_time = time;
this->next_step_time = time+this->step_delay;
// decrement the steps left:
steps_left--;
//disable the step & dir pins
digitalWrite(step_pin, LOW);
digitalWrite(dir_pin, LOW);
}
return -1;
}
return 0;
}
char TMC26XStepper::isMoving(void) {
return (this->steps_left>0);
}
unsigned int TMC26XStepper::getStepsLeft(void) {
return this->steps_left;
}
char TMC26XStepper::stop(void) {
//note to self if the motor is currently moving
char state = isMoving();
//stop the motor
this->steps_left = 0;
this->direction = 0;
//return if it was moving
return state;
}
void TMC26XStepper::setCurrent(unsigned int current) {
unsigned char current_scaling = 0;
//calculate the current scaling from the max current setting (in mA)
double mASetting = (double)current;
double resistor_value = (double) this->resistor;
// remove vesense flag
this->driver_configuration_register_value &= ~(VSENSE);
//this is derrived from I=(cs+1)/32*(Vsense/Rsense)
//leading to cs = CS = 32*R*I/V (with V = 0,31V oder 0,165V and I = 1000*current)
//with Rsense=0,15
//for vsense = 0,310V (VSENSE not set)
//or vsense = 0,165V (VSENSE set)
current_scaling = (byte)((resistor_value*mASetting*32.0/(0.31*1000.0*1000.0))-0.5); //theoretically - 1.0 for better rounding it is 0.5
//check if the current scalingis too low
if (current_scaling<16) {
//set the csense bit to get a use half the sense voltage (to support lower motor currents)
this->driver_configuration_register_value |= VSENSE;
//and recalculate the current setting
current_scaling = (byte)((resistor_value*mASetting*32.0/(0.165*1000.0*1000.0))-0.5); //theoretically - 1.0 for better rounding it is 0.5
#ifdef DEBUG
Serial.print("CS (Vsense=1): ");
Serial.println(current_scaling);
} else {
Serial.print("CS: ");
Serial.println(current_scaling);
#endif
}
//do some sanity checks
if (current_scaling>31) {
current_scaling=31;
}
//delete the old value
stall_guard2_current_register_value &= ~(CURRENT_SCALING_PATTERN);
//set the new current scaling
stall_guard2_current_register_value |= current_scaling;
//if started we directly send it to the motor
if (started) {
send262(driver_configuration_register_value);
send262(stall_guard2_current_register_value);
}
}
unsigned int TMC26XStepper::getCurrent(void) {
//we calculate the current according to the datasheet to be on the safe side
//this is not the fastest but the most accurate and illustrative way
double result = (double)(stall_guard2_current_register_value & CURRENT_SCALING_PATTERN);
double resistor_value = (double)this->resistor;
double voltage = (driver_configuration_register_value & VSENSE)? 0.165:0.31;
result = (result+1.0)/32.0*voltage/resistor_value*1000.0*1000.0;
return (unsigned int)result;
}
void TMC26XStepper::setStallGuardThreshold(char stall_guard_threshold, char stall_guard_filter_enabled) {
if (stall_guard_threshold<-64) {
stall_guard_threshold = -64;
//We just have 5 bits
} else if (stall_guard_threshold > 63) {
stall_guard_threshold = 63;
}
//add trim down to 7 bits
stall_guard_threshold &=0x7f;
//delete old stall guard settings
stall_guard2_current_register_value &= ~(STALL_GUARD_CONFIG_PATTERN);
if (stall_guard_filter_enabled) {
stall_guard2_current_register_value |= STALL_GUARD_FILTER_ENABLED;
}
//Set the new stall guard threshold
stall_guard2_current_register_value |= (((unsigned long)stall_guard_threshold << 8) & STALL_GUARD_CONFIG_PATTERN);
//if started we directly send it to the motor
if (started) {
send262(stall_guard2_current_register_value);
}
}
char TMC26XStepper::getStallGuardThreshold(void) {
unsigned long stall_guard_threshold = stall_guard2_current_register_value & STALL_GUARD_VALUE_PATTERN;
//shift it down to bit 0
stall_guard_threshold >>=8;
//convert the value to an int to correctly handle the negative numbers
char result = stall_guard_threshold;
//check if it is negative and fill it up with leading 1 for proper negative number representation
if (result & _BV(6)) {
result |= 0xC0;
}
return result;
}
char TMC26XStepper::getStallGuardFilter(void) {
if (stall_guard2_current_register_value & STALL_GUARD_FILTER_ENABLED) {
return -1;
} else {
return 0;
}
}
/*
* Set the number of microsteps per step.
* 0,2,4,8,16,32,64,128,256 is supported
* any value in between will be mapped to the next smaller value
* 0 and 1 set the motor in full step mode
*/
void TMC26XStepper::setMicrosteps(int number_of_steps) {
long setting_pattern;
//poor mans log
if (number_of_steps>=256) {
setting_pattern=0;
microsteps=256;
} else if (number_of_steps>=128) {
setting_pattern=1;
microsteps=128;
} else if (number_of_steps>=64) {
setting_pattern=2;
microsteps=64;
} else if (number_of_steps>=32) {
setting_pattern=3;
microsteps=32;
} else if (number_of_steps>=16) {
setting_pattern=4;
microsteps=16;
} else if (number_of_steps>=8) {
setting_pattern=5;
microsteps=8;
} else if (number_of_steps>=4) {
setting_pattern=6;
microsteps=4;
} else if (number_of_steps>=2) {
setting_pattern=7;
microsteps=2;
//1 and 0 lead to full step
} else if (number_of_steps<=1) {
setting_pattern=8;
microsteps=1;
}
#ifdef DEBUG
Serial.print("Microstepping: ");
Serial.println(microsteps);
#endif
//delete the old value
this->driver_control_register_value &=0xFFFF0ul;
//set the new value
this->driver_control_register_value |=setting_pattern;
//if started we directly send it to the motor
if (started) {
send262(driver_control_register_value);
}
//recalculate the stepping delay by simply setting the speed again
this->setSpeed(this->speed);
}
/*
* returns the effective number of microsteps at the moment
*/
int TMC26XStepper::getMicrosteps(void) {
return microsteps;
}
/*
* constant_off_time: The off time setting controls the minimum chopper frequency.
* For most applications an off time within the range of 5μs to 20μs will fit.
* 2...15: off time setting
*
* blank_time: Selects the comparator blank time. This time needs to safely cover the switching event and the
* duration of the ringing on the sense resistor. For
* 0: min. setting 3: max. setting
*
* fast_decay_time_setting: Fast decay time setting. With CHM=1, these bits control the portion of fast decay for each chopper cycle.
* 0: slow decay only
* 1...15: duration of fast decay phase
*
* sine_wave_offset: Sine wave offset. With CHM=1, these bits control the sine wave offset.
* A positive offset corrects for zero crossing error.
* -3..-1: negative offset 0: no offset 1...12: positive offset
*
* use_current_comparator: Selects usage of the current comparator for termination of the fast decay cycle.
* If current comparator is enabled, it terminates the fast decay cycle in case the current
* reaches a higher negative value than the actual positive value.
* 1: enable comparator termination of fast decay cycle
* 0: end by time only
*/
void TMC26XStepper::setConstantOffTimeChopper(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, unsigned char use_current_comparator) {
//perform some sanity checks
if (constant_off_time<2) {
constant_off_time=2;
} else if (constant_off_time>15) {
constant_off_time=15;
}
//save the constant off time
this->constant_off_time = constant_off_time;
char blank_value;
//calculate the value acc to the clock cycles
if (blank_time>=54) {
blank_value=3;
} else if (blank_time>=36) {
blank_value=2;
} else if (blank_time>=24) {
blank_value=1;
} else {
blank_value=0;
}
if (fast_decay_time_setting<0) {
fast_decay_time_setting=0;
} else if (fast_decay_time_setting>15) {
fast_decay_time_setting=15;
}
if (sine_wave_offset < -3) {
sine_wave_offset = -3;
} else if (sine_wave_offset>12) {
sine_wave_offset = 12;
}
//shift the sine_wave_offset
sine_wave_offset +=3;
//calculate the register setting
//first of all delete all the values for this
chopper_config_register &= ~((1<<12) | BLANK_TIMING_PATTERN | HYSTERESIS_DECREMENT_PATTERN | HYSTERESIS_LOW_VALUE_PATTERN | HYSTERESIS_START_VALUE_PATTERN | T_OFF_TIMING_PATERN);
//set the constant off pattern
chopper_config_register |= CHOPPER_MODE_T_OFF_FAST_DECAY;
//set the blank timing value
chopper_config_register |= ((unsigned long)blank_value) << BLANK_TIMING_SHIFT;
//setting the constant off time
chopper_config_register |= constant_off_time;
//set the fast decay time
//set msb
chopper_config_register |= (((unsigned long)(fast_decay_time_setting & 0x8))<<HYSTERESIS_DECREMENT_SHIFT);
//other bits
chopper_config_register |= (((unsigned long)(fast_decay_time_setting & 0x7))<<HYSTERESIS_START_VALUE_SHIFT);
//set the sine wave offset
chopper_config_register |= (unsigned long)sine_wave_offset << HYSTERESIS_LOW_SHIFT;
//using the current comparator?
if (!use_current_comparator) {
chopper_config_register |= (1<<12);
}
//if started we directly send it to the motor
if (started) {
send262(driver_control_register_value);
}
}
/*
* constant_off_time: The off time setting controls the minimum chopper frequency.
* For most applications an off time within the range of 5μs to 20μs will fit.
* 2...15: off time setting
*
* blank_time: Selects the comparator blank time. This time needs to safely cover the switching event and the
* duration of the ringing on the sense resistor. For
* 0: min. setting 3: max. setting
*
* hysteresis_start: Hysteresis start setting. Please remark, that this value is an offset to the hysteresis end value HEND.
* 1...8
*
* hysteresis_end: Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by HDEC.
* The sum HSTRT+HEND must be <16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited.
* -3..-1: negative HEND 0: zero HEND 1...12: positive HEND
*
* hysteresis_decrement: Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time.
* 0: fast decrement 3: very slow decrement
*/
void TMC26XStepper::setSpreadCycleChopper(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement) {
//perform some sanity checks
if (constant_off_time<2) {
constant_off_time=2;
} else if (constant_off_time>15) {
constant_off_time=15;
}
//save the constant off time
this->constant_off_time = constant_off_time;
char blank_value;
//calculate the value acc to the clock cycles
if (blank_time>=54) {
blank_value=3;
} else if (blank_time>=36) {
blank_value=2;
} else if (blank_time>=24) {
blank_value=1;
} else {
blank_value=0;
}
if (hysteresis_start<1) {
hysteresis_start=1;
} else if (hysteresis_start>8) {
hysteresis_start=8;
}
hysteresis_start--;
if (hysteresis_end < -3) {
hysteresis_end = -3;
} else if (hysteresis_end>12) {
hysteresis_end = 12;
}
//shift the hysteresis_end
hysteresis_end +=3;
if (hysteresis_decrement<0) {
hysteresis_decrement=0;
} else if (hysteresis_decrement>3) {
hysteresis_decrement=3;
}
//first of all delete all the values for this
chopper_config_register &= ~(CHOPPER_MODE_T_OFF_FAST_DECAY | BLANK_TIMING_PATTERN | HYSTERESIS_DECREMENT_PATTERN | HYSTERESIS_LOW_VALUE_PATTERN | HYSTERESIS_START_VALUE_PATTERN | T_OFF_TIMING_PATERN);
//set the blank timing value
chopper_config_register |= ((unsigned long)blank_value) << BLANK_TIMING_SHIFT;
//setting the constant off time
chopper_config_register |= constant_off_time;
//set the hysteresis_start
chopper_config_register |= ((unsigned long)hysteresis_start) << HYSTERESIS_START_VALUE_SHIFT;
//set the hysteresis end
chopper_config_register |= ((unsigned long)hysteresis_end) << HYSTERESIS_LOW_SHIFT;
//set the hystereis decrement
chopper_config_register |= ((unsigned long)blank_value) << BLANK_TIMING_SHIFT;
//if started we directly send it to the motor
if (started) {
send262(driver_control_register_value);
}
}
/*
* In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized.
* The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity, thus it depends on the microstep position.
* With some motors a slightly audible beat can occur between the chopper frequencies, especially when they are near to each other. This typically occurs at a
* few microstep positions within each quarter wave. This effect normally is not audible when compared to mechanical noise generated by ball bearings, etc.
* Further factors which can cause a similar effect are a poor layout of sense resistor GND connection.
* Hint: A common factor, which can cause motor noise, is a bad PCB layout causing coupling of both sense resistor voltages
* (please refer to sense resistor layout hint in chapter 8.1).
* In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided.
* It modulates the slow decay time setting when switched on by the RNDTF bit. The RNDTF feature further spreads the chopper spectrum,
* reducing electromagnetic emission on single frequencies.
*/
void TMC26XStepper::setRandomOffTime(char value) {
if (value) {
chopper_config_register |= RANDOM_TOFF_TIME;
} else {
chopper_config_register &= ~(RANDOM_TOFF_TIME);
}
//if started we directly send it to the motor
if (started) {
send262(driver_control_register_value);
}
}
void TMC26XStepper::setCoolStepConfiguration(unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size,
unsigned char current_increment_step_size, unsigned char lower_current_limit) {
//sanitize the input values
if (lower_SG_threshold>480) {
lower_SG_threshold = 480;
}
//divide by 32
lower_SG_threshold >>=5;
if (SG_hysteresis>480) {
SG_hysteresis=480;
}
//divide by 32
SG_hysteresis >>=5;
if (current_decrement_step_size>3) {
current_decrement_step_size=3;
}
if (current_increment_step_size>3) {
current_increment_step_size=3;
}
if (lower_current_limit>1) {
lower_current_limit=1;
}
//store the lower level in order to enable/disable the cool step
this->cool_step_lower_threshold=lower_SG_threshold;
//if cool step is not enabled we delete the lower value to keep it disabled
if (!this->cool_step_enabled) {
lower_SG_threshold=0;
}
//the good news is that we can start with a complete new cool step register value
//and simply set the values in the register
cool_step_register_value = ((unsigned long)lower_SG_threshold) | (((unsigned long)SG_hysteresis)<<8) | (((unsigned long)current_decrement_step_size)<<5)
| (((unsigned long)current_increment_step_size)<<13) | (((unsigned long)lower_current_limit)<<15)
//and of course we have to include the signature of the register
| COOL_STEP_REGISTER;
//Serial.println(cool_step_register_value,HEX);
if (started) {
send262(cool_step_register_value);
}
}
void TMC26XStepper::setCoolStepEnabled(boolean enabled) {
//simply delete the lower limit to disable the cool step
cool_step_register_value &= ~SE_MIN_PATTERN;
//and set it to the proper value if cool step is to be enabled
if (enabled) {
cool_step_register_value |=this->cool_step_lower_threshold;
}
//and save the enabled status
this->cool_step_enabled = enabled;
//save the register value
if (started) {
send262(cool_step_register_value);
}
}
boolean TMC26XStepper::isCoolStepEnabled(void) {
return this->cool_step_enabled;
}
unsigned int TMC26XStepper::getCoolStepLowerSgThreshold() {
//we return our internally stored value - in order to provide the correct setting even if cool step is not enabled
return this->cool_step_lower_threshold<<5;
}
unsigned int TMC26XStepper::getCoolStepUpperSgThreshold() {
return (unsigned char)((cool_step_register_value & SE_MAX_PATTERN)>>8)<<5;
}
unsigned char TMC26XStepper::getCoolStepCurrentIncrementSize() {
return (unsigned char)((cool_step_register_value & CURRENT_DOWN_STEP_SPEED_PATTERN)>>13);
}
unsigned char TMC26XStepper::getCoolStepNumberOfSGReadings() {
return (unsigned char)((cool_step_register_value & SE_CURRENT_STEP_WIDTH_PATTERN)>>5);
}
unsigned char TMC26XStepper::getCoolStepLowerCurrentLimit() {
return (unsigned char)((cool_step_register_value & MINIMUM_CURRENT_FOURTH)>>15);
}
void TMC26XStepper::setEnabled(boolean enabled) {
//delete the t_off in the chopper config to get sure
chopper_config_register &= ~(T_OFF_PATTERN);
if (enabled) {
//and set the t_off time
chopper_config_register |= this->constant_off_time;
}
//if not enabled we don't have to do anything since we already delete t_off from the register
if (started) {
send262(chopper_config_register);
}
}
boolean TMC26XStepper::isEnabled() {
if (chopper_config_register & T_OFF_PATTERN) {
return true;
} else {
return false;
}
}
/*
* reads a value from the TMC26X status register. The value is not obtained directly but can then
* be read by the various status routines.
*
*/
void TMC26XStepper::readStatus(char read_value) {
unsigned long old_driver_configuration_register_value = driver_configuration_register_value;
//reset the readout configuration
driver_configuration_register_value &= ~(READ_SELECTION_PATTERN);
//this now equals TMC26X_READOUT_POSITION - so we just have to check the other two options
if (read_value == TMC26X_READOUT_STALLGUARD) {
driver_configuration_register_value |= READ_STALL_GUARD_READING;
} else if (read_value == TMC26X_READOUT_CURRENT) {
driver_configuration_register_value |= READ_STALL_GUARD_AND_COOL_STEP;
}
//all other cases are ignored to prevent funny values
//check if the readout is configured for the value we are interested in
if (driver_configuration_register_value!=old_driver_configuration_register_value) {
//because then we need to write the value twice - one time for configuring, second time to get the value, see below
send262(driver_configuration_register_value);
}
//write the configuration to get the last status
send262(driver_configuration_register_value);
}
int TMC26XStepper::getMotorPosition(void) {
//we read it out even if we are not started yet - perhaps it is useful information for somebody
readStatus(TMC26X_READOUT_POSITION);
return getReadoutValue();
}
//reads the stall guard setting from last status
//returns -1 if stallguard information is not present
int TMC26XStepper::getCurrentStallGuardReading(void) {
//if we don't yet started there cannot be a stall guard value
if (!started) {
return -1;
}
//not time optimal, but solution optiomal:
//first read out the stall guard value
readStatus(TMC26X_READOUT_STALLGUARD);
return getReadoutValue();
}
unsigned char TMC26XStepper::getCurrentCSReading(void) {
//if we don't yet started there cannot be a stall guard value
if (!started) {
return 0;
}
//not time optimal, but solution optiomal:
//first read out the stall guard value
readStatus(TMC26X_READOUT_CURRENT);
return (getReadoutValue() & 0x1f);
}
unsigned int TMC26XStepper::getCurrentCurrent(void) {
double result = (double)getCurrentCSReading();
double resistor_value = (double)this->resistor;
double voltage = (driver_configuration_register_value & VSENSE)? 0.165:0.31;
result = (result+1.0)/32.0*voltage/resistor_value*1000.0*1000.0;
return (unsigned int)result;
}
/*
return true if the stallguard threshold has been reached
*/
boolean TMC26XStepper::isStallGuardOverThreshold(void) {
if (!this->started) {
return false;
}
return (driver_status_result & STATUS_STALL_GUARD_STATUS);
}
/*
returns if there is any over temperature condition:
OVER_TEMPERATURE_PREWARING if pre warning level has been reached
OVER_TEMPERATURE_SHUTDOWN if the temperature is so hot that the driver is shut down
Any of those levels are not too good.
*/
char TMC26XStepper::getOverTemperature(void) {
if (!this->started) {
return 0;
}
if (driver_status_result & STATUS_OVER_TEMPERATURE_SHUTDOWN) {
return TMC26X_OVERTEMPERATURE_SHUTDOWN;
}
if (driver_status_result & STATUS_OVER_TEMPERATURE_WARNING) {
return TMC26X_OVERTEMPERATURE_PREWARING;
}
return 0;
}
//is motor channel A shorted to ground
boolean TMC26XStepper::isShortToGroundA(void) {
if (!this->started) {
return false;
}
return (driver_status_result & STATUS_SHORT_TO_GROUND_A);
}
//is motor channel B shorted to ground
boolean TMC26XStepper::isShortToGroundB(void) {
if (!this->started) {
return false;
}
return (driver_status_result & STATUS_SHORT_TO_GROUND_B);
}
//is motor channel A connected
boolean TMC26XStepper::isOpenLoadA(void) {
if (!this->started) {
return false;
}
return (driver_status_result & STATUS_OPEN_LOAD_A);
}
//is motor channel B connected
boolean TMC26XStepper::isOpenLoadB(void) {
if (!this->started) {
return false;
}
return (driver_status_result & STATUS_OPEN_LOAD_B);
}
//is chopper inactive since 2^20 clock cycles - defaults to ~0,08s
boolean TMC26XStepper::isStandStill(void) {
if (!this->started) {
return false;
}
return (driver_status_result & STATUS_STAND_STILL);
}
//is chopper inactive since 2^20 clock cycles - defaults to ~0,08s
boolean TMC26XStepper::isStallGuardReached(void) {
if (!this->started) {
return false;
}
return (driver_status_result & STATUS_STALL_GUARD_STATUS);
}
//reads the stall guard setting from last status
//returns -1 if stallguard inforamtion is not present
int TMC26XStepper::getReadoutValue(void) {
return (int)(driver_status_result >> 10);
}
int TMC26XStepper::getResistor() {
return this->resistor;
}
boolean TMC26XStepper::isCurrentScalingHalfed() {
if (this->driver_configuration_register_value & VSENSE) {
return true;
} else {
return false;
}
}
/*
version() returns the version of the library:
*/
int TMC26XStepper::version(void)
{
return 1;
}
void TMC26XStepper::debugLastStatus() {
#ifdef DEBUG
if (this->started) {
if (this->getOverTemperature()&TMC26X_OVERTEMPERATURE_PREWARING) {
Serial.println("WARNING: Overtemperature Prewarning!");
} else if (this->getOverTemperature()&TMC26X_OVERTEMPERATURE_SHUTDOWN) {
Serial.println("ERROR: Overtemperature Shutdown!");
}
if (this->isShortToGroundA()) {
Serial.println("ERROR: SHORT to ground on channel A!");
}
if (this->isShortToGroundB()) {
Serial.println("ERROR: SHORT to ground on channel A!");
}
if (this->isOpenLoadA()) {
Serial.println("ERROR: Channel A seems to be unconnected!");
}
if (this->isOpenLoadB()) {
Serial.println("ERROR: Channel B seems to be unconnected!");
}
if (this->isStallGuardReached()) {
Serial.println("INFO: Stall Guard level reached!");
}
if (this->isStandStill()) {
Serial.println("INFO: Motor is standing still.");
}
unsigned long readout_config = driver_configuration_register_value & READ_SELECTION_PATTERN;
int value = getReadoutValue();
if (readout_config == READ_MICROSTEP_POSTION) {
Serial.print("Microstep postion phase A: ");
Serial.println(value);
} else if (readout_config == READ_STALL_GUARD_READING) {
Serial.print("Stall Guard value:");
Serial.println(value);
} else if (readout_config == READ_STALL_GUARD_AND_COOL_STEP) {
int stallGuard = value & 0xf;
int current = value & 0x1F0;
Serial.print("Approx Stall Guard: ");
Serial.println(stallGuard);
Serial.print("Current level");
Serial.println(current);
}
}
#endif
}
/*
* send register settings to the stepper driver via SPI
* returns the current status
*/
inline void TMC26XStepper::send262(unsigned long datagram) {
unsigned long i_datagram;
//preserver the previous spi mode
unsigned char oldMode = SPCR & SPI_MODE_MASK;
//if the mode is not correct set it to mode 3
if (oldMode != SPI_MODE3) {
SPI.setDataMode(SPI_MODE3);
}
//select the TMC driver
digitalWrite(cs_pin,LOW);
//ensure that only valid bist are set (0-19)
//datagram &=REGISTER_BIT_PATTERN;
#ifdef DEBUG
Serial.print("Sending ");
Serial.println(datagram,HEX);
#endif
//write/read the values
i_datagram = SPI.transfer((datagram >> 16) & 0xff);
i_datagram <<= 8;
i_datagram |= SPI.transfer((datagram >> 8) & 0xff);
i_datagram <<= 8;
i_datagram |= SPI.transfer((datagram) & 0xff);
i_datagram >>= 4;
#ifdef DEBUG
Serial.print("Received ");
Serial.println(i_datagram,HEX);
debugLastStatus();
#endif
//deselect the TMC chip
digitalWrite(cs_pin,HIGH);
//restore the previous SPI mode if neccessary
//if the mode is not correct set it to mode 3
if (oldMode != SPI_MODE3) {
SPI.setDataMode(oldMode);
}
//store the datagram as status result
driver_status_result = i_datagram;
}

@ -0,0 +1,607 @@
/*
TMC26XStepper.cpp - - TMC26X Stepper library for Wiring/Arduino
based on the stepper library by Tom Igoe, et. al.
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// ensure this library description is only included once
#ifndef TMC26XStepper_h
#define TMC26XStepper_h
//! return value for TMC26XStepper.getOverTemperature() if there is a overtemperature situation in the TMC chip
/*!
* This warning indicates that the TCM chip is too warm.
* It is still working but some parameters may be inferior.
* You should do something against it.
*/
#define TMC26X_OVERTEMPERATURE_PREWARING 1
//! return value for TMC26XStepper.getOverTemperature() if there is a overtemperature shutdown in the TMC chip
/*!
* This warning indicates that the TCM chip is too warm to operate and has shut down to prevent damage.
* It will stop working until it cools down again.
* If you encouter this situation you must do something against it. Like reducing the current or improving the PCB layout
* and/or heat management.
*/
#define TMC26X_OVERTEMPERATURE_SHUTDOWN 2
//which values can be read out
/*!
* Selects to readout the microstep position from the motor.
*\sa readStatus()
*/
#define TMC26X_READOUT_POSITION 0
/*!
* Selects to read out the StallGuard value of the motor.
*\sa readStatus()
*/
#define TMC26X_READOUT_STALLGUARD 1
/*!
* Selects to read out the current current setting (acc. to CoolStep) and the upper bits of the StallGuard value from the motor.
*\sa readStatus(), setCurrent()
*/
#define TMC26X_READOUT_CURRENT 3
/*!
* Define to set the minimum current for CoolStep operation to 1/2 of the selected CS minium.
*\sa setCoolStepConfiguration()
*/
#define COOL_STEP_HALF_CS_LIMIT 0
/*!
* Define to set the minimum current for CoolStep operation to 1/4 of the selected CS minium.
*\sa setCoolStepConfiguration()
*/
#define COOL_STEP_QUARTDER_CS_LIMIT 1
/*!
* \class TMC26XStepper
* \brief Class representing a TMC26X stepper driver
*
* In order to use one fo those drivers in your Arduino code you have to create an object of that class:
* \code
* TMC26XStepper stepper = TMC26XStepper(200,1,2,3,500);
* \endcode
* see TMC26XStepper(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int rms_current)
*
* Keep in mind that you need to start the driver with start() in order to get the TMC26X configured.
*
* The most important function is the move(). It checks if the motor has to do a step or not.
* It is important that you call move() as often as possible in your Arduino loop() routine. I suggest
* to use a very fast loop routine and always call it at the beginning or the end.
*
* In order to move you have to provide a movement speed with setSpeed(). The speed is a positive value setting
* the rotations per minute.
*
* To really move the motor you have to call step() to tell the driver to move the motor the given number
* of steps in the given direction. Positive values move the motor in one direction, negative values in the other direction.
*
* You can check with isMoving() if the mototr is still moving or stop it apruptely with stop().
*/
class TMC26XStepper {
public:
/*!
* \brief creates a new represenatation of a stepper motor connected to a TMC26X stepper driver
*
* This is the main constructor. If in doubt use this. You must provide all parameters as described below.
*
* \param number_of_steps the number of steps the motor has per rotation.
* \param cs_pin The Arduino pin you have connected the Cient Select Pin (!CS) of the TMC26X for SPI
* \param dir_pin the number of the Arduino pin the Direction input of the TMC26X is connected
* \param step_pin the number of the Arduino pin the step pin of the TMC26X driver is connected.
* \param rms_current the maximum current to privide to the motor in mA (!). A value of 200 would send up to 200mA to the motor
* \param resistor the current sense resistor in milli Ohm, defaults to ,15 Ohm ( or 150 milli Ohm) as in the TMC260 Arduino Shield
*
* Keep in mind that you must also call TMC26XStepper.start() in order to configure the stepper driver for use.
*
* By default the Constant Off Time chopper is used, see TCM262Stepper.setConstantOffTimeChopper() for details.
* This should work on most motors (YMMV). You may want to configure and use the Spread Cycle Chopper, see setSpreadCycleChopper().
*
* By default a microstepping of 1/32th is used to provide a smooth motor run, while still giving a good progression per step.
* You can select a different stepping with setMicrosteps() to aa different value.
* \sa start(), setMicrosteps()
*/
TMC26XStepper(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int current, unsigned int resistor=150);
/*!
* \brief configures and starts the TMC26X stepper driver. Before you called this function the stepper driver is in nonfunctional mode.
*
* This routine configures the TMC26X stepper driver for the given values via SPI.
* Most member functions are non functional if the driver has not been started.
* Therefore it is best to call this in your Arduino setup() function.
*/
void start();
/*!
* \brief resets the stepper in unconfigured mode.
*
* This routine enables you to call start again. It does not change anything
* in the internal stepper configuration or the desired configuration.
* It just marks the stepper as not yet startet. You do not have to reconfigure
* the stepper to start it again, but it is not reset to any factory settings
* this has to be configured back by yourself.
* (Hint: Normally you do not need this function)
*/
void un_start();
/*!
* \brief Sets the rotation speed in revolutions per minute.
* \param whatSpeed the desired speed in rotations per minute.
*/
void setSpeed(unsigned int whatSpeed);
/*!
* \brief reads out the currently selected speed in revolutions per minute.
* \sa setSpeed()
*/
unsigned int getSpeed(void);
/*!
* \brief Set the number of microsteps in 2^i values (rounded) up to 256
*
* This method set's the number of microsteps per step in 2^i interval.
* This means you can select 1, 2, 4, 16, 32, 64, 128 or 256 as valid microsteps.
* If you give any other value it will be rounded to the next smaller number (3 would give a microstepping of 2).
* You can always check the current microstepping with getMicrosteps().
*/
void setMicrosteps(int number_of_steps);
/*!
* \brief returns the effective current number of microsteps selected.
*
* This function always returns the effective number of microsteps.
* This can be a bit different than the micro steps set in setMicrosteps() since it is rounded to 2^i.
*
* \sa setMicrosteps()
*/
int getMicrosteps(void);
/*!
* \brief Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in the other direction.
*
* \param number_of_steps The number of steps to move the motor.
* \return 0 if the motor was not moving and moves now. -1 if the motor is moving and the new steps could not be set.
*
* If the previous movement is not finished yet the function will return -1 and not change the steps to move the motor.
* If the motor does not move it return 0
*
* The direction of the movement is indicated by the sign of the steps parameter. It is not determinable if positive values are right
* or left This depends on the internal construction of the motor and how you connected it to the stepper driver.
*
* You can always verify with isMoving() or even use stop() to stop the motor before giving it new step directions.
* \sa isMoving(), getStepsLeft(), stop()
*/
char step(int number_of_steps);
/*!
* \brief Central movement method, must be called as often as possible in the lopp function and is very fast.
*
* This routine checks if the motor still has to move, if the waiting delay has passed to send a new step command to the motor
* and manages the number of steps yet to move to fulfill the current move command.
*
* This function is implemented to be as fast as possible to call it as often as possible in your loop routine.
* The more regurlarly you call this function the better. In both senses of 'regularly': Calling it as often as
* possible is not a bad idea and if you even manage that the intervals you call this function are not too irregular helps too.
*
* You can call this routine even if you know that the motor is not miving. It introduces just a very small penalty in your code.
* You must not call isMoving() to determine if you need to call this function, since taht is done internally already and only
* slows down you code.
*
* How often you call this function directly influences your top miving speed for the motor. It may be a good idea to call this
* from an timer overflow interrupt to ensure proper calling.
* \sa step()
*/
char move(void);
/*!
* \brief checks if the motor still has to move to fulfill the last movement command.
* \return 0 if the motor stops, -1 if the motor is moving.
*
* This method can be used to determine if the motor is ready for new movements.
*\sa step(), move()
*/
char isMoving(void);
/*!
* \brief Get the number of steps left in the current movement.
* \return The number of steps left in the movement. This number is always positive.
*/
unsigned int getStepsLeft(void);
/*!
* \brief Stops the motor regardless if it moves or not.
* \return -1 if the motor was moving and is really stoped or 0 if it was not moving at all.
*
* This method directly and apruptely stops the motor and may be used as an emergency stop.
*/
char stop(void);
/*!
* \brief Sets and configure the classical Constant Off Timer Chopper
* \param constant_off_time The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks)
* \param blank_time Selects the comparator blank time. This time needs to safely cover the switching event and the duration of the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) (3) amx setting
* \param fast_decay_time_setting Fast decay time setting. Controls the portion of fast decay for each chopper cycle. 0: slow decay only, 115: duration of fast decay phase
* \param sine_wave_offset Sine wave offset. Controls the sine wave offset. A positive offset corrects for zero crossing error. -3-1: negative offset, 0: no offset,112: positive offset
* \param use_curreent_comparator Selects usage of the current comparator for termination of the fast decay cycle. If current comparator is enabled, it terminates the fast decay cycle in case the current reaches a higher negative value than the actual positive value. (0 disable, -1 enable).
*
* The classic constant off time chopper uses a fixed portion of fast decay following each on phase.
* While the duration of the on time is determined by the chopper comparator, the fast decay time needs
* to be set by the user in a way, that the current decay is enough for the driver to be able to follow
* the falling slope of the sine wave, and on the other hand it should not be too long, in order to minimize
* motor current ripple and power dissipation. This best can be tuned using an oscilloscope or
* trying out motor smoothness at different velocities. A good starting value is a fast decay time setting
* similar to the slow decay time setting.
* After tuning of the fast decay time, the offset should be determined, in order to have a smooth zero transition.
* This is necessary, because the fast decay phase leads to the absolute value of the motor current being lower
* than the target current (see figure 17). If the zero offset is too low, the motor stands still for a short
* moment during current zero crossing, if it is set too high, it makes a larger microstep.
* Typically, a positive offset setting is required for optimum operation.
*
* \sa setSpreadCycleChoper() for other alternatives.
* \sa setRandomOffTime() for spreading the noise over a wider spectrum
*/
void setConstantOffTimeChopper(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, unsigned char use_current_comparator);
/*!
* \brief Sets and configures with spread cycle chopper.
* \param constant_off_time The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks)
* \param blank_time Selects the comparator blank time. This time needs to safely cover the switching event and the duration of the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) (3) amx setting
* \param hysteresis_start Hysteresis start setting. Please remark, that this value is an offset to the hysteresis end value. 1 8
* \param hysteresis_end Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by hysteresis_decrement. The sum hysteresis_start + hysteresis_end must be <16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited.
* \param hysteresis_decrement Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time. 0 (fast decrement) 3 (slow decrement).
*
* The spreadCycle chopper scheme (pat.fil.) is a precise and simple to use chopper principle, which automatically determines
* the optimum fast decay portion for the motor. Anyhow, a number of settings can be made in order to optimally fit the driver
* to the motor.
* Each chopper cycle is comprised of an on-phase, a slow decay phase, a fast decay phase and a second slow decay phase.
* The slow decay phases limit the maximum chopper frequency and are important for low motor and driver power dissipation.
* The hysteresis start setting limits the chopper frequency by forcing the driver to introduce a minimum amount of
* current ripple into the motor coils. The motor inductivity determines the ability to follow a changing motor current.
* The duration of the on- and fast decay phase needs to cover at least the blank time, because the current comparator is
* disabled during this time.
*
* \sa setRandomOffTime() for spreading the noise over a wider spectrum
*/
void setSpreadCycleChopper(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement);
/*!
* \brief Use random off time for noise reduction (0 for off, -1 for on).
* \param value 0 for off, -1 for on
*
* In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized.
* The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity,
* thus it depends on the microstep position. With some motors a slightly audible beat can occur between the chopper
* frequencies, especially when they are near to each other. This typically occurs at a few microstep positions within
* each quarter wave.
* This effect normally is not audible when compared to mechanical noise generated by ball bearings,
* etc. Further factors which can cause a similar effect are a poor layout of sense resistor GND connection.
* In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided.
* It modulates the slow decay time setting when switched on. The random off time feature further spreads the chopper spectrum,
* reducing electromagnetic emission on single frequencies.
*/
void setRandomOffTime(char value);
/*!
* \brief set the maximum motor current in mA (1000 is 1 Amp)
* Keep in mind this is the maximum peak Current. The RMS current will be 1/sqrt(2) smaller. The actual current can also be smaller
* by employing CoolStep.
* \param current the maximum motor current in mA
* \sa getCurrent(), getCurrentCurrent()
*/
void setCurrent(unsigned int current);
/*!
* \brief readout the motor maximum current in mA (1000 is an Amp)
* This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()
*\return the maximum motor current in milli amps
* \sa getCurrentCurrent()
*/
unsigned int getCurrent(void);
/*!
* \brief set the StallGuard threshold in order to get sensible StallGuard readings.
* \param stall_guard_threshold -64 63 the StallGuard threshold
* \param stall_guard_filter_enabled 0 if the filter is disabled, -1 if it is enabled
*
* The StallGuard threshold is used to optimize the StallGuard reading to sensible values. It should be at 0 at
* the maximum allowable load on the otor (but not before). = is a good starting point (and the default)
* If you get Stall Gaurd readings of 0 without any load or with too little laod increase the value.
* If you get readings of 1023 even with load decrease the setting.
*
* If you switch on the filter the StallGuard reading is only updated each 4th full step to reduce the noise in the
* reading.
*
* \sa getCurrentStallGuardReading() to read out the current value.
*/
void setStallGuardThreshold(char stall_guard_threshold, char stall_guard_filter_enabled);
/*!
* \brief reads out the StallGuard threshold
* \return a number between -64 and 63.
*/
char getStallGuardThreshold(void);
/*!
* \brief returns the current setting of the StallGuard filter
* \return 0 if not set, -1 if set
*/
char getStallGuardFilter(void);
/*!
* \brief This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature.
* \param lower_SG_threshold Sets the lower threshold for stallGuard2TM reading. Below this value, the motor current becomes increased. Allowed values are 0...480
* \param SG_hysteresis Sets the distance between the lower and the upper threshold for stallGuard2TM reading. Above the upper threshold (which is lower_SG_threshold+SG_hysteresis+1) the motor current becomes decreased. Allowed values are 0...480
* \param current_decrement_step_size Sets the current decrement steps. If the StallGuard value is above the threshold the current gets decremented by this step size. 0...32
* \param current_increment_step_size Sets the current increment step. The current becomes incremented for each measured stallGuard2TM value below the lower threshold. 0...8
* \param lower_current_limit Sets the lower motor current limit for coolStepTM operation by scaling the CS value. Values can be COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT
* The CoolStep smart energy operation automatically adjust the current sent into the motor according to the current load,
* read out by the StallGuard in order to provide the optimum torque with the minimal current consumption.
* You configure the CoolStep current regulator by defining upper and lower bounds of StallGuard readouts. If the readout is above the
* limit the current gets increased, below the limit the current gets decreased.
* You can specify the upper an lower threshold of the StallGuard readout in order to adjust the current. You can also set the number of
* StallGuard readings neccessary above or below the limit to get a more stable current adjustement.
* The current adjustement itself is configured by the number of steps the current gests in- or decreased and the absolut minimum current
* (1/2 or 1/4th otf the configured current).
* \sa COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT
*/
void setCoolStepConfiguration(unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size,
unsigned char current_increment_step_size, unsigned char lower_current_limit);
/*!
* \brief enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it.
* \param enabled true if CoolStep should be enabled, false if not.
* \sa setCoolStepConfiguration()
*/
void setCoolStepEnabled(boolean enabled);
/*!
* \brief check if the CoolStep feature is enabled
* \sa setCoolStepEnabled()
*/
boolean isCoolStepEnabled();
/*!
* \brief returns the lower StallGuard threshold for the CoolStep operation
* \sa setCoolStepConfiguration()
*/
unsigned int getCoolStepLowerSgThreshold();
/*!
* \brief returns the upper StallGuard threshold for the CoolStep operation
* \sa setCoolStepConfiguration()
*/
unsigned int getCoolStepUpperSgThreshold();
/*!
* \brief returns the number of StallGuard readings befor CoolStep adjusts the motor current.
* \sa setCoolStepConfiguration()
*/
unsigned char getCoolStepNumberOfSGReadings();
/*!
* \brief returns the increment steps for the current for the CoolStep operation
* \sa setCoolStepConfiguration()
*/
unsigned char getCoolStepCurrentIncrementSize();
/*!
* \brief returns the absolut minium current for the CoolStep operation
* \sa setCoolStepConfiguration()
* \sa COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT
*/
unsigned char getCoolStepLowerCurrentLimit();
/*!
* \brief Get the current microstep position for phase A
* \return The current microstep position for phase A 0255
*
* Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time.
*/
int getMotorPosition(void);
/*!
* \brief Reads the current StallGuard value.
* \return The current StallGuard value, lesser values indicate higher load, 0 means stall detected.
* Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time.
* \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
*/
int getCurrentStallGuardReading(void);
/*!
* \brief Reads the current current setting value as fraction of the maximum current
* Returns values between 0 and 31, representing 1/32 to 32/32 (=1)
* \sa setCoolStepConfiguration()
*/
unsigned char getCurrentCSReading(void);
/*!
*\brief a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference.
*\return false if 0.13V is the reference voltage, true if 0.165V is used.
*/
boolean isCurrentScalingHalfed();
/*!
* \brief Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000).
* This method calculates the currently used current setting (either by setting or by CoolStep) and reconstructs
* the current in mA by usinge the VSENSE and resistor value. This method uses floating point math - so it
* may not be the fastest.
* \sa getCurrentCSReading(), getResistor(), isCurrentScalingHalfed(), getCurrent()
*/
unsigned int getCurrentCurrent(void);
/*!
* \brief checks if there is a StallGuard warning in the last status
* \return 0 if there was no warning, -1 if there was some warning.
* Keep in mind that this method does not enforce a readout but uses the value of the last status readout.
* You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
*
* \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
*/
boolean isStallGuardOverThreshold(void);
/*!
* \brief Return over temperature status of the last status readout
* return 0 is everything is OK, TMC26X_OVERTEMPERATURE_PREWARING if status is reached, TMC26X_OVERTEMPERATURE_SHUTDOWN is the chip is shutdown, -1 if the status is unknown.
* Keep in mind that this method does not enforce a readout but uses the value of the last status readout.
* You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
*/
char getOverTemperature(void);
/*!
* \brief Is motor channel A shorted to ground detected in the last status readout.
* \return true is yes, false if not.
* Keep in mind that this method does not enforce a readout but uses the value of the last status readout.
* You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
*/
boolean isShortToGroundA(void);
/*!
* \brief Is motor channel B shorted to ground detected in the last status readout.
* \return true is yes, false if not.
* Keep in mind that this method does not enforce a readout but uses the value of the last status readout.
* You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
*/
boolean isShortToGroundB(void);
/*!
* \brief iIs motor channel A connected according to the last statu readout.
* \return true is yes, false if not.
* Keep in mind that this method does not enforce a readout but uses the value of the last status readout.
* You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
*/
boolean isOpenLoadA(void);
/*!
* \brief iIs motor channel A connected according to the last statu readout.
* \return true is yes, false if not.
* Keep in mind that this method does not enforce a readout but uses the value of the last status readout.
* You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
*/
boolean isOpenLoadB(void);
/*!
* \brief Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s
* \return true is yes, false if not.
* Keep in mind that this method does not enforce a readout but uses the value of the last status readout.
* You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
*/
boolean isStandStill(void);
/*!
* \brief checks if there is a StallGuard warning in the last status
* \return 0 if there was no warning, -1 if there was some warning.
* Keep in mind that this method does not enforce a readout but uses the value of the last status readout.
* You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
*
* \sa isStallGuardOverThreshold()
* TODO why?
*
* \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
*/
boolean isStallGuardReached(void);
/*!
*\brief enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not.
*\param enabled a boolean value true if the motor should be enabled, false otherwise.
*/
void setEnabled(boolean enabled);
/*!
*\brief checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely
*\return true if the bridges and by that the motor driver are enabled, false if not.
*\sa setEnabled()
*/
boolean isEnabled();
/*!
* \brief Manually read out the status register
* This function sends a byte to the motor driver in order to get the current readout. The parameter read_value
* seletcs which value will get returned. If the read_vlaue changes in respect to the previous readout this method
* automatically send two bytes to the motor: one to set the redout and one to get the actual readout. So this method
* may take time to send and read one or two bits - depending on the previous readout.
* \param read_value selects which value to read out (0..3). You can use the defines TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, or TMC_262_READOUT_CURRENT
* \sa TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, TMC_262_READOUT_CURRENT
*/
void readStatus(char read_value);
/*!
* \brief Returns the current sense resistor value in milliohm.
* The default value of ,15 Ohm will return 150.
*/
int getResistor();
/*!
* \brief Prints out all the information that can be found in the last status read out - it does not force a status readout.
* The result is printed via Serial
*/
void debugLastStatus(void);
/*!
* \brief library version
* \return the version number as int.
*/
int version(void);
private:
unsigned int steps_left; //the steps the motor has to do to complete the movement
int direction; // Direction of rotation
unsigned long step_delay; // delay between steps, in ms, based on speed
int number_of_steps; // total number of steps this motor can take
unsigned int speed; // we need to store the current speed in order to change the speed after changing microstepping
unsigned int resistor; //current sense resitor value in milliohm
unsigned long last_step_time; // time stamp in ms of when the last step was taken
unsigned long next_step_time; // time stamp in ms of when the last step was taken
//driver control register copies to easily set & modify the registers
unsigned long driver_control_register_value;
unsigned long chopper_config_register;
unsigned long cool_step_register_value;
unsigned long stall_guard2_current_register_value;
unsigned long driver_configuration_register_value;
//the driver status result
unsigned long driver_status_result;
//helper routione to get the top 10 bit of the readout
inline int getReadoutValue();
//the pins for the stepper driver
unsigned char cs_pin;
unsigned char step_pin;
unsigned char dir_pin;
//status values
boolean started; //if the stepper has been started yet
int microsteps; //the current number of micro steps
char constant_off_time; //we need to remember this value in order to enable and disable the motor
unsigned char cool_step_lower_threshold; // we need to remember the threshold to enable and disable the CoolStep feature
boolean cool_step_enabled; //we need to remember this to configure the coolstep if it si enabled
//SPI sender
inline void send262(unsigned long datagram);
};
#endif

@ -0,0 +1,848 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: TMC26XStepper.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<div class="title">TMC26XStepper.cpp File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;WProgram.h&gt;</code><br/>
<code>#include &lt;SPI.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>&quot;</code><br/>
</div>
<p><a href="_t_m_c26_x_stepper_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a6560b3471273e99e280ba795e3469ede">DEFAULT_MICROSTEPPING_VALUE</a>&#160;&#160;&#160;32</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a108f18bf4a30a0e0f0991ac0e4ce0579">DRIVER_CONTROL_REGISTER</a>&#160;&#160;&#160;0x0ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a70a540d1090b989b8600b5e4776659fe">CHOPPER_CONFIG_REGISTER</a>&#160;&#160;&#160;0x80000ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab9828bfaa075a0a8647c709136016317">COOL_STEP_REGISTER</a>&#160;&#160;&#160;0xA0000ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a478d9bde09a6528eef6af6ffeeb6caba">STALL_GUARD2_LOAD_MEASURE_REGISTER</a>&#160;&#160;&#160;0xC0000ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#af35f569d42ea3b1d634901a3b6a908ee">DRIVER_CONFIG_REGISTER</a>&#160;&#160;&#160;0xE0000ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a3b02ee1f518b0c90c16488f937abd443">REGISTER_BIT_PATTERN</a>&#160;&#160;&#160;0xFFFFFul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8f5cb0c066109ffb18cefc0e85ee1d1b">MICROSTEPPING_PATTERN</a>&#160;&#160;&#160;0xFul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa64245f223209654c60588e4558e0bab">STEP_INTERPOLATION</a>&#160;&#160;&#160;0x200ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a770601bf0153e4bc639b9c3005b15af7">DOUBLE_EDGE_STEP</a>&#160;&#160;&#160;0x100ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a4fb1c008e2ff76eee9362600eed112e1">VSENSE</a>&#160;&#160;&#160;0x40ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a143b7757272f07866d9655bde8303d9a">READ_MICROSTEP_POSTION</a>&#160;&#160;&#160;0x0ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac1bd4da94fab7ce1049be2f866211819">READ_STALL_GUARD_READING</a>&#160;&#160;&#160;0x10ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#aef62b7fdcbac0b33b2d6e9cea4b5f9b2">READ_STALL_GUARD_AND_COOL_STEP</a>&#160;&#160;&#160;0x20ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a88a4b45fa6385eba8aa4f0342334b832">READ_SELECTION_PATTERN</a>&#160;&#160;&#160;0x30ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a57418a67ff726d540b813230bca1d536">CHOPPER_MODE_STANDARD</a>&#160;&#160;&#160;0x0ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#aaf1b564ced7de8ff3245c964e3775826">CHOPPER_MODE_T_OFF_FAST_DECAY</a>&#160;&#160;&#160;0x4000ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa4e49237f2671e7f28aa34ae0e89da8d">T_OFF_PATTERN</a>&#160;&#160;&#160;0xful</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a64520580cffd416668f3b91bd60f84e1">RANDOM_TOFF_TIME</a>&#160;&#160;&#160;0x2000ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a42cb2ce84258587d514ec3268548ba89">BLANK_TIMING_PATTERN</a>&#160;&#160;&#160;0x18000ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#abdac78f7f2c506972265a8e5883e1eae">BLANK_TIMING_SHIFT</a>&#160;&#160;&#160;15</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a424c248097b38c1e29e6a58ad48e6bd9">HYSTERESIS_DECREMENT_PATTERN</a>&#160;&#160;&#160;0x1800ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a36e554a87785ce6ba998b79aae9e74e0">HYSTERESIS_DECREMENT_SHIFT</a>&#160;&#160;&#160;11</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#ad9d2302f6d61cd84a612a2e2bcdeb56e">HYSTERESIS_LOW_VALUE_PATTERN</a>&#160;&#160;&#160;0x780ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a38ce0bb0fa20db28351ac9167f28db98">HYSTERESIS_LOW_SHIFT</a>&#160;&#160;&#160;7</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a0de4e98b412dced62c3a4452b7483af3">HYSTERESIS_START_VALUE_PATTERN</a>&#160;&#160;&#160;0x78ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac2c1c939256126e605396c4aaee3c804">HYSTERESIS_START_VALUE_SHIFT</a>&#160;&#160;&#160;4</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a7659d842c803e47ba911a2a6e26327f3">T_OFF_TIMING_PATERN</a>&#160;&#160;&#160;0xFul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8a261a77d198b85f6dd8416387b354b3">MINIMUM_CURRENT_FOURTH</a>&#160;&#160;&#160;0x8000ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#adbe13a0464355e42fbe786ca5f58ed8d">CURRENT_DOWN_STEP_SPEED_PATTERN</a>&#160;&#160;&#160;0x6000ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac8f748bf735c447dbed7dd4c7b631a87">SE_MAX_PATTERN</a>&#160;&#160;&#160;0xF00ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#aba6c07e5672e34e618bb3a550ab0d2bc">SE_CURRENT_STEP_WIDTH_PATTERN</a>&#160;&#160;&#160;0x60ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae1862dfb958c03698b0abd95fda033ea">SE_MIN_PATTERN</a>&#160;&#160;&#160;0xful</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#afdbbefabd0c29c4b6e403c4663d0f0be">STALL_GUARD_FILTER_ENABLED</a>&#160;&#160;&#160;0x10000ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae631457932894a974334892704550ecc">STALL_GUARD_TRESHHOLD_VALUE_PATTERN</a>&#160;&#160;&#160;0x17F00ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a99dcb8c6d98b0b54c23699a3f90450e4">CURRENT_SCALING_PATTERN</a>&#160;&#160;&#160;0x1Ful</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a99ac04f0615556fc13c0c9f3e1c1b49d">STALL_GUARD_CONFIG_PATTERN</a>&#160;&#160;&#160;0x17F00ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a6a1cb1fd61cf7c570f94376fa11fe55b">STALL_GUARD_VALUE_PATTERN</a>&#160;&#160;&#160;0x7F00ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa09ef662fd19bf2d063d6bd0f48eca14">STATUS_STALL_GUARD_STATUS</a>&#160;&#160;&#160;0x1ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#adbb23d2f055c9eab55eac29d1a75deb4">STATUS_OVER_TEMPERATURE_SHUTDOWN</a>&#160;&#160;&#160;0x2ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa317fd77f2f26fdfbfd331e21d9069e8">STATUS_OVER_TEMPERATURE_WARNING</a>&#160;&#160;&#160;0x4ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8e03041302a092174fa33b3cf837dca2">STATUS_SHORT_TO_GROUND_A</a>&#160;&#160;&#160;0x8ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a903c3eba99695a32c6736463dcfd93ae">STATUS_SHORT_TO_GROUND_B</a>&#160;&#160;&#160;0x10ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae9cbbe5af7188e6bff8fe412f8e42f59">STATUS_OPEN_LOAD_A</a>&#160;&#160;&#160;0x20ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab29dc5cd6c6c4e5bf99e71bd563e1be1">STATUS_OPEN_LOAD_B</a>&#160;&#160;&#160;0x40ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab96ed1635faee6650e9cce73598a2773">STATUS_STAND_STILL</a>&#160;&#160;&#160;0x80ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a5c3d76da63f585e37813c32be2e11ab7">READOUT_VALUE_PATTERN</a>&#160;&#160;&#160;0xFFC00ul</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8cpp.html#a54a6d12e96d851361974b10614a00e45">INITIAL_MICROSTEPPING</a>&#160;&#160;&#160;0x3ul</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a42cb2ce84258587d514ec3268548ba89"></a><!-- doxytag: member="TMC26XStepper.cpp::BLANK_TIMING_PATTERN" ref="a42cb2ce84258587d514ec3268548ba89" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a42cb2ce84258587d514ec3268548ba89">BLANK_TIMING_PATTERN</a>&#160;&#160;&#160;0x18000ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00063">63</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="abdac78f7f2c506972265a8e5883e1eae"></a><!-- doxytag: member="TMC26XStepper.cpp::BLANK_TIMING_SHIFT" ref="abdac78f7f2c506972265a8e5883e1eae" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#abdac78f7f2c506972265a8e5883e1eae">BLANK_TIMING_SHIFT</a>&#160;&#160;&#160;15</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00064">64</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a70a540d1090b989b8600b5e4776659fe"></a><!-- doxytag: member="TMC26XStepper.cpp::CHOPPER_CONFIG_REGISTER" ref="a70a540d1090b989b8600b5e4776659fe" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a70a540d1090b989b8600b5e4776659fe">CHOPPER_CONFIG_REGISTER</a>&#160;&#160;&#160;0x80000ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00041">41</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a57418a67ff726d540b813230bca1d536"></a><!-- doxytag: member="TMC26XStepper.cpp::CHOPPER_MODE_STANDARD" ref="a57418a67ff726d540b813230bca1d536" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a57418a67ff726d540b813230bca1d536">CHOPPER_MODE_STANDARD</a>&#160;&#160;&#160;0x0ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00059">59</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aaf1b564ced7de8ff3245c964e3775826"></a><!-- doxytag: member="TMC26XStepper.cpp::CHOPPER_MODE_T_OFF_FAST_DECAY" ref="aaf1b564ced7de8ff3245c964e3775826" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aaf1b564ced7de8ff3245c964e3775826">CHOPPER_MODE_T_OFF_FAST_DECAY</a>&#160;&#160;&#160;0x4000ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00060">60</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab9828bfaa075a0a8647c709136016317"></a><!-- doxytag: member="TMC26XStepper.cpp::COOL_STEP_REGISTER" ref="ab9828bfaa075a0a8647c709136016317" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab9828bfaa075a0a8647c709136016317">COOL_STEP_REGISTER</a>&#160;&#160;&#160;0xA0000ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00042">42</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="adbe13a0464355e42fbe786ca5f58ed8d"></a><!-- doxytag: member="TMC26XStepper.cpp::CURRENT_DOWN_STEP_SPEED_PATTERN" ref="adbe13a0464355e42fbe786ca5f58ed8d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#adbe13a0464355e42fbe786ca5f58ed8d">CURRENT_DOWN_STEP_SPEED_PATTERN</a>&#160;&#160;&#160;0x6000ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00075">75</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a99dcb8c6d98b0b54c23699a3f90450e4"></a><!-- doxytag: member="TMC26XStepper.cpp::CURRENT_SCALING_PATTERN" ref="a99dcb8c6d98b0b54c23699a3f90450e4" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a99dcb8c6d98b0b54c23699a3f90450e4">CURRENT_SCALING_PATTERN</a>&#160;&#160;&#160;0x1Ful</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00083">83</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6560b3471273e99e280ba795e3469ede"></a><!-- doxytag: member="TMC26XStepper.cpp::DEFAULT_MICROSTEPPING_VALUE" ref="a6560b3471273e99e280ba795e3469ede" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a6560b3471273e99e280ba795e3469ede">DEFAULT_MICROSTEPPING_VALUE</a>&#160;&#160;&#160;32</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00037">37</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a770601bf0153e4bc639b9c3005b15af7"></a><!-- doxytag: member="TMC26XStepper.cpp::DOUBLE_EDGE_STEP" ref="a770601bf0153e4bc639b9c3005b15af7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a770601bf0153e4bc639b9c3005b15af7">DOUBLE_EDGE_STEP</a>&#160;&#160;&#160;0x100ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00051">51</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af35f569d42ea3b1d634901a3b6a908ee"></a><!-- doxytag: member="TMC26XStepper.cpp::DRIVER_CONFIG_REGISTER" ref="af35f569d42ea3b1d634901a3b6a908ee" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#af35f569d42ea3b1d634901a3b6a908ee">DRIVER_CONFIG_REGISTER</a>&#160;&#160;&#160;0xE0000ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00044">44</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a108f18bf4a30a0e0f0991ac0e4ce0579"></a><!-- doxytag: member="TMC26XStepper.cpp::DRIVER_CONTROL_REGISTER" ref="a108f18bf4a30a0e0f0991ac0e4ce0579" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a108f18bf4a30a0e0f0991ac0e4ce0579">DRIVER_CONTROL_REGISTER</a>&#160;&#160;&#160;0x0ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00040">40</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a424c248097b38c1e29e6a58ad48e6bd9"></a><!-- doxytag: member="TMC26XStepper.cpp::HYSTERESIS_DECREMENT_PATTERN" ref="a424c248097b38c1e29e6a58ad48e6bd9" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a424c248097b38c1e29e6a58ad48e6bd9">HYSTERESIS_DECREMENT_PATTERN</a>&#160;&#160;&#160;0x1800ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00065">65</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a36e554a87785ce6ba998b79aae9e74e0"></a><!-- doxytag: member="TMC26XStepper.cpp::HYSTERESIS_DECREMENT_SHIFT" ref="a36e554a87785ce6ba998b79aae9e74e0" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a36e554a87785ce6ba998b79aae9e74e0">HYSTERESIS_DECREMENT_SHIFT</a>&#160;&#160;&#160;11</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00066">66</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a38ce0bb0fa20db28351ac9167f28db98"></a><!-- doxytag: member="TMC26XStepper.cpp::HYSTERESIS_LOW_SHIFT" ref="a38ce0bb0fa20db28351ac9167f28db98" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a38ce0bb0fa20db28351ac9167f28db98">HYSTERESIS_LOW_SHIFT</a>&#160;&#160;&#160;7</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00068">68</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ad9d2302f6d61cd84a612a2e2bcdeb56e"></a><!-- doxytag: member="TMC26XStepper.cpp::HYSTERESIS_LOW_VALUE_PATTERN" ref="ad9d2302f6d61cd84a612a2e2bcdeb56e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ad9d2302f6d61cd84a612a2e2bcdeb56e">HYSTERESIS_LOW_VALUE_PATTERN</a>&#160;&#160;&#160;0x780ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00067">67</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a0de4e98b412dced62c3a4452b7483af3"></a><!-- doxytag: member="TMC26XStepper.cpp::HYSTERESIS_START_VALUE_PATTERN" ref="a0de4e98b412dced62c3a4452b7483af3" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a0de4e98b412dced62c3a4452b7483af3">HYSTERESIS_START_VALUE_PATTERN</a>&#160;&#160;&#160;0x78ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00069">69</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac2c1c939256126e605396c4aaee3c804"></a><!-- doxytag: member="TMC26XStepper.cpp::HYSTERESIS_START_VALUE_SHIFT" ref="ac2c1c939256126e605396c4aaee3c804" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac2c1c939256126e605396c4aaee3c804">HYSTERESIS_START_VALUE_SHIFT</a>&#160;&#160;&#160;4</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00070">70</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a54a6d12e96d851361974b10614a00e45"></a><!-- doxytag: member="TMC26XStepper.cpp::INITIAL_MICROSTEPPING" ref="a54a6d12e96d851361974b10614a00e45" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a54a6d12e96d851361974b10614a00e45">INITIAL_MICROSTEPPING</a>&#160;&#160;&#160;0x3ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00099">99</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a8f5cb0c066109ffb18cefc0e85ee1d1b"></a><!-- doxytag: member="TMC26XStepper.cpp::MICROSTEPPING_PATTERN" ref="a8f5cb0c066109ffb18cefc0e85ee1d1b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8f5cb0c066109ffb18cefc0e85ee1d1b">MICROSTEPPING_PATTERN</a>&#160;&#160;&#160;0xFul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00049">49</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a8a261a77d198b85f6dd8416387b354b3"></a><!-- doxytag: member="TMC26XStepper.cpp::MINIMUM_CURRENT_FOURTH" ref="a8a261a77d198b85f6dd8416387b354b3" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8a261a77d198b85f6dd8416387b354b3">MINIMUM_CURRENT_FOURTH</a>&#160;&#160;&#160;0x8000ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00074">74</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a64520580cffd416668f3b91bd60f84e1"></a><!-- doxytag: member="TMC26XStepper.cpp::RANDOM_TOFF_TIME" ref="a64520580cffd416668f3b91bd60f84e1" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a64520580cffd416668f3b91bd60f84e1">RANDOM_TOFF_TIME</a>&#160;&#160;&#160;0x2000ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00062">62</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a143b7757272f07866d9655bde8303d9a"></a><!-- doxytag: member="TMC26XStepper.cpp::READ_MICROSTEP_POSTION" ref="a143b7757272f07866d9655bde8303d9a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a143b7757272f07866d9655bde8303d9a">READ_MICROSTEP_POSTION</a>&#160;&#160;&#160;0x0ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00053">53</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a88a4b45fa6385eba8aa4f0342334b832"></a><!-- doxytag: member="TMC26XStepper.cpp::READ_SELECTION_PATTERN" ref="a88a4b45fa6385eba8aa4f0342334b832" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a88a4b45fa6385eba8aa4f0342334b832">READ_SELECTION_PATTERN</a>&#160;&#160;&#160;0x30ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00056">56</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aef62b7fdcbac0b33b2d6e9cea4b5f9b2"></a><!-- doxytag: member="TMC26XStepper.cpp::READ_STALL_GUARD_AND_COOL_STEP" ref="aef62b7fdcbac0b33b2d6e9cea4b5f9b2" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aef62b7fdcbac0b33b2d6e9cea4b5f9b2">READ_STALL_GUARD_AND_COOL_STEP</a>&#160;&#160;&#160;0x20ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00055">55</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac1bd4da94fab7ce1049be2f866211819"></a><!-- doxytag: member="TMC26XStepper.cpp::READ_STALL_GUARD_READING" ref="ac1bd4da94fab7ce1049be2f866211819" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac1bd4da94fab7ce1049be2f866211819">READ_STALL_GUARD_READING</a>&#160;&#160;&#160;0x10ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00054">54</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a5c3d76da63f585e37813c32be2e11ab7"></a><!-- doxytag: member="TMC26XStepper.cpp::READOUT_VALUE_PATTERN" ref="a5c3d76da63f585e37813c32be2e11ab7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a5c3d76da63f585e37813c32be2e11ab7">READOUT_VALUE_PATTERN</a>&#160;&#160;&#160;0xFFC00ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00096">96</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a3b02ee1f518b0c90c16488f937abd443"></a><!-- doxytag: member="TMC26XStepper.cpp::REGISTER_BIT_PATTERN" ref="a3b02ee1f518b0c90c16488f937abd443" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a3b02ee1f518b0c90c16488f937abd443">REGISTER_BIT_PATTERN</a>&#160;&#160;&#160;0xFFFFFul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00046">46</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aba6c07e5672e34e618bb3a550ab0d2bc"></a><!-- doxytag: member="TMC26XStepper.cpp::SE_CURRENT_STEP_WIDTH_PATTERN" ref="aba6c07e5672e34e618bb3a550ab0d2bc" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aba6c07e5672e34e618bb3a550ab0d2bc">SE_CURRENT_STEP_WIDTH_PATTERN</a>&#160;&#160;&#160;0x60ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00077">77</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac8f748bf735c447dbed7dd4c7b631a87"></a><!-- doxytag: member="TMC26XStepper.cpp::SE_MAX_PATTERN" ref="ac8f748bf735c447dbed7dd4c7b631a87" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac8f748bf735c447dbed7dd4c7b631a87">SE_MAX_PATTERN</a>&#160;&#160;&#160;0xF00ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00076">76</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ae1862dfb958c03698b0abd95fda033ea"></a><!-- doxytag: member="TMC26XStepper.cpp::SE_MIN_PATTERN" ref="ae1862dfb958c03698b0abd95fda033ea" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae1862dfb958c03698b0abd95fda033ea">SE_MIN_PATTERN</a>&#160;&#160;&#160;0xful</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00078">78</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a478d9bde09a6528eef6af6ffeeb6caba"></a><!-- doxytag: member="TMC26XStepper.cpp::STALL_GUARD2_LOAD_MEASURE_REGISTER" ref="a478d9bde09a6528eef6af6ffeeb6caba" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a478d9bde09a6528eef6af6ffeeb6caba">STALL_GUARD2_LOAD_MEASURE_REGISTER</a>&#160;&#160;&#160;0xC0000ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00043">43</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a99ac04f0615556fc13c0c9f3e1c1b49d"></a><!-- doxytag: member="TMC26XStepper.cpp::STALL_GUARD_CONFIG_PATTERN" ref="a99ac04f0615556fc13c0c9f3e1c1b49d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a99ac04f0615556fc13c0c9f3e1c1b49d">STALL_GUARD_CONFIG_PATTERN</a>&#160;&#160;&#160;0x17F00ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00084">84</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="afdbbefabd0c29c4b6e403c4663d0f0be"></a><!-- doxytag: member="TMC26XStepper.cpp::STALL_GUARD_FILTER_ENABLED" ref="afdbbefabd0c29c4b6e403c4663d0f0be" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#afdbbefabd0c29c4b6e403c4663d0f0be">STALL_GUARD_FILTER_ENABLED</a>&#160;&#160;&#160;0x10000ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00081">81</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ae631457932894a974334892704550ecc"></a><!-- doxytag: member="TMC26XStepper.cpp::STALL_GUARD_TRESHHOLD_VALUE_PATTERN" ref="ae631457932894a974334892704550ecc" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae631457932894a974334892704550ecc">STALL_GUARD_TRESHHOLD_VALUE_PATTERN</a>&#160;&#160;&#160;0x17F00ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00082">82</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6a1cb1fd61cf7c570f94376fa11fe55b"></a><!-- doxytag: member="TMC26XStepper.cpp::STALL_GUARD_VALUE_PATTERN" ref="a6a1cb1fd61cf7c570f94376fa11fe55b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a6a1cb1fd61cf7c570f94376fa11fe55b">STALL_GUARD_VALUE_PATTERN</a>&#160;&#160;&#160;0x7F00ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00085">85</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ae9cbbe5af7188e6bff8fe412f8e42f59"></a><!-- doxytag: member="TMC26XStepper.cpp::STATUS_OPEN_LOAD_A" ref="ae9cbbe5af7188e6bff8fe412f8e42f59" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae9cbbe5af7188e6bff8fe412f8e42f59">STATUS_OPEN_LOAD_A</a>&#160;&#160;&#160;0x20ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00093">93</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab29dc5cd6c6c4e5bf99e71bd563e1be1"></a><!-- doxytag: member="TMC26XStepper.cpp::STATUS_OPEN_LOAD_B" ref="ab29dc5cd6c6c4e5bf99e71bd563e1be1" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab29dc5cd6c6c4e5bf99e71bd563e1be1">STATUS_OPEN_LOAD_B</a>&#160;&#160;&#160;0x40ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00094">94</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="adbb23d2f055c9eab55eac29d1a75deb4"></a><!-- doxytag: member="TMC26XStepper.cpp::STATUS_OVER_TEMPERATURE_SHUTDOWN" ref="adbb23d2f055c9eab55eac29d1a75deb4" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#adbb23d2f055c9eab55eac29d1a75deb4">STATUS_OVER_TEMPERATURE_SHUTDOWN</a>&#160;&#160;&#160;0x2ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00089">89</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa317fd77f2f26fdfbfd331e21d9069e8"></a><!-- doxytag: member="TMC26XStepper.cpp::STATUS_OVER_TEMPERATURE_WARNING" ref="aa317fd77f2f26fdfbfd331e21d9069e8" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa317fd77f2f26fdfbfd331e21d9069e8">STATUS_OVER_TEMPERATURE_WARNING</a>&#160;&#160;&#160;0x4ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00090">90</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a8e03041302a092174fa33b3cf837dca2"></a><!-- doxytag: member="TMC26XStepper.cpp::STATUS_SHORT_TO_GROUND_A" ref="a8e03041302a092174fa33b3cf837dca2" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8e03041302a092174fa33b3cf837dca2">STATUS_SHORT_TO_GROUND_A</a>&#160;&#160;&#160;0x8ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00091">91</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a903c3eba99695a32c6736463dcfd93ae"></a><!-- doxytag: member="TMC26XStepper.cpp::STATUS_SHORT_TO_GROUND_B" ref="a903c3eba99695a32c6736463dcfd93ae" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a903c3eba99695a32c6736463dcfd93ae">STATUS_SHORT_TO_GROUND_B</a>&#160;&#160;&#160;0x10ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00092">92</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa09ef662fd19bf2d063d6bd0f48eca14"></a><!-- doxytag: member="TMC26XStepper.cpp::STATUS_STALL_GUARD_STATUS" ref="aa09ef662fd19bf2d063d6bd0f48eca14" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa09ef662fd19bf2d063d6bd0f48eca14">STATUS_STALL_GUARD_STATUS</a>&#160;&#160;&#160;0x1ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00088">88</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab96ed1635faee6650e9cce73598a2773"></a><!-- doxytag: member="TMC26XStepper.cpp::STATUS_STAND_STILL" ref="ab96ed1635faee6650e9cce73598a2773" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab96ed1635faee6650e9cce73598a2773">STATUS_STAND_STILL</a>&#160;&#160;&#160;0x80ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00095">95</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa64245f223209654c60588e4558e0bab"></a><!-- doxytag: member="TMC26XStepper.cpp::STEP_INTERPOLATION" ref="aa64245f223209654c60588e4558e0bab" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa64245f223209654c60588e4558e0bab">STEP_INTERPOLATION</a>&#160;&#160;&#160;0x200ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00050">50</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa4e49237f2671e7f28aa34ae0e89da8d"></a><!-- doxytag: member="TMC26XStepper.cpp::T_OFF_PATTERN" ref="aa4e49237f2671e7f28aa34ae0e89da8d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa4e49237f2671e7f28aa34ae0e89da8d">T_OFF_PATTERN</a>&#160;&#160;&#160;0xful</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00061">61</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7659d842c803e47ba911a2a6e26327f3"></a><!-- doxytag: member="TMC26XStepper.cpp::T_OFF_TIMING_PATERN" ref="a7659d842c803e47ba911a2a6e26327f3" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a7659d842c803e47ba911a2a6e26327f3">T_OFF_TIMING_PATERN</a>&#160;&#160;&#160;0xFul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00071">71</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a4fb1c008e2ff76eee9362600eed112e1"></a><!-- doxytag: member="TMC26XStepper.cpp::VSENSE" ref="a4fb1c008e2ff76eee9362600eed112e1" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a4fb1c008e2ff76eee9362600eed112e1">VSENSE</a>&#160;&#160;&#160;0x40ul</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00052">52</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

@ -0,0 +1,1067 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: TMC26XStepper.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">TMC26XStepper.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="_t_m_c26_x_stepper_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> TMC26XStepper.cpp - - TMC26X Stepper library for Wiring/Arduino - Version 0.1</span>
<a name="l00003"></a>00003 <span class="comment"> </span>
<a name="l00004"></a>00004 <span class="comment"> based on the stepper library by Tom Igoe, et. al.</span>
<a name="l00005"></a>00005 <span class="comment"> </span>
<a name="l00006"></a>00006 <span class="comment"> Copyright (c) 2011, Interactive Matter, Marcus Nowotny</span>
<a name="l00007"></a>00007 <span class="comment"> </span>
<a name="l00008"></a>00008 <span class="comment"> Permission is hereby granted, free of charge, to any person obtaining a copy</span>
<a name="l00009"></a>00009 <span class="comment"> of this software and associated documentation files (the &quot;Software&quot;), to deal</span>
<a name="l00010"></a>00010 <span class="comment"> in the Software without restriction, including without limitation the rights</span>
<a name="l00011"></a>00011 <span class="comment"> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
<a name="l00012"></a>00012 <span class="comment"> copies of the Software, and to permit persons to whom the Software is</span>
<a name="l00013"></a>00013 <span class="comment"> furnished to do so, subject to the following conditions:</span>
<a name="l00014"></a>00014 <span class="comment"> </span>
<a name="l00015"></a>00015 <span class="comment"> The above copyright notice and this permission notice shall be included in</span>
<a name="l00016"></a>00016 <span class="comment"> all copies or substantial portions of the Software.</span>
<a name="l00017"></a>00017 <span class="comment"> </span>
<a name="l00018"></a>00018 <span class="comment"> THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
<a name="l00019"></a>00019 <span class="comment"> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00020"></a>00020 <span class="comment"> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00021"></a>00021 <span class="comment"> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00022"></a>00022 <span class="comment"> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
<a name="l00023"></a>00023 <span class="comment"> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</span>
<a name="l00024"></a>00024 <span class="comment"> THE SOFTWARE.</span>
<a name="l00025"></a>00025 <span class="comment"> </span>
<a name="l00026"></a>00026 <span class="comment"> */</span>
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor"> #include &lt;Arduino.h&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#else</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor"> #include &lt;WProgram.h&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#endif</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#include &lt;SPI.h&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &quot;<a class="code" href="_t_m_c26_x_stepper_8h.html">TMC26XStepper.h</a>&quot;</span>
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="comment">//some default values used in initialization</span>
<a name="l00037"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a6560b3471273e99e280ba795e3469ede">00037</a> <span class="preprocessor">#define DEFAULT_MICROSTEPPING_VALUE 32</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00039"></a>00039 <span class="comment">//TMC26X register definitions</span>
<a name="l00040"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a108f18bf4a30a0e0f0991ac0e4ce0579">00040</a> <span class="preprocessor">#define DRIVER_CONTROL_REGISTER 0x0ul</span>
<a name="l00041"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a70a540d1090b989b8600b5e4776659fe">00041</a> <span class="preprocessor"></span><span class="preprocessor">#define CHOPPER_CONFIG_REGISTER 0x80000ul</span>
<a name="l00042"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#ab9828bfaa075a0a8647c709136016317">00042</a> <span class="preprocessor"></span><span class="preprocessor">#define COOL_STEP_REGISTER 0xA0000ul</span>
<a name="l00043"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a478d9bde09a6528eef6af6ffeeb6caba">00043</a> <span class="preprocessor"></span><span class="preprocessor">#define STALL_GUARD2_LOAD_MEASURE_REGISTER 0xC0000ul</span>
<a name="l00044"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#af35f569d42ea3b1d634901a3b6a908ee">00044</a> <span class="preprocessor"></span><span class="preprocessor">#define DRIVER_CONFIG_REGISTER 0xE0000ul</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span>
<a name="l00046"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a3b02ee1f518b0c90c16488f937abd443">00046</a> <span class="preprocessor">#define REGISTER_BIT_PATTERN 0xFFFFFul</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span>
<a name="l00048"></a>00048 <span class="comment">//definitions for the driver control register</span>
<a name="l00049"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a8f5cb0c066109ffb18cefc0e85ee1d1b">00049</a> <span class="preprocessor">#define MICROSTEPPING_PATTERN 0xFul</span>
<a name="l00050"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#aa64245f223209654c60588e4558e0bab">00050</a> <span class="preprocessor"></span><span class="preprocessor">#define STEP_INTERPOLATION 0x200ul</span>
<a name="l00051"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a770601bf0153e4bc639b9c3005b15af7">00051</a> <span class="preprocessor"></span><span class="preprocessor">#define DOUBLE_EDGE_STEP 0x100ul</span>
<a name="l00052"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a4fb1c008e2ff76eee9362600eed112e1">00052</a> <span class="preprocessor"></span><span class="preprocessor">#define VSENSE 0x40ul</span>
<a name="l00053"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a143b7757272f07866d9655bde8303d9a">00053</a> <span class="preprocessor"></span><span class="preprocessor">#define READ_MICROSTEP_POSTION 0x0ul</span>
<a name="l00054"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#ac1bd4da94fab7ce1049be2f866211819">00054</a> <span class="preprocessor"></span><span class="preprocessor">#define READ_STALL_GUARD_READING 0x10ul</span>
<a name="l00055"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#aef62b7fdcbac0b33b2d6e9cea4b5f9b2">00055</a> <span class="preprocessor"></span><span class="preprocessor">#define READ_STALL_GUARD_AND_COOL_STEP 0x20ul</span>
<a name="l00056"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a88a4b45fa6385eba8aa4f0342334b832">00056</a> <span class="preprocessor"></span><span class="preprocessor">#define READ_SELECTION_PATTERN 0x30ul</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span>
<a name="l00058"></a>00058 <span class="comment">//definitions for the chopper config register</span>
<a name="l00059"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a57418a67ff726d540b813230bca1d536">00059</a> <span class="preprocessor">#define CHOPPER_MODE_STANDARD 0x0ul</span>
<a name="l00060"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#aaf1b564ced7de8ff3245c964e3775826">00060</a> <span class="preprocessor"></span><span class="preprocessor">#define CHOPPER_MODE_T_OFF_FAST_DECAY 0x4000ul</span>
<a name="l00061"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#aa4e49237f2671e7f28aa34ae0e89da8d">00061</a> <span class="preprocessor"></span><span class="preprocessor">#define T_OFF_PATTERN 0xful</span>
<a name="l00062"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a64520580cffd416668f3b91bd60f84e1">00062</a> <span class="preprocessor"></span><span class="preprocessor">#define RANDOM_TOFF_TIME 0x2000ul</span>
<a name="l00063"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a42cb2ce84258587d514ec3268548ba89">00063</a> <span class="preprocessor"></span><span class="preprocessor">#define BLANK_TIMING_PATTERN 0x18000ul</span>
<a name="l00064"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#abdac78f7f2c506972265a8e5883e1eae">00064</a> <span class="preprocessor"></span><span class="preprocessor">#define BLANK_TIMING_SHIFT 15</span>
<a name="l00065"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a424c248097b38c1e29e6a58ad48e6bd9">00065</a> <span class="preprocessor"></span><span class="preprocessor">#define HYSTERESIS_DECREMENT_PATTERN 0x1800ul</span>
<a name="l00066"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a36e554a87785ce6ba998b79aae9e74e0">00066</a> <span class="preprocessor"></span><span class="preprocessor">#define HYSTERESIS_DECREMENT_SHIFT 11</span>
<a name="l00067"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#ad9d2302f6d61cd84a612a2e2bcdeb56e">00067</a> <span class="preprocessor"></span><span class="preprocessor">#define HYSTERESIS_LOW_VALUE_PATTERN 0x780ul</span>
<a name="l00068"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a38ce0bb0fa20db28351ac9167f28db98">00068</a> <span class="preprocessor"></span><span class="preprocessor">#define HYSTERESIS_LOW_SHIFT 7</span>
<a name="l00069"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a0de4e98b412dced62c3a4452b7483af3">00069</a> <span class="preprocessor"></span><span class="preprocessor">#define HYSTERESIS_START_VALUE_PATTERN 0x78ul</span>
<a name="l00070"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#ac2c1c939256126e605396c4aaee3c804">00070</a> <span class="preprocessor"></span><span class="preprocessor">#define HYSTERESIS_START_VALUE_SHIFT 4</span>
<a name="l00071"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a7659d842c803e47ba911a2a6e26327f3">00071</a> <span class="preprocessor"></span><span class="preprocessor">#define T_OFF_TIMING_PATERN 0xFul</span>
<a name="l00072"></a>00072 <span class="preprocessor"></span>
<a name="l00073"></a>00073 <span class="comment">//definitions for cool step register</span>
<a name="l00074"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a8a261a77d198b85f6dd8416387b354b3">00074</a> <span class="preprocessor">#define MINIMUM_CURRENT_FOURTH 0x8000ul</span>
<a name="l00075"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#adbe13a0464355e42fbe786ca5f58ed8d">00075</a> <span class="preprocessor"></span><span class="preprocessor">#define CURRENT_DOWN_STEP_SPEED_PATTERN 0x6000ul</span>
<a name="l00076"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#ac8f748bf735c447dbed7dd4c7b631a87">00076</a> <span class="preprocessor"></span><span class="preprocessor">#define SE_MAX_PATTERN 0xF00ul</span>
<a name="l00077"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#aba6c07e5672e34e618bb3a550ab0d2bc">00077</a> <span class="preprocessor"></span><span class="preprocessor">#define SE_CURRENT_STEP_WIDTH_PATTERN 0x60ul</span>
<a name="l00078"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#ae1862dfb958c03698b0abd95fda033ea">00078</a> <span class="preprocessor"></span><span class="preprocessor">#define SE_MIN_PATTERN 0xful</span>
<a name="l00079"></a>00079 <span class="preprocessor"></span>
<a name="l00080"></a>00080 <span class="comment">//definitions for stall guard2 current register</span>
<a name="l00081"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#afdbbefabd0c29c4b6e403c4663d0f0be">00081</a> <span class="preprocessor">#define STALL_GUARD_FILTER_ENABLED 0x10000ul</span>
<a name="l00082"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#ae631457932894a974334892704550ecc">00082</a> <span class="preprocessor"></span><span class="preprocessor">#define STALL_GUARD_TRESHHOLD_VALUE_PATTERN 0x17F00ul</span>
<a name="l00083"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a99dcb8c6d98b0b54c23699a3f90450e4">00083</a> <span class="preprocessor"></span><span class="preprocessor">#define CURRENT_SCALING_PATTERN 0x1Ful</span>
<a name="l00084"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a99ac04f0615556fc13c0c9f3e1c1b49d">00084</a> <span class="preprocessor"></span><span class="preprocessor">#define STALL_GUARD_CONFIG_PATTERN 0x17F00ul</span>
<a name="l00085"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a6a1cb1fd61cf7c570f94376fa11fe55b">00085</a> <span class="preprocessor"></span><span class="preprocessor">#define STALL_GUARD_VALUE_PATTERN 0x7F00ul</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span>
<a name="l00087"></a>00087 <span class="comment">//definitions for the input from the TCM260</span>
<a name="l00088"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#aa09ef662fd19bf2d063d6bd0f48eca14">00088</a> <span class="preprocessor">#define STATUS_STALL_GUARD_STATUS 0x1ul</span>
<a name="l00089"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#adbb23d2f055c9eab55eac29d1a75deb4">00089</a> <span class="preprocessor"></span><span class="preprocessor">#define STATUS_OVER_TEMPERATURE_SHUTDOWN 0x2ul</span>
<a name="l00090"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#aa317fd77f2f26fdfbfd331e21d9069e8">00090</a> <span class="preprocessor"></span><span class="preprocessor">#define STATUS_OVER_TEMPERATURE_WARNING 0x4ul</span>
<a name="l00091"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a8e03041302a092174fa33b3cf837dca2">00091</a> <span class="preprocessor"></span><span class="preprocessor">#define STATUS_SHORT_TO_GROUND_A 0x8ul</span>
<a name="l00092"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a903c3eba99695a32c6736463dcfd93ae">00092</a> <span class="preprocessor"></span><span class="preprocessor">#define STATUS_SHORT_TO_GROUND_B 0x10ul</span>
<a name="l00093"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#ae9cbbe5af7188e6bff8fe412f8e42f59">00093</a> <span class="preprocessor"></span><span class="preprocessor">#define STATUS_OPEN_LOAD_A 0x20ul</span>
<a name="l00094"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#ab29dc5cd6c6c4e5bf99e71bd563e1be1">00094</a> <span class="preprocessor"></span><span class="preprocessor">#define STATUS_OPEN_LOAD_B 0x40ul</span>
<a name="l00095"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#ab96ed1635faee6650e9cce73598a2773">00095</a> <span class="preprocessor"></span><span class="preprocessor">#define STATUS_STAND_STILL 0x80ul</span>
<a name="l00096"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a5c3d76da63f585e37813c32be2e11ab7">00096</a> <span class="preprocessor"></span><span class="preprocessor">#define READOUT_VALUE_PATTERN 0xFFC00ul</span>
<a name="l00097"></a>00097 <span class="preprocessor"></span>
<a name="l00098"></a>00098 <span class="comment">//default values</span>
<a name="l00099"></a><a class="code" href="_t_m_c26_x_stepper_8cpp.html#a54a6d12e96d851361974b10614a00e45">00099</a> <span class="preprocessor">#define INITIAL_MICROSTEPPING 0x3ul //32th microstepping</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span>
<a name="l00101"></a>00101 <span class="comment">//debuging output</span>
<a name="l00102"></a>00102 <span class="comment">//#define DEBUG</span>
<a name="l00103"></a>00103
<a name="l00104"></a>00104 <span class="comment">/*</span>
<a name="l00105"></a>00105 <span class="comment"> * Constructor</span>
<a name="l00106"></a>00106 <span class="comment"> * number_of_steps - the steps per rotation</span>
<a name="l00107"></a>00107 <span class="comment"> * cs_pin - the SPI client select pin</span>
<a name="l00108"></a>00108 <span class="comment"> * dir_pin - the pin where the direction pin is connected</span>
<a name="l00109"></a>00109 <span class="comment"> * step_pin - the pin where the step pin is connected</span>
<a name="l00110"></a>00110 <span class="comment"> */</span>
<a name="l00111"></a><a class="code" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c">00111</a> <a class="code" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c" title="creates a new represenatation of a stepper motor connected to a TMC26X stepper driver">TMC26XStepper::TMC26XStepper</a>(<span class="keywordtype">int</span> number_of_steps, <span class="keywordtype">int</span> cs_pin, <span class="keywordtype">int</span> dir_pin, <span class="keywordtype">int</span> step_pin, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> current, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> resistor)
<a name="l00112"></a>00112 {
<a name="l00113"></a>00113 <span class="comment">//we are not started yet</span>
<a name="l00114"></a>00114 started=<span class="keyword">false</span>;
<a name="l00115"></a>00115 <span class="comment">//by default cool step is not enabled</span>
<a name="l00116"></a>00116 cool_step_enabled=<span class="keyword">false</span>;
<a name="l00117"></a>00117
<a name="l00118"></a>00118 <span class="comment">//save the pins for later use</span>
<a name="l00119"></a>00119 this-&gt;cs_pin=cs_pin;
<a name="l00120"></a>00120 this-&gt;dir_pin=dir_pin;
<a name="l00121"></a>00121 this-&gt;step_pin = step_pin;
<a name="l00122"></a>00122
<a name="l00123"></a>00123 <span class="comment">//store the current sense resistor value for later use</span>
<a name="l00124"></a>00124 this-&gt;resistor = resistor;
<a name="l00125"></a>00125
<a name="l00126"></a>00126 <span class="comment">//initizalize our status values</span>
<a name="l00127"></a>00127 this-&gt;steps_left = 0;
<a name="l00128"></a>00128 this-&gt;direction = 0;
<a name="l00129"></a>00129
<a name="l00130"></a>00130 <span class="comment">//initialize register values</span>
<a name="l00131"></a>00131 driver_control_register_value=<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a108f18bf4a30a0e0f0991ac0e4ce0579">DRIVER_CONTROL_REGISTER</a> | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a54a6d12e96d851361974b10614a00e45">INITIAL_MICROSTEPPING</a>;
<a name="l00132"></a>00132 chopper_config_register=<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a70a540d1090b989b8600b5e4776659fe">CHOPPER_CONFIG_REGISTER</a>;
<a name="l00133"></a>00133
<a name="l00134"></a>00134 <span class="comment">//setting the default register values</span>
<a name="l00135"></a>00135 driver_control_register_value=<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a108f18bf4a30a0e0f0991ac0e4ce0579">DRIVER_CONTROL_REGISTER</a>|<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a54a6d12e96d851361974b10614a00e45">INITIAL_MICROSTEPPING</a>;
<a name="l00136"></a>00136 microsteps = (1 &lt;&lt; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a54a6d12e96d851361974b10614a00e45">INITIAL_MICROSTEPPING</a>);
<a name="l00137"></a>00137 chopper_config_register=<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a70a540d1090b989b8600b5e4776659fe">CHOPPER_CONFIG_REGISTER</a>;
<a name="l00138"></a>00138 cool_step_register_value=<a class="code" href="_t_m_c26_x_stepper_8cpp.html#ab9828bfaa075a0a8647c709136016317">COOL_STEP_REGISTER</a>;
<a name="l00139"></a>00139 stall_guard2_current_register_value=<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a478d9bde09a6528eef6af6ffeeb6caba">STALL_GUARD2_LOAD_MEASURE_REGISTER</a>;
<a name="l00140"></a>00140 driver_configuration_register_value = <a class="code" href="_t_m_c26_x_stepper_8cpp.html#af35f569d42ea3b1d634901a3b6a908ee">DRIVER_CONFIG_REGISTER</a> | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#ac1bd4da94fab7ce1049be2f866211819">READ_STALL_GUARD_READING</a>;
<a name="l00141"></a>00141
<a name="l00142"></a>00142 <span class="comment">//set the current</span>
<a name="l00143"></a>00143 <a class="code" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2" title="set the maximum motor current in mA (1000 is 1 Amp) Keep in mind this is the maximum peak Current...">setCurrent</a>(current);
<a name="l00144"></a>00144 <span class="comment">//set to a conservative start value</span>
<a name="l00145"></a>00145 <a class="code" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649" title="Sets and configure the classical Constant Off Timer Chopper.">setConstantOffTimeChopper</a>(7, 54, 13,12,1);
<a name="l00146"></a>00146 <span class="comment">//set a nice microstepping value</span>
<a name="l00147"></a>00147 <a class="code" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps</a>(<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a6560b3471273e99e280ba795e3469ede">DEFAULT_MICROSTEPPING_VALUE</a>);
<a name="l00148"></a>00148 <span class="comment">//save the number of steps</span>
<a name="l00149"></a>00149 this-&gt;number_of_steps = number_of_steps;
<a name="l00150"></a>00150 }
<a name="l00151"></a>00151
<a name="l00152"></a>00152
<a name="l00153"></a>00153 <span class="comment">/*</span>
<a name="l00154"></a>00154 <span class="comment"> * start &amp; configure the stepper driver</span>
<a name="l00155"></a>00155 <span class="comment"> * just must be called.</span>
<a name="l00156"></a>00156 <span class="comment"> */</span>
<a name="l00157"></a><a class="code" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7">00157</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7" title="configures and starts the TMC26X stepper driver. Before you called this function the stepper driver i...">TMC26XStepper::start</a>() {
<a name="l00158"></a>00158
<a name="l00159"></a>00159 <span class="preprocessor">#ifdef DEBUG </span>
<a name="l00160"></a>00160 <span class="preprocessor"></span> Serial.println(<span class="stringliteral">&quot;TMC26X stepper library&quot;</span>);
<a name="l00161"></a>00161 Serial.print(<span class="stringliteral">&quot;CS pin: &quot;</span>);
<a name="l00162"></a>00162 Serial.println(cs_pin);
<a name="l00163"></a>00163 Serial.print(<span class="stringliteral">&quot;DIR pin: &quot;</span>);
<a name="l00164"></a>00164 Serial.println(dir_pin);
<a name="l00165"></a>00165 Serial.print(<span class="stringliteral">&quot;STEP pin: &quot;</span>);
<a name="l00166"></a>00166 Serial.println(step_pin);
<a name="l00167"></a>00167 Serial.print(<span class="stringliteral">&quot;current scaling: &quot;</span>);
<a name="l00168"></a>00168 Serial.println(current_scaling,DEC);
<a name="l00169"></a>00169 <span class="preprocessor">#endif</span>
<a name="l00170"></a>00170 <span class="preprocessor"></span> <span class="comment">//set the pins as output &amp; its initial value</span>
<a name="l00171"></a>00171 pinMode(step_pin, OUTPUT);
<a name="l00172"></a>00172 pinMode(dir_pin, OUTPUT);
<a name="l00173"></a>00173 pinMode(cs_pin, OUTPUT);
<a name="l00174"></a>00174 digitalWrite(step_pin, LOW);
<a name="l00175"></a>00175 digitalWrite(dir_pin, LOW);
<a name="l00176"></a>00176 digitalWrite(cs_pin, HIGH);
<a name="l00177"></a>00177
<a name="l00178"></a>00178 <span class="comment">//configure the SPI interface</span>
<a name="l00179"></a>00179 SPI.setBitOrder(MSBFIRST);
<a name="l00180"></a>00180 SPI.setClockDivider(SPI_CLOCK_DIV8);
<a name="l00181"></a>00181 <span class="comment">//todo this does not work reliably - find a way to foolprof set it (e.g. while communicating</span>
<a name="l00182"></a>00182 <span class="comment">//SPI.setDataMode(SPI_MODE3);</span>
<a name="l00183"></a>00183 SPI.begin();
<a name="l00184"></a>00184
<a name="l00185"></a>00185 <span class="comment">//set the initial values</span>
<a name="l00186"></a>00186 send262(driver_control_register_value);
<a name="l00187"></a>00187 send262(chopper_config_register);
<a name="l00188"></a>00188 send262(cool_step_register_value);
<a name="l00189"></a>00189 send262(stall_guard2_current_register_value);
<a name="l00190"></a>00190 send262(driver_configuration_register_value);
<a name="l00191"></a>00191
<a name="l00192"></a>00192 <span class="comment">//save that we are in running mode</span>
<a name="l00193"></a>00193 started=<span class="keyword">true</span>;
<a name="l00194"></a>00194 }
<a name="l00195"></a>00195
<a name="l00196"></a>00196 <span class="comment">/*</span>
<a name="l00197"></a>00197 <span class="comment"> Mark the driver as unstarted to be able to start it again</span>
<a name="l00198"></a>00198 <span class="comment"> */</span>
<a name="l00199"></a><a class="code" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5">00199</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5" title="resets the stepper in unconfigured mode.">TMC26XStepper::un_start</a>() {
<a name="l00200"></a>00200 started=<span class="keyword">false</span>;
<a name="l00201"></a>00201 }
<a name="l00202"></a>00202
<a name="l00203"></a>00203
<a name="l00204"></a>00204 <span class="comment">/*</span>
<a name="l00205"></a>00205 <span class="comment"> Sets the speed in revs per minute</span>
<a name="l00206"></a>00206 <span class="comment"></span>
<a name="l00207"></a>00207 <span class="comment">*/</span>
<a name="l00208"></a><a class="code" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd">00208</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd" title="Sets the rotation speed in revolutions per minute.">TMC26XStepper::setSpeed</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> whatSpeed)
<a name="l00209"></a>00209 {
<a name="l00210"></a>00210 this-&gt;speed = whatSpeed;
<a name="l00211"></a>00211 this-&gt;step_delay = (60UL * 1000UL * 1000UL) / ((<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)this-&gt;number_of_steps * (<span class="keywordtype">unsigned</span> long)whatSpeed * (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)this-&gt;microsteps);
<a name="l00212"></a>00212 <span class="preprocessor">#ifdef DEBUG</span>
<a name="l00213"></a>00213 <span class="preprocessor"></span> Serial.print(<span class="stringliteral">&quot;Step delay in micros: &quot;</span>);
<a name="l00214"></a>00214 Serial.println(this-&gt;step_delay);
<a name="l00215"></a>00215 <span class="preprocessor">#endif</span>
<a name="l00216"></a>00216 <span class="preprocessor"></span> <span class="comment">//update the next step time</span>
<a name="l00217"></a>00217 this-&gt;next_step_time = this-&gt;last_step_time+this-&gt;step_delay;
<a name="l00218"></a>00218
<a name="l00219"></a>00219 }
<a name="l00220"></a>00220
<a name="l00221"></a><a class="code" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29">00221</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29" title="reads out the currently selected speed in revolutions per minute.">TMC26XStepper::getSpeed</a>(<span class="keywordtype">void</span>) {
<a name="l00222"></a>00222 <span class="keywordflow">return</span> this-&gt;speed;
<a name="l00223"></a>00223 }
<a name="l00224"></a>00224
<a name="l00225"></a>00225 <span class="comment">/*</span>
<a name="l00226"></a>00226 <span class="comment"> Moves the motor steps_to_move steps. If the number is negative, </span>
<a name="l00227"></a>00227 <span class="comment"> the motor moves in the reverse direction.</span>
<a name="l00228"></a>00228 <span class="comment"> */</span>
<a name="l00229"></a><a class="code" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d">00229</a> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d" title="Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in ...">TMC26XStepper::step</a>(<span class="keywordtype">int</span> steps_to_move)
<a name="l00230"></a>00230 {
<a name="l00231"></a>00231 <span class="keywordflow">if</span> (this-&gt;steps_left==0) {
<a name="l00232"></a>00232 this-&gt;steps_left = abs(steps_to_move); <span class="comment">// how many steps to take</span>
<a name="l00233"></a>00233
<a name="l00234"></a>00234 <span class="comment">// determine direction based on whether steps_to_mode is + or -:</span>
<a name="l00235"></a>00235 <span class="keywordflow">if</span> (steps_to_move &gt; 0) {
<a name="l00236"></a>00236 this-&gt;direction = 1;
<a name="l00237"></a>00237 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (steps_to_move &lt; 0) {
<a name="l00238"></a>00238 this-&gt;direction = 0;
<a name="l00239"></a>00239 }
<a name="l00240"></a>00240 <span class="keywordflow">return</span> 0;
<a name="l00241"></a>00241 } <span class="keywordflow">else</span> {
<a name="l00242"></a>00242 <span class="keywordflow">return</span> -1;
<a name="l00243"></a>00243 }
<a name="l00244"></a>00244 }
<a name="l00245"></a>00245
<a name="l00246"></a><a class="code" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415">00246</a> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415" title="Central movement method, must be called as often as possible in the lopp function and is very fast...">TMC26XStepper::move</a>(<span class="keywordtype">void</span>) {
<a name="l00247"></a>00247 <span class="comment">// decrement the number of steps, moving one step each time:</span>
<a name="l00248"></a>00248 <span class="keywordflow">if</span>(this-&gt;steps_left&gt;0) {
<a name="l00249"></a>00249 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> time = micros();
<a name="l00250"></a>00250 <span class="comment">// move only if the appropriate delay has passed:</span>
<a name="l00251"></a>00251 <span class="keywordflow">if</span> (time &gt;= this-&gt;next_step_time) {
<a name="l00252"></a>00252 <span class="comment">// increment or decrement the step number,</span>
<a name="l00253"></a>00253 <span class="comment">// depending on direction:</span>
<a name="l00254"></a>00254 <span class="keywordflow">if</span> (this-&gt;direction == 1) {
<a name="l00255"></a>00255 digitalWrite(step_pin, HIGH);
<a name="l00256"></a>00256 } <span class="keywordflow">else</span> {
<a name="l00257"></a>00257 digitalWrite(dir_pin, HIGH);
<a name="l00258"></a>00258 digitalWrite(step_pin, HIGH);
<a name="l00259"></a>00259 }
<a name="l00260"></a>00260 <span class="comment">// get the timeStamp of when you stepped:</span>
<a name="l00261"></a>00261 this-&gt;last_step_time = time;
<a name="l00262"></a>00262 this-&gt;next_step_time = time+this-&gt;step_delay;
<a name="l00263"></a>00263 <span class="comment">// decrement the steps left:</span>
<a name="l00264"></a>00264 steps_left--;
<a name="l00265"></a>00265 <span class="comment">//disable the step &amp; dir pins</span>
<a name="l00266"></a>00266 digitalWrite(step_pin, LOW);
<a name="l00267"></a>00267 digitalWrite(dir_pin, LOW);
<a name="l00268"></a>00268 }
<a name="l00269"></a>00269 <span class="keywordflow">return</span> -1;
<a name="l00270"></a>00270 }
<a name="l00271"></a>00271 <span class="keywordflow">return</span> 0;
<a name="l00272"></a>00272 }
<a name="l00273"></a>00273
<a name="l00274"></a><a class="code" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e">00274</a> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">TMC26XStepper::isMoving</a>(<span class="keywordtype">void</span>) {
<a name="l00275"></a>00275 <span class="keywordflow">return</span> (this-&gt;steps_left&gt;0);
<a name="l00276"></a>00276 }
<a name="l00277"></a>00277
<a name="l00278"></a><a class="code" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7">00278</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7" title="Get the number of steps left in the current movement.">TMC26XStepper::getStepsLeft</a>(<span class="keywordtype">void</span>) {
<a name="l00279"></a>00279 <span class="keywordflow">return</span> this-&gt;steps_left;
<a name="l00280"></a>00280 }
<a name="l00281"></a>00281
<a name="l00282"></a><a class="code" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123">00282</a> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123" title="Stops the motor regardless if it moves or not.">TMC26XStepper::stop</a>(<span class="keywordtype">void</span>) {
<a name="l00283"></a>00283 <span class="comment">//note to self if the motor is currently moving</span>
<a name="l00284"></a>00284 <span class="keywordtype">char</span> state = <a class="code" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving</a>();
<a name="l00285"></a>00285 <span class="comment">//stop the motor</span>
<a name="l00286"></a>00286 this-&gt;steps_left = 0;
<a name="l00287"></a>00287 this-&gt;direction = 0;
<a name="l00288"></a>00288 <span class="comment">//return if it was moving</span>
<a name="l00289"></a>00289 <span class="keywordflow">return</span> state;
<a name="l00290"></a>00290 }
<a name="l00291"></a>00291
<a name="l00292"></a><a class="code" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2">00292</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2" title="set the maximum motor current in mA (1000 is 1 Amp) Keep in mind this is the maximum peak Current...">TMC26XStepper::setCurrent</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> current) {
<a name="l00293"></a>00293 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> current_scaling = 0;
<a name="l00294"></a>00294 <span class="comment">//calculate the current scaling from the max current setting (in mA)</span>
<a name="l00295"></a>00295 <span class="keywordtype">double</span> mASetting = (double)current;
<a name="l00296"></a>00296 <span class="keywordtype">double</span> resistor_value = (double) this-&gt;resistor;
<a name="l00297"></a>00297 <span class="comment">// remove vesense flag</span>
<a name="l00298"></a>00298 this-&gt;driver_configuration_register_value &amp;= ~(<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a4fb1c008e2ff76eee9362600eed112e1">VSENSE</a>);
<a name="l00299"></a>00299 <span class="comment">//this is derrived from I=(cs+1)/32*(Vsense/Rsense)</span>
<a name="l00300"></a>00300 <span class="comment">//leading to cs = CS = 32*R*I/V (with V = 0,31V oder 0,165V and I = 1000*current)</span>
<a name="l00301"></a>00301 <span class="comment">//with Rsense=0,15</span>
<a name="l00302"></a>00302 <span class="comment">//for vsense = 0,310V (VSENSE not set)</span>
<a name="l00303"></a>00303 <span class="comment">//or vsense = 0,165V (VSENSE set)</span>
<a name="l00304"></a>00304 current_scaling = (byte)((resistor_value*mASetting*32.0/(0.31*1000.0*1000.0))-0.5); <span class="comment">//theoretically - 1.0 for better rounding it is 0.5</span>
<a name="l00305"></a>00305
<a name="l00306"></a>00306 <span class="comment">//check if the current scalingis too low</span>
<a name="l00307"></a>00307 <span class="keywordflow">if</span> (current_scaling&lt;16) {
<a name="l00308"></a>00308 <span class="comment">//set the csense bit to get a use half the sense voltage (to support lower motor currents)</span>
<a name="l00309"></a>00309 this-&gt;driver_configuration_register_value |= <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a4fb1c008e2ff76eee9362600eed112e1">VSENSE</a>;
<a name="l00310"></a>00310 <span class="comment">//and recalculate the current setting</span>
<a name="l00311"></a>00311 current_scaling = (byte)((resistor_value*mASetting*32.0/(0.165*1000.0*1000.0))-0.5); <span class="comment">//theoretically - 1.0 for better rounding it is 0.5</span>
<a name="l00312"></a>00312 <span class="preprocessor">#ifdef DEBUG</span>
<a name="l00313"></a>00313 <span class="preprocessor"></span> Serial.print(<span class="stringliteral">&quot;CS (Vsense=1): &quot;</span>);
<a name="l00314"></a>00314 Serial.println(current_scaling);
<a name="l00315"></a>00315 } <span class="keywordflow">else</span> {
<a name="l00316"></a>00316 Serial.print(<span class="stringliteral">&quot;CS: &quot;</span>);
<a name="l00317"></a>00317 Serial.println(current_scaling);
<a name="l00318"></a>00318 <span class="preprocessor">#endif</span>
<a name="l00319"></a>00319 <span class="preprocessor"></span> }
<a name="l00320"></a>00320
<a name="l00321"></a>00321 <span class="comment">//do some sanity checks</span>
<a name="l00322"></a>00322 <span class="keywordflow">if</span> (current_scaling&gt;31) {
<a name="l00323"></a>00323 current_scaling=31;
<a name="l00324"></a>00324 }
<a name="l00325"></a>00325 <span class="comment">//delete the old value</span>
<a name="l00326"></a>00326 stall_guard2_current_register_value &amp;= ~(<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a99dcb8c6d98b0b54c23699a3f90450e4">CURRENT_SCALING_PATTERN</a>);
<a name="l00327"></a>00327 <span class="comment">//set the new current scaling</span>
<a name="l00328"></a>00328 stall_guard2_current_register_value |= current_scaling;
<a name="l00329"></a>00329 <span class="comment">//if started we directly send it to the motor</span>
<a name="l00330"></a>00330 <span class="keywordflow">if</span> (started) {
<a name="l00331"></a>00331 send262(driver_configuration_register_value);
<a name="l00332"></a>00332 send262(stall_guard2_current_register_value);
<a name="l00333"></a>00333 }
<a name="l00334"></a>00334 }
<a name="l00335"></a>00335
<a name="l00336"></a><a class="code" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f">00336</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f" title="readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()">TMC26XStepper::getCurrent</a>(<span class="keywordtype">void</span>) {
<a name="l00337"></a>00337 <span class="comment">//we calculate the current according to the datasheet to be on the safe side</span>
<a name="l00338"></a>00338 <span class="comment">//this is not the fastest but the most accurate and illustrative way</span>
<a name="l00339"></a>00339 <span class="keywordtype">double</span> result = (double)(stall_guard2_current_register_value &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a99dcb8c6d98b0b54c23699a3f90450e4">CURRENT_SCALING_PATTERN</a>);
<a name="l00340"></a>00340 <span class="keywordtype">double</span> resistor_value = (double)this-&gt;resistor;
<a name="l00341"></a>00341 <span class="keywordtype">double</span> voltage = (driver_configuration_register_value &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a4fb1c008e2ff76eee9362600eed112e1">VSENSE</a>)? 0.165:0.31;
<a name="l00342"></a>00342 result = (result+1.0)/32.0*voltage/resistor_value*1000.0*1000.0;
<a name="l00343"></a>00343 <span class="keywordflow">return</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)result;
<a name="l00344"></a>00344 }
<a name="l00345"></a>00345
<a name="l00346"></a><a class="code" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a">00346</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a" title="set the StallGuard threshold in order to get sensible StallGuard readings.">TMC26XStepper::setStallGuardThreshold</a>(<span class="keywordtype">char</span> stall_guard_threshold, <span class="keywordtype">char</span> stall_guard_filter_enabled) {
<a name="l00347"></a>00347 <span class="keywordflow">if</span> (stall_guard_threshold&lt;-64) {
<a name="l00348"></a>00348 stall_guard_threshold = -64;
<a name="l00349"></a>00349 <span class="comment">//We just have 5 bits </span>
<a name="l00350"></a>00350 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stall_guard_threshold &gt; 63) {
<a name="l00351"></a>00351 stall_guard_threshold = 63;
<a name="l00352"></a>00352 }
<a name="l00353"></a>00353 <span class="comment">//add trim down to 7 bits</span>
<a name="l00354"></a>00354 stall_guard_threshold &amp;=0x7f;
<a name="l00355"></a>00355 <span class="comment">//delete old stall guard settings</span>
<a name="l00356"></a>00356 stall_guard2_current_register_value &amp;= ~(<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a99ac04f0615556fc13c0c9f3e1c1b49d">STALL_GUARD_CONFIG_PATTERN</a>);
<a name="l00357"></a>00357 <span class="keywordflow">if</span> (stall_guard_filter_enabled) {
<a name="l00358"></a>00358 stall_guard2_current_register_value |= <a class="code" href="_t_m_c26_x_stepper_8cpp.html#afdbbefabd0c29c4b6e403c4663d0f0be">STALL_GUARD_FILTER_ENABLED</a>;
<a name="l00359"></a>00359 }
<a name="l00360"></a>00360 <span class="comment">//Set the new stall guard threshold</span>
<a name="l00361"></a>00361 stall_guard2_current_register_value |= (((<span class="keywordtype">unsigned</span> long)stall_guard_threshold &lt;&lt; 8) &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a99ac04f0615556fc13c0c9f3e1c1b49d">STALL_GUARD_CONFIG_PATTERN</a>);
<a name="l00362"></a>00362 <span class="comment">//if started we directly send it to the motor</span>
<a name="l00363"></a>00363 <span class="keywordflow">if</span> (started) {
<a name="l00364"></a>00364 send262(stall_guard2_current_register_value);
<a name="l00365"></a>00365 }
<a name="l00366"></a>00366 }
<a name="l00367"></a>00367
<a name="l00368"></a><a class="code" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def">00368</a> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def" title="reads out the StallGuard threshold">TMC26XStepper::getStallGuardThreshold</a>(<span class="keywordtype">void</span>) {
<a name="l00369"></a>00369 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> stall_guard_threshold = stall_guard2_current_register_value &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a6a1cb1fd61cf7c570f94376fa11fe55b">STALL_GUARD_VALUE_PATTERN</a>;
<a name="l00370"></a>00370 <span class="comment">//shift it down to bit 0</span>
<a name="l00371"></a>00371 stall_guard_threshold &gt;&gt;=8;
<a name="l00372"></a>00372 <span class="comment">//convert the value to an int to correctly handle the negative numbers</span>
<a name="l00373"></a>00373 <span class="keywordtype">char</span> result = stall_guard_threshold;
<a name="l00374"></a>00374 <span class="comment">//check if it is negative and fill it up with leading 1 for proper negative number representation</span>
<a name="l00375"></a>00375 <span class="keywordflow">if</span> (result &amp; _BV(6)) {
<a name="l00376"></a>00376 result |= 0xC0;
<a name="l00377"></a>00377 }
<a name="l00378"></a>00378 <span class="keywordflow">return</span> result;
<a name="l00379"></a>00379 }
<a name="l00380"></a>00380
<a name="l00381"></a><a class="code" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a">00381</a> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a" title="returns the current setting of the StallGuard filter">TMC26XStepper::getStallGuardFilter</a>(<span class="keywordtype">void</span>) {
<a name="l00382"></a>00382 <span class="keywordflow">if</span> (stall_guard2_current_register_value &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#afdbbefabd0c29c4b6e403c4663d0f0be">STALL_GUARD_FILTER_ENABLED</a>) {
<a name="l00383"></a>00383 <span class="keywordflow">return</span> -1;
<a name="l00384"></a>00384 } <span class="keywordflow">else</span> {
<a name="l00385"></a>00385 <span class="keywordflow">return</span> 0;
<a name="l00386"></a>00386 }
<a name="l00387"></a>00387 }
<a name="l00388"></a>00388 <span class="comment">/*</span>
<a name="l00389"></a>00389 <span class="comment"> * Set the number of microsteps per step.</span>
<a name="l00390"></a>00390 <span class="comment"> * 0,2,4,8,16,32,64,128,256 is supported</span>
<a name="l00391"></a>00391 <span class="comment"> * any value in between will be mapped to the next smaller value</span>
<a name="l00392"></a>00392 <span class="comment"> * 0 and 1 set the motor in full step mode</span>
<a name="l00393"></a>00393 <span class="comment"> */</span>
<a name="l00394"></a><a class="code" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0">00394</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">TMC26XStepper::setMicrosteps</a>(<span class="keywordtype">int</span> number_of_steps) {
<a name="l00395"></a>00395 <span class="keywordtype">long</span> setting_pattern;
<a name="l00396"></a>00396 <span class="comment">//poor mans log</span>
<a name="l00397"></a>00397 <span class="keywordflow">if</span> (number_of_steps&gt;=256) {
<a name="l00398"></a>00398 setting_pattern=0;
<a name="l00399"></a>00399 microsteps=256;
<a name="l00400"></a>00400 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (number_of_steps&gt;=128) {
<a name="l00401"></a>00401 setting_pattern=1;
<a name="l00402"></a>00402 microsteps=128;
<a name="l00403"></a>00403 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (number_of_steps&gt;=64) {
<a name="l00404"></a>00404 setting_pattern=2;
<a name="l00405"></a>00405 microsteps=64;
<a name="l00406"></a>00406 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (number_of_steps&gt;=32) {
<a name="l00407"></a>00407 setting_pattern=3;
<a name="l00408"></a>00408 microsteps=32;
<a name="l00409"></a>00409 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (number_of_steps&gt;=16) {
<a name="l00410"></a>00410 setting_pattern=4;
<a name="l00411"></a>00411 microsteps=16;
<a name="l00412"></a>00412 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (number_of_steps&gt;=8) {
<a name="l00413"></a>00413 setting_pattern=5;
<a name="l00414"></a>00414 microsteps=8;
<a name="l00415"></a>00415 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (number_of_steps&gt;=4) {
<a name="l00416"></a>00416 setting_pattern=6;
<a name="l00417"></a>00417 microsteps=4;
<a name="l00418"></a>00418 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (number_of_steps&gt;=2) {
<a name="l00419"></a>00419 setting_pattern=7;
<a name="l00420"></a>00420 microsteps=2;
<a name="l00421"></a>00421 <span class="comment">//1 and 0 lead to full step</span>
<a name="l00422"></a>00422 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (number_of_steps&lt;=1) {
<a name="l00423"></a>00423 setting_pattern=8;
<a name="l00424"></a>00424 microsteps=1;
<a name="l00425"></a>00425 }
<a name="l00426"></a>00426 <span class="preprocessor">#ifdef DEBUG</span>
<a name="l00427"></a>00427 <span class="preprocessor"></span> Serial.print(<span class="stringliteral">&quot;Microstepping: &quot;</span>);
<a name="l00428"></a>00428 Serial.println(microsteps);
<a name="l00429"></a>00429 <span class="preprocessor">#endif</span>
<a name="l00430"></a>00430 <span class="preprocessor"></span> <span class="comment">//delete the old value</span>
<a name="l00431"></a>00431 this-&gt;driver_control_register_value &amp;=0xFFFF0ul;
<a name="l00432"></a>00432 <span class="comment">//set the new value</span>
<a name="l00433"></a>00433 this-&gt;driver_control_register_value |=setting_pattern;
<a name="l00434"></a>00434
<a name="l00435"></a>00435 <span class="comment">//if started we directly send it to the motor</span>
<a name="l00436"></a>00436 <span class="keywordflow">if</span> (started) {
<a name="l00437"></a>00437 send262(driver_control_register_value);
<a name="l00438"></a>00438 }
<a name="l00439"></a>00439 <span class="comment">//recalculate the stepping delay by simply setting the speed again</span>
<a name="l00440"></a>00440 this-&gt;<a class="code" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd" title="Sets the rotation speed in revolutions per minute.">setSpeed</a>(this-&gt;speed);
<a name="l00441"></a>00441 }
<a name="l00442"></a>00442
<a name="l00443"></a>00443 <span class="comment">/*</span>
<a name="l00444"></a>00444 <span class="comment"> * returns the effective number of microsteps at the moment</span>
<a name="l00445"></a>00445 <span class="comment"> */</span>
<a name="l00446"></a><a class="code" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3">00446</a> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3" title="returns the effective current number of microsteps selected.">TMC26XStepper::getMicrosteps</a>(<span class="keywordtype">void</span>) {
<a name="l00447"></a>00447 <span class="keywordflow">return</span> microsteps;
<a name="l00448"></a>00448 }
<a name="l00449"></a>00449
<a name="l00450"></a>00450 <span class="comment">/*</span>
<a name="l00451"></a>00451 <span class="comment"> * constant_off_time: The off time setting controls the minimum chopper frequency. </span>
<a name="l00452"></a>00452 <span class="comment"> * For most applications an off time within the range of 5μs to 20μs will fit.</span>
<a name="l00453"></a>00453 <span class="comment"> * 2...15: off time setting</span>
<a name="l00454"></a>00454 <span class="comment"> *</span>
<a name="l00455"></a>00455 <span class="comment"> * blank_time: Selects the comparator blank time. This time needs to safely cover the switching event and the</span>
<a name="l00456"></a>00456 <span class="comment"> * duration of the ringing on the sense resistor. For</span>
<a name="l00457"></a>00457 <span class="comment"> * 0: min. setting 3: max. setting</span>
<a name="l00458"></a>00458 <span class="comment"> *</span>
<a name="l00459"></a>00459 <span class="comment"> * fast_decay_time_setting: Fast decay time setting. With CHM=1, these bits control the portion of fast decay for each chopper cycle.</span>
<a name="l00460"></a>00460 <span class="comment"> * 0: slow decay only</span>
<a name="l00461"></a>00461 <span class="comment"> * 1...15: duration of fast decay phase</span>
<a name="l00462"></a>00462 <span class="comment"> *</span>
<a name="l00463"></a>00463 <span class="comment"> * sine_wave_offset: Sine wave offset. With CHM=1, these bits control the sine wave offset. </span>
<a name="l00464"></a>00464 <span class="comment"> * A positive offset corrects for zero crossing error.</span>
<a name="l00465"></a>00465 <span class="comment"> * -3..-1: negative offset 0: no offset 1...12: positive offset</span>
<a name="l00466"></a>00466 <span class="comment"> *</span>
<a name="l00467"></a>00467 <span class="comment"> * use_current_comparator: Selects usage of the current comparator for termination of the fast decay cycle. </span>
<a name="l00468"></a>00468 <span class="comment"> * If current comparator is enabled, it terminates the fast decay cycle in case the current </span>
<a name="l00469"></a>00469 <span class="comment"> * reaches a higher negative value than the actual positive value.</span>
<a name="l00470"></a>00470 <span class="comment"> * 1: enable comparator termination of fast decay cycle</span>
<a name="l00471"></a>00471 <span class="comment"> * 0: end by time only</span>
<a name="l00472"></a>00472 <span class="comment"> */</span>
<a name="l00473"></a><a class="code" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649">00473</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649" title="Sets and configure the classical Constant Off Timer Chopper.">TMC26XStepper::setConstantOffTimeChopper</a>(<span class="keywordtype">char</span> constant_off_time, <span class="keywordtype">char</span> blank_time, <span class="keywordtype">char</span> fast_decay_time_setting, <span class="keywordtype">char</span> sine_wave_offset, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> use_current_comparator) {
<a name="l00474"></a>00474 <span class="comment">//perform some sanity checks</span>
<a name="l00475"></a>00475 <span class="keywordflow">if</span> (constant_off_time&lt;2) {
<a name="l00476"></a>00476 constant_off_time=2;
<a name="l00477"></a>00477 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (constant_off_time&gt;15) {
<a name="l00478"></a>00478 constant_off_time=15;
<a name="l00479"></a>00479 }
<a name="l00480"></a>00480 <span class="comment">//save the constant off time</span>
<a name="l00481"></a>00481 this-&gt;constant_off_time = constant_off_time;
<a name="l00482"></a>00482 <span class="keywordtype">char</span> blank_value;
<a name="l00483"></a>00483 <span class="comment">//calculate the value acc to the clock cycles</span>
<a name="l00484"></a>00484 <span class="keywordflow">if</span> (blank_time&gt;=54) {
<a name="l00485"></a>00485 blank_value=3;
<a name="l00486"></a>00486 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (blank_time&gt;=36) {
<a name="l00487"></a>00487 blank_value=2;
<a name="l00488"></a>00488 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (blank_time&gt;=24) {
<a name="l00489"></a>00489 blank_value=1;
<a name="l00490"></a>00490 } <span class="keywordflow">else</span> {
<a name="l00491"></a>00491 blank_value=0;
<a name="l00492"></a>00492 }
<a name="l00493"></a>00493 <span class="keywordflow">if</span> (fast_decay_time_setting&lt;0) {
<a name="l00494"></a>00494 fast_decay_time_setting=0;
<a name="l00495"></a>00495 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fast_decay_time_setting&gt;15) {
<a name="l00496"></a>00496 fast_decay_time_setting=15;
<a name="l00497"></a>00497 }
<a name="l00498"></a>00498 <span class="keywordflow">if</span> (sine_wave_offset &lt; -3) {
<a name="l00499"></a>00499 sine_wave_offset = -3;
<a name="l00500"></a>00500 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sine_wave_offset&gt;12) {
<a name="l00501"></a>00501 sine_wave_offset = 12;
<a name="l00502"></a>00502 }
<a name="l00503"></a>00503 <span class="comment">//shift the sine_wave_offset</span>
<a name="l00504"></a>00504 sine_wave_offset +=3;
<a name="l00505"></a>00505
<a name="l00506"></a>00506 <span class="comment">//calculate the register setting</span>
<a name="l00507"></a>00507 <span class="comment">//first of all delete all the values for this</span>
<a name="l00508"></a>00508 chopper_config_register &amp;= ~((1&lt;&lt;12) | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a42cb2ce84258587d514ec3268548ba89">BLANK_TIMING_PATTERN</a> | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a424c248097b38c1e29e6a58ad48e6bd9">HYSTERESIS_DECREMENT_PATTERN</a> | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#ad9d2302f6d61cd84a612a2e2bcdeb56e">HYSTERESIS_LOW_VALUE_PATTERN</a> | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a0de4e98b412dced62c3a4452b7483af3">HYSTERESIS_START_VALUE_PATTERN</a> | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a7659d842c803e47ba911a2a6e26327f3">T_OFF_TIMING_PATERN</a>);
<a name="l00509"></a>00509 <span class="comment">//set the constant off pattern</span>
<a name="l00510"></a>00510 chopper_config_register |= <a class="code" href="_t_m_c26_x_stepper_8cpp.html#aaf1b564ced7de8ff3245c964e3775826">CHOPPER_MODE_T_OFF_FAST_DECAY</a>;
<a name="l00511"></a>00511 <span class="comment">//set the blank timing value</span>
<a name="l00512"></a>00512 chopper_config_register |= ((<span class="keywordtype">unsigned</span> long)blank_value) &lt;&lt; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#abdac78f7f2c506972265a8e5883e1eae">BLANK_TIMING_SHIFT</a>;
<a name="l00513"></a>00513 <span class="comment">//setting the constant off time</span>
<a name="l00514"></a>00514 chopper_config_register |= constant_off_time;
<a name="l00515"></a>00515 <span class="comment">//set the fast decay time</span>
<a name="l00516"></a>00516 <span class="comment">//set msb</span>
<a name="l00517"></a>00517 chopper_config_register |= (((<span class="keywordtype">unsigned</span> long)(fast_decay_time_setting &amp; 0x8))&lt;&lt;<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a36e554a87785ce6ba998b79aae9e74e0">HYSTERESIS_DECREMENT_SHIFT</a>);
<a name="l00518"></a>00518 <span class="comment">//other bits</span>
<a name="l00519"></a>00519 chopper_config_register |= (((<span class="keywordtype">unsigned</span> long)(fast_decay_time_setting &amp; 0x7))&lt;&lt;<a class="code" href="_t_m_c26_x_stepper_8cpp.html#ac2c1c939256126e605396c4aaee3c804">HYSTERESIS_START_VALUE_SHIFT</a>);
<a name="l00520"></a>00520 <span class="comment">//set the sine wave offset</span>
<a name="l00521"></a>00521 chopper_config_register |= (<span class="keywordtype">unsigned</span> long)sine_wave_offset &lt;&lt; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a38ce0bb0fa20db28351ac9167f28db98">HYSTERESIS_LOW_SHIFT</a>;
<a name="l00522"></a>00522 <span class="comment">//using the current comparator?</span>
<a name="l00523"></a>00523 <span class="keywordflow">if</span> (!use_current_comparator) {
<a name="l00524"></a>00524 chopper_config_register |= (1&lt;&lt;12);
<a name="l00525"></a>00525 }
<a name="l00526"></a>00526 <span class="comment">//if started we directly send it to the motor</span>
<a name="l00527"></a>00527 <span class="keywordflow">if</span> (started) {
<a name="l00528"></a>00528 send262(driver_control_register_value);
<a name="l00529"></a>00529 }
<a name="l00530"></a>00530 }
<a name="l00531"></a>00531
<a name="l00532"></a>00532 <span class="comment">/*</span>
<a name="l00533"></a>00533 <span class="comment"> * constant_off_time: The off time setting controls the minimum chopper frequency. </span>
<a name="l00534"></a>00534 <span class="comment"> * For most applications an off time within the range of 5μs to 20μs will fit.</span>
<a name="l00535"></a>00535 <span class="comment"> * 2...15: off time setting</span>
<a name="l00536"></a>00536 <span class="comment"> *</span>
<a name="l00537"></a>00537 <span class="comment"> * blank_time: Selects the comparator blank time. This time needs to safely cover the switching event and the</span>
<a name="l00538"></a>00538 <span class="comment"> * duration of the ringing on the sense resistor. For</span>
<a name="l00539"></a>00539 <span class="comment"> * 0: min. setting 3: max. setting</span>
<a name="l00540"></a>00540 <span class="comment"> *</span>
<a name="l00541"></a>00541 <span class="comment"> * hysteresis_start: Hysteresis start setting. Please remark, that this value is an offset to the hysteresis end value HEND.</span>
<a name="l00542"></a>00542 <span class="comment"> * 1...8</span>
<a name="l00543"></a>00543 <span class="comment"> *</span>
<a name="l00544"></a>00544 <span class="comment"> * hysteresis_end: Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by HDEC. </span>
<a name="l00545"></a>00545 <span class="comment"> * The sum HSTRT+HEND must be &lt;16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited.</span>
<a name="l00546"></a>00546 <span class="comment"> * -3..-1: negative HEND 0: zero HEND 1...12: positive HEND</span>
<a name="l00547"></a>00547 <span class="comment"> *</span>
<a name="l00548"></a>00548 <span class="comment"> * hysteresis_decrement: Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time.</span>
<a name="l00549"></a>00549 <span class="comment"> * 0: fast decrement 3: very slow decrement</span>
<a name="l00550"></a>00550 <span class="comment"> */</span>
<a name="l00551"></a>00551
<a name="l00552"></a><a class="code" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2">00552</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2" title="Sets and configures with spread cycle chopper.">TMC26XStepper::setSpreadCycleChopper</a>(<span class="keywordtype">char</span> constant_off_time, <span class="keywordtype">char</span> blank_time, <span class="keywordtype">char</span> hysteresis_start, <span class="keywordtype">char</span> hysteresis_end, <span class="keywordtype">char</span> hysteresis_decrement) {
<a name="l00553"></a>00553 <span class="comment">//perform some sanity checks</span>
<a name="l00554"></a>00554 <span class="keywordflow">if</span> (constant_off_time&lt;2) {
<a name="l00555"></a>00555 constant_off_time=2;
<a name="l00556"></a>00556 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (constant_off_time&gt;15) {
<a name="l00557"></a>00557 constant_off_time=15;
<a name="l00558"></a>00558 }
<a name="l00559"></a>00559 <span class="comment">//save the constant off time</span>
<a name="l00560"></a>00560 this-&gt;constant_off_time = constant_off_time;
<a name="l00561"></a>00561 <span class="keywordtype">char</span> blank_value;
<a name="l00562"></a>00562 <span class="comment">//calculate the value acc to the clock cycles</span>
<a name="l00563"></a>00563 <span class="keywordflow">if</span> (blank_time&gt;=54) {
<a name="l00564"></a>00564 blank_value=3;
<a name="l00565"></a>00565 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (blank_time&gt;=36) {
<a name="l00566"></a>00566 blank_value=2;
<a name="l00567"></a>00567 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (blank_time&gt;=24) {
<a name="l00568"></a>00568 blank_value=1;
<a name="l00569"></a>00569 } <span class="keywordflow">else</span> {
<a name="l00570"></a>00570 blank_value=0;
<a name="l00571"></a>00571 }
<a name="l00572"></a>00572 <span class="keywordflow">if</span> (hysteresis_start&lt;1) {
<a name="l00573"></a>00573 hysteresis_start=1;
<a name="l00574"></a>00574 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (hysteresis_start&gt;8) {
<a name="l00575"></a>00575 hysteresis_start=8;
<a name="l00576"></a>00576 }
<a name="l00577"></a>00577 hysteresis_start--;
<a name="l00578"></a>00578
<a name="l00579"></a>00579 <span class="keywordflow">if</span> (hysteresis_end &lt; -3) {
<a name="l00580"></a>00580 hysteresis_end = -3;
<a name="l00581"></a>00581 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (hysteresis_end&gt;12) {
<a name="l00582"></a>00582 hysteresis_end = 12;
<a name="l00583"></a>00583 }
<a name="l00584"></a>00584 <span class="comment">//shift the hysteresis_end</span>
<a name="l00585"></a>00585 hysteresis_end +=3;
<a name="l00586"></a>00586
<a name="l00587"></a>00587 <span class="keywordflow">if</span> (hysteresis_decrement&lt;0) {
<a name="l00588"></a>00588 hysteresis_decrement=0;
<a name="l00589"></a>00589 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (hysteresis_decrement&gt;3) {
<a name="l00590"></a>00590 hysteresis_decrement=3;
<a name="l00591"></a>00591 }
<a name="l00592"></a>00592
<a name="l00593"></a>00593 <span class="comment">//first of all delete all the values for this</span>
<a name="l00594"></a>00594 chopper_config_register &amp;= ~(<a class="code" href="_t_m_c26_x_stepper_8cpp.html#aaf1b564ced7de8ff3245c964e3775826">CHOPPER_MODE_T_OFF_FAST_DECAY</a> | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a42cb2ce84258587d514ec3268548ba89">BLANK_TIMING_PATTERN</a> | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a424c248097b38c1e29e6a58ad48e6bd9">HYSTERESIS_DECREMENT_PATTERN</a> | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#ad9d2302f6d61cd84a612a2e2bcdeb56e">HYSTERESIS_LOW_VALUE_PATTERN</a> | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a0de4e98b412dced62c3a4452b7483af3">HYSTERESIS_START_VALUE_PATTERN</a> | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a7659d842c803e47ba911a2a6e26327f3">T_OFF_TIMING_PATERN</a>);
<a name="l00595"></a>00595
<a name="l00596"></a>00596 <span class="comment">//set the blank timing value</span>
<a name="l00597"></a>00597 chopper_config_register |= ((<span class="keywordtype">unsigned</span> long)blank_value) &lt;&lt; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#abdac78f7f2c506972265a8e5883e1eae">BLANK_TIMING_SHIFT</a>;
<a name="l00598"></a>00598 <span class="comment">//setting the constant off time</span>
<a name="l00599"></a>00599 chopper_config_register |= constant_off_time;
<a name="l00600"></a>00600 <span class="comment">//set the hysteresis_start</span>
<a name="l00601"></a>00601 chopper_config_register |= ((<span class="keywordtype">unsigned</span> long)hysteresis_start) &lt;&lt; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#ac2c1c939256126e605396c4aaee3c804">HYSTERESIS_START_VALUE_SHIFT</a>;
<a name="l00602"></a>00602 <span class="comment">//set the hysteresis end</span>
<a name="l00603"></a>00603 chopper_config_register |= ((<span class="keywordtype">unsigned</span> long)hysteresis_end) &lt;&lt; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a38ce0bb0fa20db28351ac9167f28db98">HYSTERESIS_LOW_SHIFT</a>;
<a name="l00604"></a>00604 <span class="comment">//set the hystereis decrement</span>
<a name="l00605"></a>00605 chopper_config_register |= ((<span class="keywordtype">unsigned</span> long)blank_value) &lt;&lt; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#abdac78f7f2c506972265a8e5883e1eae">BLANK_TIMING_SHIFT</a>;
<a name="l00606"></a>00606 <span class="comment">//if started we directly send it to the motor</span>
<a name="l00607"></a>00607 <span class="keywordflow">if</span> (started) {
<a name="l00608"></a>00608 send262(driver_control_register_value);
<a name="l00609"></a>00609 }
<a name="l00610"></a>00610 }
<a name="l00611"></a>00611
<a name="l00612"></a>00612 <span class="comment">/*</span>
<a name="l00613"></a>00613 <span class="comment"> * In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized. </span>
<a name="l00614"></a>00614 <span class="comment"> * The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity, thus it depends on the microstep position. </span>
<a name="l00615"></a>00615 <span class="comment"> * With some motors a slightly audible beat can occur between the chopper frequencies, especially when they are near to each other. This typically occurs at a </span>
<a name="l00616"></a>00616 <span class="comment"> * few microstep positions within each quarter wave. This effect normally is not audible when compared to mechanical noise generated by ball bearings, etc. </span>
<a name="l00617"></a>00617 <span class="comment"> * Further factors which can cause a similar effect are a poor layout of sense resistor GND connection.</span>
<a name="l00618"></a>00618 <span class="comment"> * Hint: A common factor, which can cause motor noise, is a bad PCB layout causing coupling of both sense resistor voltages </span>
<a name="l00619"></a>00619 <span class="comment"> * (please refer to sense resistor layout hint in chapter 8.1).</span>
<a name="l00620"></a>00620 <span class="comment"> * In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided. </span>
<a name="l00621"></a>00621 <span class="comment"> * It modulates the slow decay time setting when switched on by the RNDTF bit. The RNDTF feature further spreads the chopper spectrum, </span>
<a name="l00622"></a>00622 <span class="comment"> * reducing electromagnetic emission on single frequencies.</span>
<a name="l00623"></a>00623 <span class="comment"> */</span>
<a name="l00624"></a><a class="code" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a">00624</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a" title="Use random off time for noise reduction (0 for off, -1 for on).">TMC26XStepper::setRandomOffTime</a>(<span class="keywordtype">char</span> value) {
<a name="l00625"></a>00625 <span class="keywordflow">if</span> (value) {
<a name="l00626"></a>00626 chopper_config_register |= <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a64520580cffd416668f3b91bd60f84e1">RANDOM_TOFF_TIME</a>;
<a name="l00627"></a>00627 } <span class="keywordflow">else</span> {
<a name="l00628"></a>00628 chopper_config_register &amp;= ~(<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a64520580cffd416668f3b91bd60f84e1">RANDOM_TOFF_TIME</a>);
<a name="l00629"></a>00629 }
<a name="l00630"></a>00630 <span class="comment">//if started we directly send it to the motor</span>
<a name="l00631"></a>00631 <span class="keywordflow">if</span> (started) {
<a name="l00632"></a>00632 send262(driver_control_register_value);
<a name="l00633"></a>00633 }
<a name="l00634"></a>00634 }
<a name="l00635"></a>00635
<a name="l00636"></a><a class="code" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e">00636</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">TMC26XStepper::setCoolStepConfiguration</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> lower_SG_threshold, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> SG_hysteresis, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> current_decrement_step_size,
<a name="l00637"></a>00637 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> current_increment_step_size, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> lower_current_limit) {
<a name="l00638"></a>00638 <span class="comment">//sanitize the input values</span>
<a name="l00639"></a>00639 <span class="keywordflow">if</span> (lower_SG_threshold&gt;480) {
<a name="l00640"></a>00640 lower_SG_threshold = 480;
<a name="l00641"></a>00641 }
<a name="l00642"></a>00642 <span class="comment">//divide by 32</span>
<a name="l00643"></a>00643 lower_SG_threshold &gt;&gt;=5;
<a name="l00644"></a>00644 <span class="keywordflow">if</span> (SG_hysteresis&gt;480) {
<a name="l00645"></a>00645 SG_hysteresis=480;
<a name="l00646"></a>00646 }
<a name="l00647"></a>00647 <span class="comment">//divide by 32</span>
<a name="l00648"></a>00648 SG_hysteresis &gt;&gt;=5;
<a name="l00649"></a>00649 <span class="keywordflow">if</span> (current_decrement_step_size&gt;3) {
<a name="l00650"></a>00650 current_decrement_step_size=3;
<a name="l00651"></a>00651 }
<a name="l00652"></a>00652 <span class="keywordflow">if</span> (current_increment_step_size&gt;3) {
<a name="l00653"></a>00653 current_increment_step_size=3;
<a name="l00654"></a>00654 }
<a name="l00655"></a>00655 <span class="keywordflow">if</span> (lower_current_limit&gt;1) {
<a name="l00656"></a>00656 lower_current_limit=1;
<a name="l00657"></a>00657 }
<a name="l00658"></a>00658 <span class="comment">//store the lower level in order to enable/disable the cool step</span>
<a name="l00659"></a>00659 this-&gt;cool_step_lower_threshold=lower_SG_threshold;
<a name="l00660"></a>00660 <span class="comment">//if cool step is not enabled we delete the lower value to keep it disabled</span>
<a name="l00661"></a>00661 <span class="keywordflow">if</span> (!this-&gt;cool_step_enabled) {
<a name="l00662"></a>00662 lower_SG_threshold=0;
<a name="l00663"></a>00663 }
<a name="l00664"></a>00664 <span class="comment">//the good news is that we can start with a complete new cool step register value</span>
<a name="l00665"></a>00665 <span class="comment">//and simply set the values in the register</span>
<a name="l00666"></a>00666 cool_step_register_value = ((<span class="keywordtype">unsigned</span> long)lower_SG_threshold) | (((<span class="keywordtype">unsigned</span> long)SG_hysteresis)&lt;&lt;8) | (((<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)current_decrement_step_size)&lt;&lt;5)
<a name="l00667"></a>00667 | (((<span class="keywordtype">unsigned</span> long)current_increment_step_size)&lt;&lt;13) | (((<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)lower_current_limit)&lt;&lt;15)
<a name="l00668"></a>00668 <span class="comment">//and of course we have to include the signature of the register</span>
<a name="l00669"></a>00669 | <a class="code" href="_t_m_c26_x_stepper_8cpp.html#ab9828bfaa075a0a8647c709136016317">COOL_STEP_REGISTER</a>;
<a name="l00670"></a>00670 <span class="comment">//Serial.println(cool_step_register_value,HEX);</span>
<a name="l00671"></a>00671 <span class="keywordflow">if</span> (started) {
<a name="l00672"></a>00672 send262(cool_step_register_value);
<a name="l00673"></a>00673 }
<a name="l00674"></a>00674 }
<a name="l00675"></a>00675
<a name="l00676"></a><a class="code" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157">00676</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157" title="enables or disables the CoolStep smart energy operation feature. It must be configured before enablin...">TMC26XStepper::setCoolStepEnabled</a>(<span class="keywordtype">boolean</span> enabled) {
<a name="l00677"></a>00677 <span class="comment">//simply delete the lower limit to disable the cool step</span>
<a name="l00678"></a>00678 cool_step_register_value &amp;= ~<a class="code" href="_t_m_c26_x_stepper_8cpp.html#ae1862dfb958c03698b0abd95fda033ea">SE_MIN_PATTERN</a>;
<a name="l00679"></a>00679 <span class="comment">//and set it to the proper value if cool step is to be enabled</span>
<a name="l00680"></a>00680 <span class="keywordflow">if</span> (enabled) {
<a name="l00681"></a>00681 cool_step_register_value |=this-&gt;cool_step_lower_threshold;
<a name="l00682"></a>00682 }
<a name="l00683"></a>00683 <span class="comment">//and save the enabled status</span>
<a name="l00684"></a>00684 this-&gt;cool_step_enabled = enabled;
<a name="l00685"></a>00685 <span class="comment">//save the register value</span>
<a name="l00686"></a>00686 <span class="keywordflow">if</span> (started) {
<a name="l00687"></a>00687 send262(cool_step_register_value);
<a name="l00688"></a>00688 }
<a name="l00689"></a>00689 }
<a name="l00690"></a>00690
<a name="l00691"></a><a class="code" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d">00691</a> <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d" title="check if the CoolStep feature is enabled">TMC26XStepper::isCoolStepEnabled</a>(<span class="keywordtype">void</span>) {
<a name="l00692"></a>00692 <span class="keywordflow">return</span> this-&gt;cool_step_enabled;
<a name="l00693"></a>00693 }
<a name="l00694"></a>00694
<a name="l00695"></a><a class="code" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8">00695</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8" title="returns the lower StallGuard threshold for the CoolStep operation">TMC26XStepper::getCoolStepLowerSgThreshold</a>() {
<a name="l00696"></a>00696 <span class="comment">//we return our internally stored value - in order to provide the correct setting even if cool step is not enabled</span>
<a name="l00697"></a>00697 <span class="keywordflow">return</span> this-&gt;cool_step_lower_threshold&lt;&lt;5;
<a name="l00698"></a>00698 }
<a name="l00699"></a>00699
<a name="l00700"></a><a class="code" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f">00700</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f" title="returns the upper StallGuard threshold for the CoolStep operation">TMC26XStepper::getCoolStepUpperSgThreshold</a>() {
<a name="l00701"></a>00701 <span class="keywordflow">return</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>)((cool_step_register_value &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#ac8f748bf735c447dbed7dd4c7b631a87">SE_MAX_PATTERN</a>)&gt;&gt;8)&lt;&lt;5;
<a name="l00702"></a>00702 }
<a name="l00703"></a>00703
<a name="l00704"></a><a class="code" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883">00704</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883" title="returns the increment steps for the current for the CoolStep operation">TMC26XStepper::getCoolStepCurrentIncrementSize</a>() {
<a name="l00705"></a>00705 <span class="keywordflow">return</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>)((cool_step_register_value &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#adbe13a0464355e42fbe786ca5f58ed8d">CURRENT_DOWN_STEP_SPEED_PATTERN</a>)&gt;&gt;13);
<a name="l00706"></a>00706 }
<a name="l00707"></a>00707
<a name="l00708"></a><a class="code" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46">00708</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46" title="returns the number of StallGuard readings befor CoolStep adjusts the motor current.">TMC26XStepper::getCoolStepNumberOfSGReadings</a>() {
<a name="l00709"></a>00709 <span class="keywordflow">return</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>)((cool_step_register_value &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#aba6c07e5672e34e618bb3a550ab0d2bc">SE_CURRENT_STEP_WIDTH_PATTERN</a>)&gt;&gt;5);
<a name="l00710"></a>00710 }
<a name="l00711"></a>00711
<a name="l00712"></a><a class="code" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c">00712</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c" title="returns the absolut minium current for the CoolStep operation">TMC26XStepper::getCoolStepLowerCurrentLimit</a>() {
<a name="l00713"></a>00713 <span class="keywordflow">return</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>)((cool_step_register_value &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a8a261a77d198b85f6dd8416387b354b3">MINIMUM_CURRENT_FOURTH</a>)&gt;&gt;15);
<a name="l00714"></a>00714 }
<a name="l00715"></a>00715
<a name="l00716"></a><a class="code" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305">00716</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305" title="enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not.">TMC26XStepper::setEnabled</a>(<span class="keywordtype">boolean</span> enabled) {
<a name="l00717"></a>00717 <span class="comment">//delete the t_off in the chopper config to get sure</span>
<a name="l00718"></a>00718 chopper_config_register &amp;= ~(<a class="code" href="_t_m_c26_x_stepper_8cpp.html#aa4e49237f2671e7f28aa34ae0e89da8d">T_OFF_PATTERN</a>);
<a name="l00719"></a>00719 <span class="keywordflow">if</span> (enabled) {
<a name="l00720"></a>00720 <span class="comment">//and set the t_off time</span>
<a name="l00721"></a>00721 chopper_config_register |= this-&gt;constant_off_time;
<a name="l00722"></a>00722 }
<a name="l00723"></a>00723 <span class="comment">//if not enabled we don&#39;t have to do anything since we already delete t_off from the register</span>
<a name="l00724"></a>00724 <span class="keywordflow">if</span> (started) {
<a name="l00725"></a>00725 send262(chopper_config_register);
<a name="l00726"></a>00726 }
<a name="l00727"></a>00727 }
<a name="l00728"></a>00728
<a name="l00729"></a><a class="code" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6">00729</a> <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6" title="checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely...">TMC26XStepper::isEnabled</a>() {
<a name="l00730"></a>00730 <span class="keywordflow">if</span> (chopper_config_register &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#aa4e49237f2671e7f28aa34ae0e89da8d">T_OFF_PATTERN</a>) {
<a name="l00731"></a>00731 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00732"></a>00732 } <span class="keywordflow">else</span> {
<a name="l00733"></a>00733 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00734"></a>00734 }
<a name="l00735"></a>00735 }
<a name="l00736"></a>00736
<a name="l00737"></a>00737 <span class="comment">/*</span>
<a name="l00738"></a>00738 <span class="comment"> * reads a value from the TMC26X status register. The value is not obtained directly but can then </span>
<a name="l00739"></a>00739 <span class="comment"> * be read by the various status routines.</span>
<a name="l00740"></a>00740 <span class="comment"> *</span>
<a name="l00741"></a>00741 <span class="comment"> */</span>
<a name="l00742"></a><a class="code" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967">00742</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967" title="Manually read out the status register This function sends a byte to the motor driver in order to get ...">TMC26XStepper::readStatus</a>(<span class="keywordtype">char</span> read_value) {
<a name="l00743"></a>00743 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> old_driver_configuration_register_value = driver_configuration_register_value;
<a name="l00744"></a>00744 <span class="comment">//reset the readout configuration</span>
<a name="l00745"></a>00745 driver_configuration_register_value &amp;= ~(<a class="code" href="_t_m_c26_x_stepper_8cpp.html#a88a4b45fa6385eba8aa4f0342334b832">READ_SELECTION_PATTERN</a>);
<a name="l00746"></a>00746 <span class="comment">//this now equals TMC26X_READOUT_POSITION - so we just have to check the other two options</span>
<a name="l00747"></a>00747 <span class="keywordflow">if</span> (read_value == <a class="code" href="_t_m_c26_x_stepper_8h.html#ac864ff8886123039c7d2d3c617f7ef87">TMC26X_READOUT_STALLGUARD</a>) {
<a name="l00748"></a>00748 driver_configuration_register_value |= <a class="code" href="_t_m_c26_x_stepper_8cpp.html#ac1bd4da94fab7ce1049be2f866211819">READ_STALL_GUARD_READING</a>;
<a name="l00749"></a>00749 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (read_value == <a class="code" href="_t_m_c26_x_stepper_8h.html#a01760ad15e3846536526a990efe47094">TMC26X_READOUT_CURRENT</a>) {
<a name="l00750"></a>00750 driver_configuration_register_value |= <a class="code" href="_t_m_c26_x_stepper_8cpp.html#aef62b7fdcbac0b33b2d6e9cea4b5f9b2">READ_STALL_GUARD_AND_COOL_STEP</a>;
<a name="l00751"></a>00751 }
<a name="l00752"></a>00752 <span class="comment">//all other cases are ignored to prevent funny values</span>
<a name="l00753"></a>00753 <span class="comment">//check if the readout is configured for the value we are interested in</span>
<a name="l00754"></a>00754 <span class="keywordflow">if</span> (driver_configuration_register_value!=old_driver_configuration_register_value) {
<a name="l00755"></a>00755 <span class="comment">//because then we need to write the value twice - one time for configuring, second time to get the value, see below</span>
<a name="l00756"></a>00756 send262(driver_configuration_register_value);
<a name="l00757"></a>00757 }
<a name="l00758"></a>00758 <span class="comment">//write the configuration to get the last status </span>
<a name="l00759"></a>00759 send262(driver_configuration_register_value);
<a name="l00760"></a>00760 }
<a name="l00761"></a>00761
<a name="l00762"></a><a class="code" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125">00762</a> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">TMC26XStepper::getMotorPosition</a>(<span class="keywordtype">void</span>) {
<a name="l00763"></a>00763 <span class="comment">//we read it out even if we are not started yet - perhaps it is useful information for somebody</span>
<a name="l00764"></a>00764 <a class="code" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967" title="Manually read out the status register This function sends a byte to the motor driver in order to get ...">readStatus</a>(<a class="code" href="_t_m_c26_x_stepper_8h.html#aff05d4a47ef8821322ccc2a20785fbee">TMC26X_READOUT_POSITION</a>);
<a name="l00765"></a>00765 <span class="keywordflow">return</span> getReadoutValue();
<a name="l00766"></a>00766 }
<a name="l00767"></a>00767
<a name="l00768"></a>00768 <span class="comment">//reads the stall guard setting from last status</span>
<a name="l00769"></a>00769 <span class="comment">//returns -1 if stallguard information is not present</span>
<a name="l00770"></a><a class="code" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e">00770</a> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">TMC26XStepper::getCurrentStallGuardReading</a>(<span class="keywordtype">void</span>) {
<a name="l00771"></a>00771 <span class="comment">//if we don&#39;t yet started there cannot be a stall guard value</span>
<a name="l00772"></a>00772 <span class="keywordflow">if</span> (!started) {
<a name="l00773"></a>00773 <span class="keywordflow">return</span> -1;
<a name="l00774"></a>00774 }
<a name="l00775"></a>00775 <span class="comment">//not time optimal, but solution optiomal:</span>
<a name="l00776"></a>00776 <span class="comment">//first read out the stall guard value</span>
<a name="l00777"></a>00777 <a class="code" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967" title="Manually read out the status register This function sends a byte to the motor driver in order to get ...">readStatus</a>(<a class="code" href="_t_m_c26_x_stepper_8h.html#ac864ff8886123039c7d2d3c617f7ef87">TMC26X_READOUT_STALLGUARD</a>);
<a name="l00778"></a>00778 <span class="keywordflow">return</span> getReadoutValue();
<a name="l00779"></a>00779 }
<a name="l00780"></a>00780
<a name="l00781"></a><a class="code" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1">00781</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1" title="Reads the current current setting value as fraction of the maximum current Returns values between 0 a...">TMC26XStepper::getCurrentCSReading</a>(<span class="keywordtype">void</span>) {
<a name="l00782"></a>00782 <span class="comment">//if we don&#39;t yet started there cannot be a stall guard value</span>
<a name="l00783"></a>00783 <span class="keywordflow">if</span> (!started) {
<a name="l00784"></a>00784 <span class="keywordflow">return</span> 0;
<a name="l00785"></a>00785 }
<a name="l00786"></a>00786 <span class="comment">//not time optimal, but solution optiomal:</span>
<a name="l00787"></a>00787 <span class="comment">//first read out the stall guard value</span>
<a name="l00788"></a>00788 <a class="code" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967" title="Manually read out the status register This function sends a byte to the motor driver in order to get ...">readStatus</a>(<a class="code" href="_t_m_c26_x_stepper_8h.html#a01760ad15e3846536526a990efe47094">TMC26X_READOUT_CURRENT</a>);
<a name="l00789"></a>00789 <span class="keywordflow">return</span> (getReadoutValue() &amp; 0x1f);
<a name="l00790"></a>00790 }
<a name="l00791"></a>00791
<a name="l00792"></a><a class="code" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7">00792</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">TMC26XStepper::getCurrentCurrent</a>(<span class="keywordtype">void</span>) {
<a name="l00793"></a>00793 <span class="keywordtype">double</span> result = (double)<a class="code" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1" title="Reads the current current setting value as fraction of the maximum current Returns values between 0 a...">getCurrentCSReading</a>();
<a name="l00794"></a>00794 <span class="keywordtype">double</span> resistor_value = (double)this-&gt;resistor;
<a name="l00795"></a>00795 <span class="keywordtype">double</span> voltage = (driver_configuration_register_value &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a4fb1c008e2ff76eee9362600eed112e1">VSENSE</a>)? 0.165:0.31;
<a name="l00796"></a>00796 result = (result+1.0)/32.0*voltage/resistor_value*1000.0*1000.0;
<a name="l00797"></a>00797 <span class="keywordflow">return</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)result;
<a name="l00798"></a>00798 }
<a name="l00799"></a>00799
<a name="l00800"></a>00800 <span class="comment">/*</span>
<a name="l00801"></a>00801 <span class="comment"> return true if the stallguard threshold has been reached</span>
<a name="l00802"></a>00802 <span class="comment">*/</span>
<a name="l00803"></a><a class="code" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41">00803</a> <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41" title="checks if there is a StallGuard warning in the last status">TMC26XStepper::isStallGuardOverThreshold</a>(<span class="keywordtype">void</span>) {
<a name="l00804"></a>00804 <span class="keywordflow">if</span> (!this-&gt;started) {
<a name="l00805"></a>00805 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00806"></a>00806 }
<a name="l00807"></a>00807 <span class="keywordflow">return</span> (driver_status_result &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#aa09ef662fd19bf2d063d6bd0f48eca14">STATUS_STALL_GUARD_STATUS</a>);
<a name="l00808"></a>00808 }
<a name="l00809"></a>00809
<a name="l00810"></a>00810 <span class="comment">/*</span>
<a name="l00811"></a>00811 <span class="comment"> returns if there is any over temperature condition:</span>
<a name="l00812"></a>00812 <span class="comment"> OVER_TEMPERATURE_PREWARING if pre warning level has been reached</span>
<a name="l00813"></a>00813 <span class="comment"> OVER_TEMPERATURE_SHUTDOWN if the temperature is so hot that the driver is shut down</span>
<a name="l00814"></a>00814 <span class="comment"> Any of those levels are not too good.</span>
<a name="l00815"></a>00815 <span class="comment">*/</span>
<a name="l00816"></a><a class="code" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7">00816</a> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7" title="Return over temperature status of the last status readout return 0 is everything is OK...">TMC26XStepper::getOverTemperature</a>(<span class="keywordtype">void</span>) {
<a name="l00817"></a>00817 <span class="keywordflow">if</span> (!this-&gt;started) {
<a name="l00818"></a>00818 <span class="keywordflow">return</span> 0;
<a name="l00819"></a>00819 }
<a name="l00820"></a>00820 <span class="keywordflow">if</span> (driver_status_result &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#adbb23d2f055c9eab55eac29d1a75deb4">STATUS_OVER_TEMPERATURE_SHUTDOWN</a>) {
<a name="l00821"></a>00821 <span class="keywordflow">return</span> <a class="code" href="_t_m_c26_x_stepper_8h.html#adae814ce848677abd87758c7ac79a436" title="return value for TMC26XStepper.getOverTemperature() if there is a overtemperature shutdown in the TMC...">TMC26X_OVERTEMPERATURE_SHUTDOWN</a>;
<a name="l00822"></a>00822 }
<a name="l00823"></a>00823 <span class="keywordflow">if</span> (driver_status_result &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#aa317fd77f2f26fdfbfd331e21d9069e8">STATUS_OVER_TEMPERATURE_WARNING</a>) {
<a name="l00824"></a>00824 <span class="keywordflow">return</span> <a class="code" href="_t_m_c26_x_stepper_8h.html#add42eee34f674f92c19bcd5266d2445f" title="return value for TMC26XStepper.getOverTemperature() if there is a overtemperature situation in the TM...">TMC26X_OVERTEMPERATURE_PREWARING</a>;
<a name="l00825"></a>00825 }
<a name="l00826"></a>00826 <span class="keywordflow">return</span> 0;
<a name="l00827"></a>00827 }
<a name="l00828"></a>00828
<a name="l00829"></a>00829 <span class="comment">//is motor channel A shorted to ground</span>
<a name="l00830"></a><a class="code" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf">00830</a> <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf" title="Is motor channel A shorted to ground detected in the last status readout.">TMC26XStepper::isShortToGroundA</a>(<span class="keywordtype">void</span>) {
<a name="l00831"></a>00831 <span class="keywordflow">if</span> (!this-&gt;started) {
<a name="l00832"></a>00832 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00833"></a>00833 }
<a name="l00834"></a>00834 <span class="keywordflow">return</span> (driver_status_result &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a8e03041302a092174fa33b3cf837dca2">STATUS_SHORT_TO_GROUND_A</a>);
<a name="l00835"></a>00835 }
<a name="l00836"></a>00836
<a name="l00837"></a>00837 <span class="comment">//is motor channel B shorted to ground</span>
<a name="l00838"></a><a class="code" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b">00838</a> <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b" title="Is motor channel B shorted to ground detected in the last status readout.">TMC26XStepper::isShortToGroundB</a>(<span class="keywordtype">void</span>) {
<a name="l00839"></a>00839 <span class="keywordflow">if</span> (!this-&gt;started) {
<a name="l00840"></a>00840 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00841"></a>00841 }
<a name="l00842"></a>00842 <span class="keywordflow">return</span> (driver_status_result &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a903c3eba99695a32c6736463dcfd93ae">STATUS_SHORT_TO_GROUND_B</a>);
<a name="l00843"></a>00843 }
<a name="l00844"></a>00844
<a name="l00845"></a>00845 <span class="comment">//is motor channel A connected</span>
<a name="l00846"></a><a class="code" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c">00846</a> <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c" title="iIs motor channel A connected according to the last statu readout.">TMC26XStepper::isOpenLoadA</a>(<span class="keywordtype">void</span>) {
<a name="l00847"></a>00847 <span class="keywordflow">if</span> (!this-&gt;started) {
<a name="l00848"></a>00848 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00849"></a>00849 }
<a name="l00850"></a>00850 <span class="keywordflow">return</span> (driver_status_result &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#ae9cbbe5af7188e6bff8fe412f8e42f59">STATUS_OPEN_LOAD_A</a>);
<a name="l00851"></a>00851 }
<a name="l00852"></a>00852
<a name="l00853"></a>00853 <span class="comment">//is motor channel B connected</span>
<a name="l00854"></a><a class="code" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303">00854</a> <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303" title="iIs motor channel A connected according to the last statu readout.">TMC26XStepper::isOpenLoadB</a>(<span class="keywordtype">void</span>) {
<a name="l00855"></a>00855 <span class="keywordflow">if</span> (!this-&gt;started) {
<a name="l00856"></a>00856 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00857"></a>00857 }
<a name="l00858"></a>00858 <span class="keywordflow">return</span> (driver_status_result &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#ab29dc5cd6c6c4e5bf99e71bd563e1be1">STATUS_OPEN_LOAD_B</a>);
<a name="l00859"></a>00859 }
<a name="l00860"></a>00860
<a name="l00861"></a>00861 <span class="comment">//is chopper inactive since 2^20 clock cycles - defaults to ~0,08s</span>
<a name="l00862"></a><a class="code" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0">00862</a> <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0" title="Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s.">TMC26XStepper::isStandStill</a>(<span class="keywordtype">void</span>) {
<a name="l00863"></a>00863 <span class="keywordflow">if</span> (!this-&gt;started) {
<a name="l00864"></a>00864 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00865"></a>00865 }
<a name="l00866"></a>00866 <span class="keywordflow">return</span> (driver_status_result &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#ab96ed1635faee6650e9cce73598a2773">STATUS_STAND_STILL</a>);
<a name="l00867"></a>00867 }
<a name="l00868"></a>00868
<a name="l00869"></a>00869 <span class="comment">//is chopper inactive since 2^20 clock cycles - defaults to ~0,08s</span>
<a name="l00870"></a><a class="code" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7">00870</a> <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7" title="checks if there is a StallGuard warning in the last status">TMC26XStepper::isStallGuardReached</a>(<span class="keywordtype">void</span>) {
<a name="l00871"></a>00871 <span class="keywordflow">if</span> (!this-&gt;started) {
<a name="l00872"></a>00872 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00873"></a>00873 }
<a name="l00874"></a>00874 <span class="keywordflow">return</span> (driver_status_result &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#aa09ef662fd19bf2d063d6bd0f48eca14">STATUS_STALL_GUARD_STATUS</a>);
<a name="l00875"></a>00875 }
<a name="l00876"></a>00876
<a name="l00877"></a>00877 <span class="comment">//reads the stall guard setting from last status</span>
<a name="l00878"></a>00878 <span class="comment">//returns -1 if stallguard inforamtion is not present</span>
<a name="l00879"></a>00879 <span class="keywordtype">int</span> TMC26XStepper::getReadoutValue(<span class="keywordtype">void</span>) {
<a name="l00880"></a>00880 <span class="keywordflow">return</span> (<span class="keywordtype">int</span>)(driver_status_result &gt;&gt; 10);
<a name="l00881"></a>00881 }
<a name="l00882"></a>00882
<a name="l00883"></a><a class="code" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e">00883</a> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e" title="Returns the current sense resistor value in milliohm. The default value of ,15 Ohm will return 150...">TMC26XStepper::getResistor</a>() {
<a name="l00884"></a>00884 <span class="keywordflow">return</span> this-&gt;resistor;
<a name="l00885"></a>00885 }
<a name="l00886"></a>00886
<a name="l00887"></a><a class="code" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905">00887</a> <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905" title="a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference.">TMC26XStepper::isCurrentScalingHalfed</a>() {
<a name="l00888"></a>00888 <span class="keywordflow">if</span> (this-&gt;driver_configuration_register_value &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a4fb1c008e2ff76eee9362600eed112e1">VSENSE</a>) {
<a name="l00889"></a>00889 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00890"></a>00890 } <span class="keywordflow">else</span> {
<a name="l00891"></a>00891 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00892"></a>00892 }
<a name="l00893"></a>00893 }
<a name="l00894"></a>00894 <span class="comment">/*</span>
<a name="l00895"></a>00895 <span class="comment"> version() returns the version of the library:</span>
<a name="l00896"></a>00896 <span class="comment"> */</span>
<a name="l00897"></a><a class="code" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215">00897</a> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215" title="library version">TMC26XStepper::version</a>(<span class="keywordtype">void</span>)
<a name="l00898"></a>00898 {
<a name="l00899"></a>00899 <span class="keywordflow">return</span> 1;
<a name="l00900"></a>00900 }
<a name="l00901"></a>00901
<a name="l00902"></a><a class="code" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3">00902</a> <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3" title="Prints out all the information that can be found in the last status read out - it does not force a st...">TMC26XStepper::debugLastStatus</a>() {
<a name="l00903"></a>00903 <span class="preprocessor">#ifdef DEBUG </span>
<a name="l00904"></a>00904 <span class="preprocessor"></span><span class="keywordflow">if</span> (this-&gt;started) {
<a name="l00905"></a>00905 <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7" title="Return over temperature status of the last status readout return 0 is everything is OK...">getOverTemperature</a>()&amp;<a class="code" href="_t_m_c26_x_stepper_8h.html#add42eee34f674f92c19bcd5266d2445f" title="return value for TMC26XStepper.getOverTemperature() if there is a overtemperature situation in the TM...">TMC26X_OVERTEMPERATURE_PREWARING</a>) {
<a name="l00906"></a>00906 Serial.println(<span class="stringliteral">&quot;WARNING: Overtemperature Prewarning!&quot;</span>);
<a name="l00907"></a>00907 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7" title="Return over temperature status of the last status readout return 0 is everything is OK...">getOverTemperature</a>()&amp;<a class="code" href="_t_m_c26_x_stepper_8h.html#adae814ce848677abd87758c7ac79a436" title="return value for TMC26XStepper.getOverTemperature() if there is a overtemperature shutdown in the TMC...">TMC26X_OVERTEMPERATURE_SHUTDOWN</a>) {
<a name="l00908"></a>00908 Serial.println(<span class="stringliteral">&quot;ERROR: Overtemperature Shutdown!&quot;</span>);
<a name="l00909"></a>00909 }
<a name="l00910"></a>00910 <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf" title="Is motor channel A shorted to ground detected in the last status readout.">isShortToGroundA</a>()) {
<a name="l00911"></a>00911 Serial.println(<span class="stringliteral">&quot;ERROR: SHORT to ground on channel A!&quot;</span>);
<a name="l00912"></a>00912 }
<a name="l00913"></a>00913 <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b" title="Is motor channel B shorted to ground detected in the last status readout.">isShortToGroundB</a>()) {
<a name="l00914"></a>00914 Serial.println(<span class="stringliteral">&quot;ERROR: SHORT to ground on channel A!&quot;</span>);
<a name="l00915"></a>00915 }
<a name="l00916"></a>00916 <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c" title="iIs motor channel A connected according to the last statu readout.">isOpenLoadA</a>()) {
<a name="l00917"></a>00917 Serial.println(<span class="stringliteral">&quot;ERROR: Channel A seems to be unconnected!&quot;</span>);
<a name="l00918"></a>00918 }
<a name="l00919"></a>00919 <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303" title="iIs motor channel A connected according to the last statu readout.">isOpenLoadB</a>()) {
<a name="l00920"></a>00920 Serial.println(<span class="stringliteral">&quot;ERROR: Channel B seems to be unconnected!&quot;</span>);
<a name="l00921"></a>00921 }
<a name="l00922"></a>00922 <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7" title="checks if there is a StallGuard warning in the last status">isStallGuardReached</a>()) {
<a name="l00923"></a>00923 Serial.println(<span class="stringliteral">&quot;INFO: Stall Guard level reached!&quot;</span>);
<a name="l00924"></a>00924 }
<a name="l00925"></a>00925 <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0" title="Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s.">isStandStill</a>()) {
<a name="l00926"></a>00926 Serial.println(<span class="stringliteral">&quot;INFO: Motor is standing still.&quot;</span>);
<a name="l00927"></a>00927 }
<a name="l00928"></a>00928 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> readout_config = driver_configuration_register_value &amp; <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a88a4b45fa6385eba8aa4f0342334b832">READ_SELECTION_PATTERN</a>;
<a name="l00929"></a>00929 <span class="keywordtype">int</span> value = getReadoutValue();
<a name="l00930"></a>00930 <span class="keywordflow">if</span> (readout_config == <a class="code" href="_t_m_c26_x_stepper_8cpp.html#a143b7757272f07866d9655bde8303d9a">READ_MICROSTEP_POSTION</a>) {
<a name="l00931"></a>00931 Serial.print(<span class="stringliteral">&quot;Microstep postion phase A: &quot;</span>);
<a name="l00932"></a>00932 Serial.println(value);
<a name="l00933"></a>00933 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (readout_config == <a class="code" href="_t_m_c26_x_stepper_8cpp.html#ac1bd4da94fab7ce1049be2f866211819">READ_STALL_GUARD_READING</a>) {
<a name="l00934"></a>00934 Serial.print(<span class="stringliteral">&quot;Stall Guard value:&quot;</span>);
<a name="l00935"></a>00935 Serial.println(value);
<a name="l00936"></a>00936 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (readout_config == <a class="code" href="_t_m_c26_x_stepper_8cpp.html#aef62b7fdcbac0b33b2d6e9cea4b5f9b2">READ_STALL_GUARD_AND_COOL_STEP</a>) {
<a name="l00937"></a>00937 <span class="keywordtype">int</span> stallGuard = value &amp; 0xf;
<a name="l00938"></a>00938 <span class="keywordtype">int</span> current = value &amp; 0x1F0;
<a name="l00939"></a>00939 Serial.print(<span class="stringliteral">&quot;Approx Stall Guard: &quot;</span>);
<a name="l00940"></a>00940 Serial.println(stallGuard);
<a name="l00941"></a>00941 Serial.print(<span class="stringliteral">&quot;Current level&quot;</span>);
<a name="l00942"></a>00942 Serial.println(current);
<a name="l00943"></a>00943 }
<a name="l00944"></a>00944 }
<a name="l00945"></a>00945 <span class="preprocessor">#endif</span>
<a name="l00946"></a>00946 <span class="preprocessor"></span>}
<a name="l00947"></a>00947
<a name="l00948"></a>00948 <span class="comment">/*</span>
<a name="l00949"></a>00949 <span class="comment"> * send register settings to the stepper driver via SPI</span>
<a name="l00950"></a>00950 <span class="comment"> * returns the current status</span>
<a name="l00951"></a>00951 <span class="comment"> */</span>
<a name="l00952"></a>00952 <span class="keyword">inline</span> <span class="keywordtype">void</span> TMC26XStepper::send262(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> datagram) {
<a name="l00953"></a>00953 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> i_datagram;
<a name="l00954"></a>00954
<a name="l00955"></a>00955 <span class="comment">//preserver the previous spi mode</span>
<a name="l00956"></a>00956 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> oldMode = SPCR &amp; SPI_MODE_MASK;
<a name="l00957"></a>00957
<a name="l00958"></a>00958 <span class="comment">//if the mode is not correct set it to mode 3</span>
<a name="l00959"></a>00959 <span class="keywordflow">if</span> (oldMode != SPI_MODE3) {
<a name="l00960"></a>00960 SPI.setDataMode(SPI_MODE3);
<a name="l00961"></a>00961 }
<a name="l00962"></a>00962
<a name="l00963"></a>00963 <span class="comment">//select the TMC driver</span>
<a name="l00964"></a>00964 digitalWrite(cs_pin,LOW);
<a name="l00965"></a>00965
<a name="l00966"></a>00966 <span class="comment">//ensure that only valid bist are set (0-19)</span>
<a name="l00967"></a>00967 <span class="comment">//datagram &amp;=REGISTER_BIT_PATTERN;</span>
<a name="l00968"></a>00968
<a name="l00969"></a>00969 <span class="preprocessor">#ifdef DEBUG</span>
<a name="l00970"></a>00970 <span class="preprocessor"></span> Serial.print(<span class="stringliteral">&quot;Sending &quot;</span>);
<a name="l00971"></a>00971 Serial.println(datagram,HEX);
<a name="l00972"></a>00972 <span class="preprocessor">#endif</span>
<a name="l00973"></a>00973 <span class="preprocessor"></span>
<a name="l00974"></a>00974 <span class="comment">//write/read the values</span>
<a name="l00975"></a>00975 i_datagram = SPI.transfer((datagram &gt;&gt; 16) &amp; 0xff);
<a name="l00976"></a>00976 i_datagram &lt;&lt;= 8;
<a name="l00977"></a>00977 i_datagram |= SPI.transfer((datagram &gt;&gt; 8) &amp; 0xff);
<a name="l00978"></a>00978 i_datagram &lt;&lt;= 8;
<a name="l00979"></a>00979 i_datagram |= SPI.transfer((datagram) &amp; 0xff);
<a name="l00980"></a>00980 i_datagram &gt;&gt;= 4;
<a name="l00981"></a>00981
<a name="l00982"></a>00982 <span class="preprocessor">#ifdef DEBUG</span>
<a name="l00983"></a>00983 <span class="preprocessor"></span> Serial.print(<span class="stringliteral">&quot;Received &quot;</span>);
<a name="l00984"></a>00984 Serial.println(i_datagram,HEX);
<a name="l00985"></a>00985 <a class="code" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3" title="Prints out all the information that can be found in the last status read out - it does not force a st...">debugLastStatus</a>();
<a name="l00986"></a>00986 <span class="preprocessor">#endif</span>
<a name="l00987"></a>00987 <span class="preprocessor"></span> <span class="comment">//deselect the TMC chip</span>
<a name="l00988"></a>00988 digitalWrite(cs_pin,HIGH);
<a name="l00989"></a>00989
<a name="l00990"></a>00990 <span class="comment">//restore the previous SPI mode if neccessary</span>
<a name="l00991"></a>00991 <span class="comment">//if the mode is not correct set it to mode 3</span>
<a name="l00992"></a>00992 <span class="keywordflow">if</span> (oldMode != SPI_MODE3) {
<a name="l00993"></a>00993 SPI.setDataMode(oldMode);
<a name="l00994"></a>00994 }
<a name="l00995"></a>00995
<a name="l00996"></a>00996
<a name="l00997"></a>00997 <span class="comment">//store the datagram as status result</span>
<a name="l00998"></a>00998 driver_status_result = i_datagram;
<a name="l00999"></a>00999 }
</pre></div></div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

@ -0,0 +1,212 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: TMC26XStepper.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<div class="title">TMC26XStepper.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a href="_t_m_c26_x_stepper_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Class representing a TMC26X stepper driver. <a href="class_t_m_c26_x_stepper.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8h.html#add42eee34f674f92c19bcd5266d2445f">TMC26X_OVERTEMPERATURE_PREWARING</a>&#160;&#160;&#160;1</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">return value for <a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7" title="Return over temperature status of the last status readout return 0 is everything is OK...">TMC26XStepper.getOverTemperature()</a> if there is a overtemperature situation in the TMC chip <a href="#add42eee34f674f92c19bcd5266d2445f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8h.html#adae814ce848677abd87758c7ac79a436">TMC26X_OVERTEMPERATURE_SHUTDOWN</a>&#160;&#160;&#160;2</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">return value for <a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7" title="Return over temperature status of the last status readout return 0 is everything is OK...">TMC26XStepper.getOverTemperature()</a> if there is a overtemperature shutdown in the TMC chip <a href="#adae814ce848677abd87758c7ac79a436"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8h.html#aff05d4a47ef8821322ccc2a20785fbee">TMC26X_READOUT_POSITION</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8h.html#ac864ff8886123039c7d2d3c617f7ef87">TMC26X_READOUT_STALLGUARD</a>&#160;&#160;&#160;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8h.html#a01760ad15e3846536526a990efe47094">TMC26X_READOUT_CURRENT</a>&#160;&#160;&#160;3</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8h.html#a28b1774bd4aa854fb5e4b6dc7db96ecb">COOL_STEP_HALF_CS_LIMIT</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_t_m_c26_x_stepper_8h.html#a1a4db5eafd0a9247677153cb4c8b7d54">COOL_STEP_QUARTDER_CS_LIMIT</a>&#160;&#160;&#160;1</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a28b1774bd4aa854fb5e4b6dc7db96ecb"></a><!-- doxytag: member="TMC26XStepper.h::COOL_STEP_HALF_CS_LIMIT" ref="a28b1774bd4aa854fb5e4b6dc7db96ecb" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8h.html#a28b1774bd4aa854fb5e4b6dc7db96ecb">COOL_STEP_HALF_CS_LIMIT</a>&#160;&#160;&#160;0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Define to set the minimum current for CoolStep operation to 1/2 of the selected CS minium. </p>
<dl class="see"><dt><b>See also:</b></dt><dd>setCoolStepConfiguration() </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8h_source.html#l00070">70</a> of file <a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1a4db5eafd0a9247677153cb4c8b7d54"></a><!-- doxytag: member="TMC26XStepper.h::COOL_STEP_QUARTDER_CS_LIMIT" ref="a1a4db5eafd0a9247677153cb4c8b7d54" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8h.html#a1a4db5eafd0a9247677153cb4c8b7d54">COOL_STEP_QUARTDER_CS_LIMIT</a>&#160;&#160;&#160;1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Define to set the minimum current for CoolStep operation to 1/4 of the selected CS minium. </p>
<dl class="see"><dt><b>See also:</b></dt><dd>setCoolStepConfiguration() </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8h_source.html#l00075">75</a> of file <a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>.</p>
</div>
</div>
<a class="anchor" id="add42eee34f674f92c19bcd5266d2445f"></a><!-- doxytag: member="TMC26XStepper.h::TMC26X_OVERTEMPERATURE_PREWARING" ref="add42eee34f674f92c19bcd5266d2445f" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8h.html#add42eee34f674f92c19bcd5266d2445f">TMC26X_OVERTEMPERATURE_PREWARING</a>&#160;&#160;&#160;1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>return value for <a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7" title="Return over temperature status of the last status readout return 0 is everything is OK...">TMC26XStepper.getOverTemperature()</a> if there is a overtemperature situation in the TMC chip </p>
<p>This warning indicates that the TCM chip is too warm. It is still working but some parameters may be inferior. You should do something against it. </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8h_source.html#l00039">39</a> of file <a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>.</p>
</div>
</div>
<a class="anchor" id="adae814ce848677abd87758c7ac79a436"></a><!-- doxytag: member="TMC26XStepper.h::TMC26X_OVERTEMPERATURE_SHUTDOWN" ref="adae814ce848677abd87758c7ac79a436" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8h.html#adae814ce848677abd87758c7ac79a436">TMC26X_OVERTEMPERATURE_SHUTDOWN</a>&#160;&#160;&#160;2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>return value for <a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7" title="Return over temperature status of the last status readout return 0 is everything is OK...">TMC26XStepper.getOverTemperature()</a> if there is a overtemperature shutdown in the TMC chip </p>
<p>This warning indicates that the TCM chip is too warm to operate and has shut down to prevent damage. It will stop working until it cools down again. If you encouter this situation you must do something against it. Like reducing the current or improving the PCB layout and/or heat management. </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8h_source.html#l00047">47</a> of file <a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>.</p>
</div>
</div>
<a class="anchor" id="a01760ad15e3846536526a990efe47094"></a><!-- doxytag: member="TMC26XStepper.h::TMC26X_READOUT_CURRENT" ref="a01760ad15e3846536526a990efe47094" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8h.html#a01760ad15e3846536526a990efe47094">TMC26X_READOUT_CURRENT</a>&#160;&#160;&#160;3</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Selects to read out the current current setting (acc. to CoolStep) and the upper bits of the StallGuard value from the motor. </p>
<dl class="see"><dt><b>See also:</b></dt><dd>readStatus(), setCurrent() </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8h_source.html#l00064">64</a> of file <a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>.</p>
</div>
</div>
<a class="anchor" id="aff05d4a47ef8821322ccc2a20785fbee"></a><!-- doxytag: member="TMC26XStepper.h::TMC26X_READOUT_POSITION" ref="aff05d4a47ef8821322ccc2a20785fbee" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8h.html#aff05d4a47ef8821322ccc2a20785fbee">TMC26X_READOUT_POSITION</a>&#160;&#160;&#160;0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Selects to readout the microstep position from the motor. </p>
<dl class="see"><dt><b>See also:</b></dt><dd>readStatus() </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8h_source.html#l00054">54</a> of file <a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac864ff8886123039c7d2d3c617f7ef87"></a><!-- doxytag: member="TMC26XStepper.h::TMC26X_READOUT_STALLGUARD" ref="ac864ff8886123039c7d2d3c617f7ef87" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="_t_m_c26_x_stepper_8h.html#ac864ff8886123039c7d2d3c617f7ef87">TMC26X_READOUT_STALLGUARD</a>&#160;&#160;&#160;1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Selects to read out the StallGuard value of the motor. </p>
<dl class="see"><dt><b>See also:</b></dt><dd>readStatus() </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8h_source.html#l00059">59</a> of file <a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

@ -0,0 +1,256 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: TMC26XStepper.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">TMC26XStepper.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="_t_m_c26_x_stepper_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> TMC26XStepper.cpp - - TMC26X Stepper library for Wiring/Arduino - Version 0.1</span>
<a name="l00003"></a>00003 <span class="comment"> </span>
<a name="l00004"></a>00004 <span class="comment"> based on the stepper library by Tom Igoe, et. al.</span>
<a name="l00005"></a>00005 <span class="comment"></span>
<a name="l00006"></a>00006 <span class="comment"> Copyright (c) 2011, Interactive Matter, Marcus Nowotny</span>
<a name="l00007"></a>00007 <span class="comment"> </span>
<a name="l00008"></a>00008 <span class="comment"> Permission is hereby granted, free of charge, to any person obtaining a copy</span>
<a name="l00009"></a>00009 <span class="comment"> of this software and associated documentation files (the &quot;Software&quot;), to deal</span>
<a name="l00010"></a>00010 <span class="comment"> in the Software without restriction, including without limitation the rights</span>
<a name="l00011"></a>00011 <span class="comment"> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
<a name="l00012"></a>00012 <span class="comment"> copies of the Software, and to permit persons to whom the Software is</span>
<a name="l00013"></a>00013 <span class="comment"> furnished to do so, subject to the following conditions:</span>
<a name="l00014"></a>00014 <span class="comment"> </span>
<a name="l00015"></a>00015 <span class="comment"> The above copyright notice and this permission notice shall be included in</span>
<a name="l00016"></a>00016 <span class="comment"> all copies or substantial portions of the Software.</span>
<a name="l00017"></a>00017 <span class="comment"> </span>
<a name="l00018"></a>00018 <span class="comment"> THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
<a name="l00019"></a>00019 <span class="comment"> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00020"></a>00020 <span class="comment"> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00021"></a>00021 <span class="comment"> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00022"></a>00022 <span class="comment"> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
<a name="l00023"></a>00023 <span class="comment"> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</span>
<a name="l00024"></a>00024 <span class="comment"> THE SOFTWARE.</span>
<a name="l00025"></a>00025 <span class="comment"></span>
<a name="l00026"></a>00026 <span class="comment"> */</span>
<a name="l00027"></a>00027
<a name="l00028"></a>00028
<a name="l00029"></a>00029 <span class="comment">// ensure this library description is only included once</span>
<a name="l00030"></a>00030 <span class="preprocessor">#ifndef TMC26XStepper_h</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define TMC26XStepper_h</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00034"></a>00034
<a name="l00039"></a><a class="code" href="_t_m_c26_x_stepper_8h.html#add42eee34f674f92c19bcd5266d2445f">00039</a> <span class="preprocessor">#define TMC26X_OVERTEMPERATURE_PREWARING 1</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041
<a name="l00047"></a><a class="code" href="_t_m_c26_x_stepper_8h.html#adae814ce848677abd87758c7ac79a436">00047</a> <span class="preprocessor">#define TMC26X_OVERTEMPERATURE_SHUTDOWN 2</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span>
<a name="l00049"></a>00049 <span class="comment">//which values can be read out</span>
<a name="l00054"></a><a class="code" href="_t_m_c26_x_stepper_8h.html#aff05d4a47ef8821322ccc2a20785fbee">00054</a> <span class="comment"></span><span class="preprocessor">#define TMC26X_READOUT_POSITION 0</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span>
<a name="l00059"></a><a class="code" href="_t_m_c26_x_stepper_8h.html#ac864ff8886123039c7d2d3c617f7ef87">00059</a> <span class="preprocessor">#define TMC26X_READOUT_STALLGUARD 1</span>
<a name="l00060"></a>00060 <span class="preprocessor"></span>
<a name="l00064"></a><a class="code" href="_t_m_c26_x_stepper_8h.html#a01760ad15e3846536526a990efe47094">00064</a> <span class="preprocessor">#define TMC26X_READOUT_CURRENT 3</span>
<a name="l00065"></a>00065 <span class="preprocessor"></span>
<a name="l00070"></a><a class="code" href="_t_m_c26_x_stepper_8h.html#a28b1774bd4aa854fb5e4b6dc7db96ecb">00070</a> <span class="preprocessor">#define COOL_STEP_HALF_CS_LIMIT 0</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span>
<a name="l00075"></a><a class="code" href="_t_m_c26_x_stepper_8h.html#a1a4db5eafd0a9247677153cb4c8b7d54">00075</a> <span class="preprocessor">#define COOL_STEP_QUARTDER_CS_LIMIT 1</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span>
<a name="l00101"></a><a class="code" href="class_t_m_c26_x_stepper.html">00101</a> <span class="keyword">class </span><a class="code" href="class_t_m_c26_x_stepper.html" title="Class representing a TMC26X stepper driver.">TMC26XStepper</a> {
<a name="l00102"></a>00102 <span class="keyword">public</span>:
<a name="l00124"></a>00124 <a class="code" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c" title="creates a new represenatation of a stepper motor connected to a TMC26X stepper driver">TMC26XStepper</a>(<span class="keywordtype">int</span> number_of_steps, <span class="keywordtype">int</span> cs_pin, <span class="keywordtype">int</span> dir_pin, <span class="keywordtype">int</span> step_pin, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> current, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> resistor=150);
<a name="l00125"></a>00125
<a name="l00133"></a>00133 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7" title="configures and starts the TMC26X stepper driver. Before you called this function the stepper driver i...">start</a>();
<a name="l00134"></a>00134
<a name="l00145"></a>00145 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5" title="resets the stepper in unconfigured mode.">un_start</a>();
<a name="l00146"></a>00146
<a name="l00147"></a>00147
<a name="l00152"></a>00152 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd" title="Sets the rotation speed in revolutions per minute.">setSpeed</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> whatSpeed);
<a name="l00153"></a>00153
<a name="l00158"></a>00158 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29" title="reads out the currently selected speed in revolutions per minute.">getSpeed</a>(<span class="keywordtype">void</span>);
<a name="l00159"></a>00159
<a name="l00168"></a>00168 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps</a>(<span class="keywordtype">int</span> number_of_steps);
<a name="l00169"></a>00169
<a name="l00178"></a>00178 <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3" title="returns the effective current number of microsteps selected.">getMicrosteps</a>(<span class="keywordtype">void</span>);
<a name="l00179"></a>00179
<a name="l00195"></a>00195 <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d" title="Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in ...">step</a>(<span class="keywordtype">int</span> number_of_steps);
<a name="l00196"></a>00196
<a name="l00215"></a>00215 <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415" title="Central movement method, must be called as often as possible in the lopp function and is very fast...">move</a>(<span class="keywordtype">void</span>);
<a name="l00216"></a>00216
<a name="l00224"></a>00224 <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving</a>(<span class="keywordtype">void</span>);
<a name="l00225"></a>00225
<a name="l00230"></a>00230 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7" title="Get the number of steps left in the current movement.">getStepsLeft</a>(<span class="keywordtype">void</span>);
<a name="l00231"></a>00231
<a name="l00238"></a>00238 <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123" title="Stops the motor regardless if it moves or not.">stop</a>(<span class="keywordtype">void</span>);
<a name="l00239"></a>00239
<a name="l00264"></a>00264 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649" title="Sets and configure the classical Constant Off Timer Chopper.">setConstantOffTimeChopper</a>(<span class="keywordtype">char</span> constant_off_time, <span class="keywordtype">char</span> blank_time, <span class="keywordtype">char</span> fast_decay_time_setting, <span class="keywordtype">char</span> sine_wave_offset, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> use_current_comparator);
<a name="l00265"></a>00265
<a name="l00286"></a>00286 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2" title="Sets and configures with spread cycle chopper.">setSpreadCycleChopper</a>(<span class="keywordtype">char</span> constant_off_time, <span class="keywordtype">char</span> blank_time, <span class="keywordtype">char</span> hysteresis_start, <span class="keywordtype">char</span> hysteresis_end, <span class="keywordtype">char</span> hysteresis_decrement);
<a name="l00287"></a>00287
<a name="l00303"></a>00303 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a" title="Use random off time for noise reduction (0 for off, -1 for on).">setRandomOffTime</a>(<span class="keywordtype">char</span> value);
<a name="l00304"></a>00304
<a name="l00312"></a>00312 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2" title="set the maximum motor current in mA (1000 is 1 Amp) Keep in mind this is the maximum peak Current...">setCurrent</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> current);
<a name="l00313"></a>00313
<a name="l00320"></a>00320 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f" title="readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()">getCurrent</a>(<span class="keywordtype">void</span>);
<a name="l00321"></a>00321
<a name="l00337"></a>00337 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a" title="set the StallGuard threshold in order to get sensible StallGuard readings.">setStallGuardThreshold</a>(<span class="keywordtype">char</span> stall_guard_threshold, <span class="keywordtype">char</span> stall_guard_filter_enabled);
<a name="l00338"></a>00338
<a name="l00343"></a>00343 <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def" title="reads out the StallGuard threshold">getStallGuardThreshold</a>(<span class="keywordtype">void</span>);
<a name="l00344"></a>00344
<a name="l00349"></a>00349 <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a" title="returns the current setting of the StallGuard filter">getStallGuardFilter</a>(<span class="keywordtype">void</span>);
<a name="l00350"></a>00350
<a name="l00368"></a>00368 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> lower_SG_threshold, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> SG_hysteresis, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> current_decrement_step_size,
<a name="l00369"></a>00369 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> current_increment_step_size, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> lower_current_limit);
<a name="l00370"></a>00370
<a name="l00376"></a>00376 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157" title="enables or disables the CoolStep smart energy operation feature. It must be configured before enablin...">setCoolStepEnabled</a>(<span class="keywordtype">boolean</span> enabled);
<a name="l00377"></a>00377
<a name="l00378"></a>00378
<a name="l00383"></a>00383 <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d" title="check if the CoolStep feature is enabled">isCoolStepEnabled</a>();
<a name="l00384"></a>00384
<a name="l00389"></a>00389 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8" title="returns the lower StallGuard threshold for the CoolStep operation">getCoolStepLowerSgThreshold</a>();
<a name="l00390"></a>00390
<a name="l00395"></a>00395 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f" title="returns the upper StallGuard threshold for the CoolStep operation">getCoolStepUpperSgThreshold</a>();
<a name="l00396"></a>00396
<a name="l00401"></a>00401 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46" title="returns the number of StallGuard readings befor CoolStep adjusts the motor current.">getCoolStepNumberOfSGReadings</a>();
<a name="l00402"></a>00402
<a name="l00407"></a>00407 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883" title="returns the increment steps for the current for the CoolStep operation">getCoolStepCurrentIncrementSize</a>();
<a name="l00408"></a>00408
<a name="l00414"></a>00414 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c" title="returns the absolut minium current for the CoolStep operation">getCoolStepLowerCurrentLimit</a>();
<a name="l00415"></a>00415
<a name="l00422"></a>00422 <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition</a>(<span class="keywordtype">void</span>);
<a name="l00423"></a>00423
<a name="l00430"></a>00430 <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading</a>(<span class="keywordtype">void</span>);
<a name="l00431"></a>00431
<a name="l00437"></a>00437 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1" title="Reads the current current setting value as fraction of the maximum current Returns values between 0 a...">getCurrentCSReading</a>(<span class="keywordtype">void</span>);
<a name="l00438"></a>00438
<a name="l00439"></a>00439
<a name="l00444"></a>00444 <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905" title="a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference.">isCurrentScalingHalfed</a>();
<a name="l00445"></a>00445
<a name="l00453"></a>00453 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent</a>(<span class="keywordtype">void</span>);
<a name="l00454"></a>00454
<a name="l00463"></a>00463 <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41" title="checks if there is a StallGuard warning in the last status">isStallGuardOverThreshold</a>(<span class="keywordtype">void</span>);
<a name="l00464"></a>00464
<a name="l00471"></a>00471 <span class="keywordtype">char</span> <a class="code" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7" title="Return over temperature status of the last status readout return 0 is everything is OK...">getOverTemperature</a>(<span class="keywordtype">void</span>);
<a name="l00472"></a>00472
<a name="l00480"></a>00480 <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf" title="Is motor channel A shorted to ground detected in the last status readout.">isShortToGroundA</a>(<span class="keywordtype">void</span>);
<a name="l00481"></a>00481
<a name="l00488"></a>00488 <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b" title="Is motor channel B shorted to ground detected in the last status readout.">isShortToGroundB</a>(<span class="keywordtype">void</span>);
<a name="l00495"></a>00495 <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c" title="iIs motor channel A connected according to the last statu readout.">isOpenLoadA</a>(<span class="keywordtype">void</span>);
<a name="l00496"></a>00496
<a name="l00503"></a>00503 <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303" title="iIs motor channel A connected according to the last statu readout.">isOpenLoadB</a>(<span class="keywordtype">void</span>);
<a name="l00504"></a>00504
<a name="l00511"></a>00511 <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0" title="Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s.">isStandStill</a>(<span class="keywordtype">void</span>);
<a name="l00512"></a>00512
<a name="l00524"></a>00524 <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7" title="checks if there is a StallGuard warning in the last status">isStallGuardReached</a>(<span class="keywordtype">void</span>);
<a name="l00525"></a>00525
<a name="l00530"></a>00530 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305" title="enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not.">setEnabled</a>(<span class="keywordtype">boolean</span> enabled);
<a name="l00531"></a>00531
<a name="l00537"></a>00537 <span class="keywordtype">boolean</span> <a class="code" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6" title="checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely...">isEnabled</a>();
<a name="l00538"></a>00538
<a name="l00548"></a>00548 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967" title="Manually read out the status register This function sends a byte to the motor driver in order to get ...">readStatus</a>(<span class="keywordtype">char</span> read_value);
<a name="l00549"></a>00549
<a name="l00554"></a>00554 <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e" title="Returns the current sense resistor value in milliohm. The default value of ,15 Ohm will return 150...">getResistor</a>();
<a name="l00555"></a>00555
<a name="l00560"></a>00560 <span class="keywordtype">void</span> <a class="code" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3" title="Prints out all the information that can be found in the last status read out - it does not force a st...">debugLastStatus</a>(<span class="keywordtype">void</span>);
<a name="l00565"></a>00565 <span class="keywordtype">int</span> <a class="code" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215" title="library version">version</a>(<span class="keywordtype">void</span>);
<a name="l00566"></a>00566
<a name="l00567"></a>00567 <span class="keyword">private</span>:
<a name="l00568"></a>00568 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> steps_left; <span class="comment">//the steps the motor has to do to complete the movement</span>
<a name="l00569"></a>00569 <span class="keywordtype">int</span> direction; <span class="comment">// Direction of rotation</span>
<a name="l00570"></a>00570 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> step_delay; <span class="comment">// delay between steps, in ms, based on speed</span>
<a name="l00571"></a>00571 <span class="keywordtype">int</span> number_of_steps; <span class="comment">// total number of steps this motor can take</span>
<a name="l00572"></a>00572 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> speed; <span class="comment">// we need to store the current speed in order to change the speed after changing microstepping</span>
<a name="l00573"></a>00573 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> resistor; <span class="comment">//current sense resitor value in milliohm</span>
<a name="l00574"></a>00574
<a name="l00575"></a>00575 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> last_step_time; <span class="comment">// time stamp in ms of when the last step was taken</span>
<a name="l00576"></a>00576 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> next_step_time; <span class="comment">// time stamp in ms of when the last step was taken</span>
<a name="l00577"></a>00577
<a name="l00578"></a>00578 <span class="comment">//driver control register copies to easily set &amp; modify the registers</span>
<a name="l00579"></a>00579 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> driver_control_register_value;
<a name="l00580"></a>00580 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> chopper_config_register;
<a name="l00581"></a>00581 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> cool_step_register_value;
<a name="l00582"></a>00582 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> stall_guard2_current_register_value;
<a name="l00583"></a>00583 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> driver_configuration_register_value;
<a name="l00584"></a>00584 <span class="comment">//the driver status result</span>
<a name="l00585"></a>00585 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> driver_status_result;
<a name="l00586"></a>00586
<a name="l00587"></a>00587 <span class="comment">//helper routione to get the top 10 bit of the readout</span>
<a name="l00588"></a>00588 <span class="keyword">inline</span> <span class="keywordtype">int</span> getReadoutValue();
<a name="l00589"></a>00589
<a name="l00590"></a>00590 <span class="comment">//the pins for the stepper driver</span>
<a name="l00591"></a>00591 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> cs_pin;
<a name="l00592"></a>00592 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> step_pin;
<a name="l00593"></a>00593 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> dir_pin;
<a name="l00594"></a>00594
<a name="l00595"></a>00595 <span class="comment">//status values </span>
<a name="l00596"></a>00596 <span class="keywordtype">boolean</span> started; <span class="comment">//if the stepper has been started yet</span>
<a name="l00597"></a>00597 <span class="keywordtype">int</span> microsteps; <span class="comment">//the current number of micro steps</span>
<a name="l00598"></a>00598 <span class="keywordtype">char</span> constant_off_time; <span class="comment">//we need to remember this value in order to enable and disable the motor</span>
<a name="l00599"></a>00599 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> cool_step_lower_threshold; <span class="comment">// we need to remember the threshold to enable and disable the CoolStep feature</span>
<a name="l00600"></a>00600 <span class="keywordtype">boolean</span> cool_step_enabled; <span class="comment">//we need to remember this to configure the coolstep if it si enabled</span>
<a name="l00601"></a>00601
<a name="l00602"></a>00602 <span class="comment">//SPI sender</span>
<a name="l00603"></a>00603 <span class="keyword">inline</span> <span class="keywordtype">void</span> send262(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> datagram);
<a name="l00604"></a>00604 };
<a name="l00605"></a>00605
<a name="l00606"></a>00606 <span class="preprocessor">#endif</span>
<a name="l00607"></a>00607 <span class="preprocessor"></span>
</pre></div></div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

@ -0,0 +1,72 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: Class List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li class="current"><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Class List</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><table>
<tr><td class="indexkey"><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td class="indexvalue">Class representing a TMC26X stepper driver </td></tr>
</table>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

@ -0,0 +1,117 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">TMC26XStepper Member List</div> </div>
</div><!--header-->
<div class="contents">
This is the complete list of members for <a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3">debugLastStatus</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883">getCoolStepCurrentIncrementSize</a>()</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c">getCoolStepLowerCurrentLimit</a>()</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8">getCoolStepLowerSgThreshold</a>()</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46">getCoolStepNumberOfSGReadings</a>()</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f">getCoolStepUpperSgThreshold</a>()</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f">getCurrent</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1">getCurrentCSReading</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7">getCurrentCurrent</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e">getCurrentStallGuardReading</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3">getMicrosteps</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125">getMotorPosition</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7">getOverTemperature</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e">getResistor</a>()</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29">getSpeed</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a">getStallGuardFilter</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def">getStallGuardThreshold</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7">getStepsLeft</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d">isCoolStepEnabled</a>()</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905">isCurrentScalingHalfed</a>()</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6">isEnabled</a>()</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e">isMoving</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c">isOpenLoadA</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303">isOpenLoadB</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf">isShortToGroundA</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b">isShortToGroundB</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41">isStallGuardOverThreshold</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7">isStallGuardReached</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0">isStandStill</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415">move</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967">readStatus</a>(char read_value)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649">setConstantOffTimeChopper</a>(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, unsigned char use_current_comparator)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e">setCoolStepConfiguration</a>(unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size, unsigned char current_increment_step_size, unsigned char lower_current_limit)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157">setCoolStepEnabled</a>(boolean enabled)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2">setCurrent</a>(unsigned int current)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305">setEnabled</a>(boolean enabled)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0">setMicrosteps</a>(int number_of_steps)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a">setRandomOffTime</a>(char value)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd">setSpeed</a>(unsigned int whatSpeed)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2">setSpreadCycleChopper</a>(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a">setStallGuardThreshold</a>(char stall_guard_threshold, char stall_guard_filter_enabled)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7">start</a>()</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d">step</a>(int number_of_steps)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123">stop</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c">TMC26XStepper</a>(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int current, unsigned int resistor=150)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5">un_start</a>()</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215">version</a>(void)</td><td><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a></td><td></td></tr>
</table></div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

@ -0,0 +1,1463 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: TMC26XStepper Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">TMC26XStepper Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="TMC26XStepper" -->
<p>Class representing a TMC26X stepper driver.
<a href="class_t_m_c26_x_stepper.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>&gt;</code></p>
<p><a href="class_t_m_c26_x_stepper-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c">TMC26XStepper</a> (int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int current, unsigned int resistor=150)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">creates a new represenatation of a stepper motor connected to a TMC26X stepper driver <a href="#a3ef40763b8b8ab2b6ed4978c0647906c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7">start</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">configures and starts the TMC26X stepper driver. Before you called this function the stepper driver is in nonfunctional mode. <a href="#aad1ed82b3e05940bde5a6c7ed3d3e8f7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5">un_start</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">resets the stepper in unconfigured mode. <a href="#af968e70a13068f1e71ac0fa6865630c5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd">setSpeed</a> (unsigned int whatSpeed)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the rotation speed in revolutions per minute. <a href="#a9478f43090995c8d5cdb4d4e8c07cdbd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29">getSpeed</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">reads out the currently selected speed in revolutions per minute. <a href="#aa564f5cc0218d30ef897c2830c768c29"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0">setMicrosteps</a> (int number_of_steps)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the number of microsteps in 2^i values (rounded) up to 256. <a href="#a21041579c7f9284567ee2e2a55a3afd0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3">getMicrosteps</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the effective current number of microsteps selected. <a href="#a5808551ced98b79c09bbb4bf47ecfec3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d">step</a> (int number_of_steps)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in the other direction. <a href="#ac073a742496885f1f60751f9fb9c395d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415">move</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Central movement method, must be called as often as possible in the lopp function and is very fast. <a href="#aed5d81f1549615529c723600a68ba415"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e">isMoving</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if the motor still has to move to fulfill the last movement command. <a href="#a880d602be8414b7b965287c1790cd50e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7">getStepsLeft</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of steps left in the current movement. <a href="#aa6c3211f85301ca0fb2e7b73cb8142a7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123">stop</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops the motor regardless if it moves or not. <a href="#a6315c18eadbc6bf4f3d81a6f80296123"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649">setConstantOffTimeChopper</a> (char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, unsigned char use_current_comparator)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets and configure the classical Constant Off Timer Chopper. <a href="#ac2d8a2bbae2aba3ed7c98e3ff1a06649"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2">setSpreadCycleChopper</a> (char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets and configures with spread cycle chopper. <a href="#aa152bb7ddb72a2bc8465553a39232df2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a">setRandomOffTime</a> (char value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Use random off time for noise reduction (0 for off, -1 for on). <a href="#a7ffd602cf4bf385847cba034417d5f0a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2">setCurrent</a> (unsigned int current)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">set the maximum motor current in mA (1000 is 1 Amp) Keep in mind this is the maximum peak Current. The RMS current will be 1/sqrt(2) smaller. The actual current can also be smaller by employing CoolStep. <a href="#aaa35fac83417c16b3a941fa168e4a4d2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f">getCurrent</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a> <a href="#a0c544e23efe3e4a912aacf57de84b71f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a">setStallGuardThreshold</a> (char stall_guard_threshold, char stall_guard_filter_enabled)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">set the StallGuard threshold in order to get sensible StallGuard readings. <a href="#af1a5abc23757860baf8ff421689a425a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def">getStallGuardThreshold</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">reads out the StallGuard threshold <a href="#a056661f444725c3ae15696d1e8d91def"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a">getStallGuardFilter</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the current setting of the StallGuard filter <a href="#a47e3443e3e786314c1099b8f14a91b8a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e">setCoolStepConfiguration</a> (unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size, unsigned char current_increment_step_size, unsigned char lower_current_limit)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature. <a href="#a381fbcce7c586ca2f1da8f9e704df14e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157">setCoolStepEnabled</a> (boolean enabled)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it. <a href="#a15bf0ed5a166a5d9a41f90f3ccbc6157"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d">isCoolStepEnabled</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">check if the CoolStep feature is enabled <a href="#a6de2306b6d8dc1fa2e50fccb66d8e66d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8">getCoolStepLowerSgThreshold</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the lower StallGuard threshold for the CoolStep operation <a href="#aa7469949deaa39a58038b3ddef532bc8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f">getCoolStepUpperSgThreshold</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the upper StallGuard threshold for the CoolStep operation <a href="#ac61298fd658773c28823d33ab04e970f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46">getCoolStepNumberOfSGReadings</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the number of StallGuard readings befor CoolStep adjusts the motor current. <a href="#aad44ee5ae73bf8e69af05674a304ba46"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883">getCoolStepCurrentIncrementSize</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the increment steps for the current for the CoolStep operation <a href="#ababe688a15f087d23d4ff2094fcee883"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c">getCoolStepLowerCurrentLimit</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the absolut minium current for the CoolStep operation <a href="#a0c7e8541abc120a3910e35c6fbf2167c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125">getMotorPosition</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current microstep position for phase A. <a href="#a1019f6f889acfd3176eecd60a0a20125"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e">getCurrentStallGuardReading</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current StallGuard value. <a href="#aed570ce3eea640e087b046333015de1e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1">getCurrentCSReading</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current current setting value as fraction of the maximum current Returns values between 0 and 31, representing 1/32 to 32/32 (=1) <a href="#a1a939fb495d747c2c11be99a740371e1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905">isCurrentScalingHalfed</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference. <a href="#ad435db189ebb101fb2de90a484f33905"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7">getCurrentCurrent</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000). This method calculates the currently used current setting (either by setting or by CoolStep) and reconstructs the current in mA by usinge the VSENSE and resistor value. This method uses floating point math - so it may not be the fastest. <a href="#aa00741168a7def0a7a9d2f2c9d3b99d7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41">isStallGuardOverThreshold</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if there is a StallGuard warning in the last status <a href="#aea4c6e1fac909116c6b55f902d6cff41"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7">getOverTemperature</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return over temperature status of the last status readout return 0 is everything is OK, TMC26X_OVERTEMPERATURE_PREWARING if status is reached, TMC26X_OVERTEMPERATURE_SHUTDOWN is the chip is shutdown, -1 if the status is unknown. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. <a href="#a7662c2fbc03d1f5a7da5cabcc153b2d7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf">isShortToGroundA</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Is motor channel A shorted to ground detected in the last status readout. <a href="#ad329fa4693d3139dea241ebe3d0f33cf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b">isShortToGroundB</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Is motor channel B shorted to ground detected in the last status readout. <a href="#a0ccb54d40cce0d802aa56ff6261f9f3b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c">isOpenLoadA</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">iIs motor channel A connected according to the last statu readout. <a href="#af97b2ab9d1ba36765ac6f17cf25ec45c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303">isOpenLoadB</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">iIs motor channel A connected according to the last statu readout. <a href="#a303590124f5ac6d6a06d0ec60d0b5303"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0">isStandStill</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s. <a href="#ab26602f360a4fb6ec6d262011675b2b0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7">isStallGuardReached</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if there is a StallGuard warning in the last status <a href="#afdeded501ec2cabeffde33d31b6573f7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305">setEnabled</a> (boolean enabled)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not. <a href="#a4472cd86ad5b65dec5ec45ce69158305"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6">isEnabled</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely <a href="#a15796c0cbdeab23a343c3f25327283b6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967">readStatus</a> (char read_value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Manually read out the status register This function sends a byte to the motor driver in order to get the current readout. The parameter read_value seletcs which value will get returned. If the read_vlaue changes in respect to the previous readout this method automatically send two bytes to the motor: one to set the redout and one to get the actual readout. So this method may take time to send and read one or two bits - depending on the previous readout. <a href="#af95a824bfdf49ef979b5354798e52967"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e">getResistor</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current sense resistor value in milliohm. The default value of ,15 Ohm will return 150. <a href="#ae1db5ec2ec9bfbfaea83c659e006692e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3">debugLastStatus</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints out all the information that can be found in the last status read out - it does not force a status readout. The result is printed via Serial. <a href="#ad5e5b1bf5a46d02577dd548083877ec3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215">version</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">library version <a href="#ab040d9df1e85d6fb0c105205a36b0215"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Class representing a TMC26X stepper driver. </p>
<p>In order to use one fo those drivers in your Arduino code you have to create an object of that class: </p>
<div class="fragment"><pre class="fragment"> <a class="code" href="class_t_m_c26_x_stepper.html" title="Class representing a TMC26X stepper driver.">TMC26XStepper</a> stepper = <a class="code" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c" title="creates a new represenatation of a stepper motor connected to a TMC26X stepper driver">TMC26XStepper</a>(200,1,2,3,500);
</pre></div><p> see TMC26XStepper(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int rms_current)</p>
<p>Keep in mind that you need to start the driver with <a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7" title="configures and starts the TMC26X stepper driver. Before you called this function the stepper driver i...">start()</a> in order to get the TMC26X configured.</p>
<p>The most important function is the <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415" title="Central movement method, must be called as often as possible in the lopp function and is very fast...">move()</a>. It checks if the motor has to do a step or not. It is important that you call <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415" title="Central movement method, must be called as often as possible in the lopp function and is very fast...">move()</a> as often as possible in your Arduino loop() routine. I suggest to use a very fast loop routine and always call it at the beginning or the end.</p>
<p>In order to move you have to provide a movement speed with <a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd" title="Sets the rotation speed in revolutions per minute.">setSpeed()</a>. The speed is a positive value setting the rotations per minute.</p>
<p>To really move the motor you have to call <a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d" title="Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in ...">step()</a> to tell the driver to move the motor the given number of steps in the given direction. Positive values move the motor in one direction, negative values in the other direction.</p>
<p>You can check with <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a> if the mototr is still moving or stop it apruptely with <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123" title="Stops the motor regardless if it moves or not.">stop()</a>. </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8h_source.html#l00101">101</a> of file <a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a3ef40763b8b8ab2b6ed4978c0647906c"></a><!-- doxytag: member="TMC26XStepper::TMC26XStepper" ref="a3ef40763b8b8ab2b6ed4978c0647906c" args="(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int current, unsigned int resistor=150)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c">TMC26XStepper::TMC26XStepper</a> </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>number_of_steps</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>cs_pin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>dir_pin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>step_pin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>current</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>resistor</em> = <code>150</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>creates a new represenatation of a stepper motor connected to a TMC26X stepper driver </p>
<p>This is the main constructor. If in doubt use this. You must provide all parameters as described below.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">number_of_steps</td><td>the number of steps the motor has per rotation. </td></tr>
<tr><td class="paramname">cs_pin</td><td>The Arduino pin you have connected the Cient Select Pin (!CS) of the TMC26X for SPI </td></tr>
<tr><td class="paramname">dir_pin</td><td>the number of the Arduino pin the Direction input of the TMC26X is connected </td></tr>
<tr><td class="paramname">step_pin</td><td>the number of the Arduino pin the step pin of the TMC26X driver is connected. </td></tr>
<tr><td class="paramname">rms_current</td><td>the maximum current to privide to the motor in mA (!). A value of 200 would send up to 200mA to the motor </td></tr>
<tr><td class="paramname">resistor</td><td>the current sense resistor in milli Ohm, defaults to ,15 Ohm ( or 150 milli Ohm) as in the TMC260 Arduino Shield</td></tr>
</table>
</dd>
</dl>
<p>Keep in mind that you must also call <a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7" title="configures and starts the TMC26X stepper driver. Before you called this function the stepper driver i...">TMC26XStepper.start()</a> in order to configure the stepper driver for use.</p>
<p>By default the Constant Off Time chopper is used, see TCM262Stepper.setConstantOffTimeChopper() for details. This should work on most motors (YMMV). You may want to configure and use the Spread Cycle Chopper, see <a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2" title="Sets and configures with spread cycle chopper.">setSpreadCycleChopper()</a>.</p>
<p>By default a microstepping of 1/32th is used to provide a smooth motor run, while still giving a good progression per step. You can select a different stepping with <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> to aa different value. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7" title="configures and starts the TMC26X stepper driver. Before you called this function the stepper driver i...">start()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00111">111</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ad5e5b1bf5a46d02577dd548083877ec3"></a><!-- doxytag: member="TMC26XStepper::debugLastStatus" ref="ad5e5b1bf5a46d02577dd548083877ec3" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3">TMC26XStepper::debugLastStatus</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Prints out all the information that can be found in the last status read out - it does not force a status readout. The result is printed via Serial. </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00902">902</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ababe688a15f087d23d4ff2094fcee883"></a><!-- doxytag: member="TMC26XStepper::getCoolStepCurrentIncrementSize" ref="ababe688a15f087d23d4ff2094fcee883" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883">TMC26XStepper::getCoolStepCurrentIncrementSize</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>returns the increment steps for the current for the CoolStep operation </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00704">704</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a0c7e8541abc120a3910e35c6fbf2167c"></a><!-- doxytag: member="TMC26XStepper::getCoolStepLowerCurrentLimit" ref="a0c7e8541abc120a3910e35c6fbf2167c" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c">TMC26XStepper::getCoolStepLowerCurrentLimit</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>returns the absolut minium current for the CoolStep operation </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd>
<dd>
<a class="el" href="_t_m_c26_x_stepper_8h.html#a28b1774bd4aa854fb5e4b6dc7db96ecb">COOL_STEP_HALF_CS_LIMIT</a>, COOL_STEP_QUARTER_CS_LIMIT </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00712">712</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa7469949deaa39a58038b3ddef532bc8"></a><!-- doxytag: member="TMC26XStepper::getCoolStepLowerSgThreshold" ref="aa7469949deaa39a58038b3ddef532bc8" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8">TMC26XStepper::getCoolStepLowerSgThreshold</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>returns the lower StallGuard threshold for the CoolStep operation </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00695">695</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aad44ee5ae73bf8e69af05674a304ba46"></a><!-- doxytag: member="TMC26XStepper::getCoolStepNumberOfSGReadings" ref="aad44ee5ae73bf8e69af05674a304ba46" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46">TMC26XStepper::getCoolStepNumberOfSGReadings</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>returns the number of StallGuard readings befor CoolStep adjusts the motor current. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00708">708</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac61298fd658773c28823d33ab04e970f"></a><!-- doxytag: member="TMC26XStepper::getCoolStepUpperSgThreshold" ref="ac61298fd658773c28823d33ab04e970f" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f">TMC26XStepper::getCoolStepUpperSgThreshold</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>returns the upper StallGuard threshold for the CoolStep operation </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00700">700</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a0c544e23efe3e4a912aacf57de84b71f"></a><!-- doxytag: member="TMC26XStepper::getCurrent" ref="a0c544e23efe3e4a912aacf57de84b71f" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f">TMC26XStepper::getCurrent</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a> </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the maximum motor current in milli amps </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00336">336</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a1a939fb495d747c2c11be99a740371e1"></a><!-- doxytag: member="TMC26XStepper::getCurrentCSReading" ref="a1a939fb495d747c2c11be99a740371e1" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1">TMC26XStepper::getCurrentCSReading</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the current current setting value as fraction of the maximum current Returns values between 0 and 31, representing 1/32 to 32/32 (=1) </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00781">781</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa00741168a7def0a7a9d2f2c9d3b99d7"></a><!-- doxytag: member="TMC26XStepper::getCurrentCurrent" ref="aa00741168a7def0a7a9d2f2c9d3b99d7" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7">TMC26XStepper::getCurrentCurrent</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000). This method calculates the currently used current setting (either by setting or by CoolStep) and reconstructs the current in mA by usinge the VSENSE and resistor value. This method uses floating point math - so it may not be the fastest. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1" title="Reads the current current setting value as fraction of the maximum current Returns values between 0 a...">getCurrentCSReading()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e" title="Returns the current sense resistor value in milliohm. The default value of ,15 Ohm will return 150...">getResistor()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905" title="a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference.">isCurrentScalingHalfed()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f" title="readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()">getCurrent()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00792">792</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aed570ce3eea640e087b046333015de1e"></a><!-- doxytag: member="TMC26XStepper::getCurrentStallGuardReading" ref="aed570ce3eea640e087b046333015de1e" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e">TMC26XStepper::getCurrentStallGuardReading</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the current StallGuard value. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The current StallGuard value, lesser values indicate higher load, 0 means stall detected. Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a" title="set the StallGuard threshold in order to get sensible StallGuard readings.">setStallGuardThreshold()</a> for tuning the readout to sensible ranges. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00770">770</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a5808551ced98b79c09bbb4bf47ecfec3"></a><!-- doxytag: member="TMC26XStepper::getMicrosteps" ref="a5808551ced98b79c09bbb4bf47ecfec3" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3">TMC26XStepper::getMicrosteps</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>returns the effective current number of microsteps selected. </p>
<p>This function always returns the effective number of microsteps. This can be a bit different than the micro steps set in <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> since it is rounded to 2^i.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00446">446</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a1019f6f889acfd3176eecd60a0a20125"></a><!-- doxytag: member="TMC26XStepper::getMotorPosition" ref="a1019f6f889acfd3176eecd60a0a20125" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125">TMC26XStepper::getMotorPosition</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Get the current microstep position for phase A. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The current microstep position for phase A 0…255</dd></dl>
<p>Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00762">762</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7662c2fbc03d1f5a7da5cabcc153b2d7"></a><!-- doxytag: member="TMC26XStepper::getOverTemperature" ref="a7662c2fbc03d1f5a7da5cabcc153b2d7" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7">TMC26XStepper::getOverTemperature</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return over temperature status of the last status readout return 0 is everything is OK, TMC26X_OVERTEMPERATURE_PREWARING if status is reached, TMC26X_OVERTEMPERATURE_SHUTDOWN is the chip is shutdown, -1 if the status is unknown. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00816">816</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ae1db5ec2ec9bfbfaea83c659e006692e"></a><!-- doxytag: member="TMC26XStepper::getResistor" ref="ae1db5ec2ec9bfbfaea83c659e006692e" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e">TMC26XStepper::getResistor</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the current sense resistor value in milliohm. The default value of ,15 Ohm will return 150. </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00883">883</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa564f5cc0218d30ef897c2830c768c29"></a><!-- doxytag: member="TMC26XStepper::getSpeed" ref="aa564f5cc0218d30ef897c2830c768c29" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29">TMC26XStepper::getSpeed</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>reads out the currently selected speed in revolutions per minute. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd" title="Sets the rotation speed in revolutions per minute.">setSpeed()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00221">221</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a47e3443e3e786314c1099b8f14a91b8a"></a><!-- doxytag: member="TMC26XStepper::getStallGuardFilter" ref="a47e3443e3e786314c1099b8f14a91b8a" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a">TMC26XStepper::getStallGuardFilter</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>returns the current setting of the StallGuard filter </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if not set, -1 if set </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00381">381</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a056661f444725c3ae15696d1e8d91def"></a><!-- doxytag: member="TMC26XStepper::getStallGuardThreshold" ref="a056661f444725c3ae15696d1e8d91def" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def">TMC26XStepper::getStallGuardThreshold</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>reads out the StallGuard threshold </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>a number between -64 and 63. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00368">368</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa6c3211f85301ca0fb2e7b73cb8142a7"></a><!-- doxytag: member="TMC26XStepper::getStepsLeft" ref="aa6c3211f85301ca0fb2e7b73cb8142a7" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7">TMC26XStepper::getStepsLeft</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Get the number of steps left in the current movement. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of steps left in the movement. This number is always positive. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00278">278</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6de2306b6d8dc1fa2e50fccb66d8e66d"></a><!-- doxytag: member="TMC26XStepper::isCoolStepEnabled" ref="a6de2306b6d8dc1fa2e50fccb66d8e66d" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d">TMC26XStepper::isCoolStepEnabled</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>check if the CoolStep feature is enabled </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157" title="enables or disables the CoolStep smart energy operation feature. It must be configured before enablin...">setCoolStepEnabled()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00691">691</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ad435db189ebb101fb2de90a484f33905"></a><!-- doxytag: member="TMC26XStepper::isCurrentScalingHalfed" ref="ad435db189ebb101fb2de90a484f33905" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905">TMC26XStepper::isCurrentScalingHalfed</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>false if 0.13V is the reference voltage, true if 0.165V is used. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00887">887</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a15796c0cbdeab23a343c3f25327283b6"></a><!-- doxytag: member="TMC26XStepper::isEnabled" ref="a15796c0cbdeab23a343c3f25327283b6" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6">TMC26XStepper::isEnabled</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the bridges and by that the motor driver are enabled, false if not. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305" title="enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not.">setEnabled()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00729">729</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a880d602be8414b7b965287c1790cd50e"></a><!-- doxytag: member="TMC26XStepper::isMoving" ref="a880d602be8414b7b965287c1790cd50e" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e">TMC26XStepper::isMoving</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>checks if the motor still has to move to fulfill the last movement command. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the motor stops, -1 if the motor is moving.</dd></dl>
<p>This method can be used to determine if the motor is ready for new movements. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d" title="Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in ...">step()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415" title="Central movement method, must be called as often as possible in the lopp function and is very fast...">move()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00274">274</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af97b2ab9d1ba36765ac6f17cf25ec45c"></a><!-- doxytag: member="TMC26XStepper::isOpenLoadA" ref="af97b2ab9d1ba36765ac6f17cf25ec45c" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c">TMC26XStepper::isOpenLoadA</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>iIs motor channel A connected according to the last statu readout. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00846">846</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a303590124f5ac6d6a06d0ec60d0b5303"></a><!-- doxytag: member="TMC26XStepper::isOpenLoadB" ref="a303590124f5ac6d6a06d0ec60d0b5303" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303">TMC26XStepper::isOpenLoadB</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>iIs motor channel A connected according to the last statu readout. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00854">854</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ad329fa4693d3139dea241ebe3d0f33cf"></a><!-- doxytag: member="TMC26XStepper::isShortToGroundA" ref="ad329fa4693d3139dea241ebe3d0f33cf" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf">TMC26XStepper::isShortToGroundA</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Is motor channel A shorted to ground detected in the last status readout. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00830">830</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a0ccb54d40cce0d802aa56ff6261f9f3b"></a><!-- doxytag: member="TMC26XStepper::isShortToGroundB" ref="a0ccb54d40cce0d802aa56ff6261f9f3b" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b">TMC26XStepper::isShortToGroundB</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Is motor channel B shorted to ground detected in the last status readout. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00838">838</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aea4c6e1fac909116c6b55f902d6cff41"></a><!-- doxytag: member="TMC26XStepper::isStallGuardOverThreshold" ref="aea4c6e1fac909116c6b55f902d6cff41" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41">TMC26XStepper::isStallGuardOverThreshold</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>checks if there is a StallGuard warning in the last status </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if there was no warning, -1 if there was some warning. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a" title="set the StallGuard threshold in order to get sensible StallGuard readings.">setStallGuardThreshold()</a> for tuning the readout to sensible ranges. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00803">803</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="afdeded501ec2cabeffde33d31b6573f7"></a><!-- doxytag: member="TMC26XStepper::isStallGuardReached" ref="afdeded501ec2cabeffde33d31b6573f7" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7">TMC26XStepper::isStallGuardReached</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>checks if there is a StallGuard warning in the last status </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if there was no warning, -1 if there was some warning. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41" title="checks if there is a StallGuard warning in the last status">isStallGuardOverThreshold()</a> TODO why?</dd>
<dd>
<a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a" title="set the StallGuard threshold in order to get sensible StallGuard readings.">setStallGuardThreshold()</a> for tuning the readout to sensible ranges. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00870">870</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab26602f360a4fb6ec6d262011675b2b0"></a><!-- doxytag: member="TMC26XStepper::isStandStill" ref="ab26602f360a4fb6ec6d262011675b2b0" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0">TMC26XStepper::isStandStill</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00862">862</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aed5d81f1549615529c723600a68ba415"></a><!-- doxytag: member="TMC26XStepper::move" ref="aed5d81f1549615529c723600a68ba415" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415">TMC26XStepper::move</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Central movement method, must be called as often as possible in the lopp function and is very fast. </p>
<p>This routine checks if the motor still has to move, if the waiting delay has passed to send a new step command to the motor and manages the number of steps yet to move to fulfill the current move command.</p>
<p>This function is implemented to be as fast as possible to call it as often as possible in your loop routine. The more regurlarly you call this function the better. In both senses of 'regularly': Calling it as often as possible is not a bad idea and if you even manage that the intervals you call this function are not too irregular helps too.</p>
<p>You can call this routine even if you know that the motor is not miving. It introduces just a very small penalty in your code. You must not call <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a> to determine if you need to call this function, since taht is done internally already and only slows down you code.</p>
<p>How often you call this function directly influences your top miving speed for the motor. It may be a good idea to call this from an timer overflow interrupt to ensure proper calling. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d" title="Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in ...">step()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00246">246</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af95a824bfdf49ef979b5354798e52967"></a><!-- doxytag: member="TMC26XStepper::readStatus" ref="af95a824bfdf49ef979b5354798e52967" args="(char read_value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967">TMC26XStepper::readStatus</a> </td>
<td>(</td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>read_value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Manually read out the status register This function sends a byte to the motor driver in order to get the current readout. The parameter read_value seletcs which value will get returned. If the read_vlaue changes in respect to the previous readout this method automatically send two bytes to the motor: one to set the redout and one to get the actual readout. So this method may take time to send and read one or two bits - depending on the previous readout. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">read_value</td><td>selects which value to read out (0..3). You can use the defines TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, or TMC_262_READOUT_CURRENT </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="_t_m_c26_x_stepper_8h.html#aff05d4a47ef8821322ccc2a20785fbee">TMC26X_READOUT_POSITION</a>, TMC_262_READOUT_STALLGUARD, TMC_262_READOUT_CURRENT </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00742">742</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac2d8a2bbae2aba3ed7c98e3ff1a06649"></a><!-- doxytag: member="TMC26XStepper::setConstantOffTimeChopper" ref="ac2d8a2bbae2aba3ed7c98e3ff1a06649" args="(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, unsigned char use_current_comparator)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649">TMC26XStepper::setConstantOffTimeChopper</a> </td>
<td>(</td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>constant_off_time</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>blank_time</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>fast_decay_time_setting</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>sine_wave_offset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char&#160;</td>
<td class="paramname"><em>use_current_comparator</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets and configure the classical Constant Off Timer Chopper. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">constant_off_time</td><td>The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks) </td></tr>
<tr><td class="paramname">blank_time</td><td>Selects the comparator blank time. This time needs to safely cover the switching event and the duration of the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) … (3) amx setting </td></tr>
<tr><td class="paramname">fast_decay_time_setting</td><td>Fast decay time setting. Controls the portion of fast decay for each chopper cycle. 0: slow decay only, 1…15: duration of fast decay phase </td></tr>
<tr><td class="paramname">sine_wave_offset</td><td>Sine wave offset. Controls the sine wave offset. A positive offset corrects for zero crossing error. -3…-1: negative offset, 0: no offset,1…12: positive offset </td></tr>
<tr><td class="paramname">use_curreent_comparator</td><td>Selects usage of the current comparator for termination of the fast decay cycle. If current comparator is enabled, it terminates the fast decay cycle in case the current reaches a higher negative value than the actual positive value. (0 disable, -1 enable).</td></tr>
</table>
</dd>
</dl>
<p>The classic constant off time chopper uses a fixed portion of fast decay following each on phase. While the duration of the on time is determined by the chopper comparator, the fast decay time needs to be set by the user in a way, that the current decay is enough for the driver to be able to follow the falling slope of the sine wave, and on the other hand it should not be too long, in order to minimize motor current ripple and power dissipation. This best can be tuned using an oscilloscope or trying out motor smoothness at different velocities. A good starting value is a fast decay time setting similar to the slow decay time setting. After tuning of the fast decay time, the offset should be determined, in order to have a smooth zero transition. This is necessary, because the fast decay phase leads to the absolute value of the motor current being lower than the target current (see figure 17). If the zero offset is too low, the motor stands still for a short moment during current zero crossing, if it is set too high, it makes a larger microstep. Typically, a positive offset setting is required for optimum operation.</p>
<dl class="see"><dt><b>See also:</b></dt><dd>setSpreadCycleChoper() for other alternatives. </dd>
<dd>
<a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a" title="Use random off time for noise reduction (0 for off, -1 for on).">setRandomOffTime()</a> for spreading the noise over a wider spectrum </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00473">473</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a381fbcce7c586ca2f1da8f9e704df14e"></a><!-- doxytag: member="TMC26XStepper::setCoolStepConfiguration" ref="a381fbcce7c586ca2f1da8f9e704df14e" args="(unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size, unsigned char current_increment_step_size, unsigned char lower_current_limit)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e">TMC26XStepper::setCoolStepConfiguration</a> </td>
<td>(</td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>lower_SG_threshold</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>SG_hysteresis</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char&#160;</td>
<td class="paramname"><em>current_decrement_step_size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char&#160;</td>
<td class="paramname"><em>current_increment_step_size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char&#160;</td>
<td class="paramname"><em>lower_current_limit</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">lower_SG_threshold</td><td>Sets the lower threshold for stallGuard2TM reading. Below this value, the motor current becomes increased. Allowed values are 0...480 </td></tr>
<tr><td class="paramname">SG_hysteresis</td><td>Sets the distance between the lower and the upper threshold for stallGuard2TM reading. Above the upper threshold (which is lower_SG_threshold+SG_hysteresis+1) the motor current becomes decreased. Allowed values are 0...480 </td></tr>
<tr><td class="paramname">current_decrement_step_size</td><td>Sets the current decrement steps. If the StallGuard value is above the threshold the current gets decremented by this step size. 0...32 </td></tr>
<tr><td class="paramname">current_increment_step_size</td><td>Sets the current increment step. The current becomes incremented for each measured stallGuard2TM value below the lower threshold. 0...8 </td></tr>
<tr><td class="paramname">lower_current_limit</td><td>Sets the lower motor current limit for coolStepTM operation by scaling the CS value. Values can be COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT The CoolStep smart energy operation automatically adjust the current sent into the motor according to the current load, read out by the StallGuard in order to provide the optimum torque with the minimal current consumption. You configure the CoolStep current regulator by defining upper and lower bounds of StallGuard readouts. If the readout is above the limit the current gets increased, below the limit the current gets decreased. You can specify the upper an lower threshold of the StallGuard readout in order to adjust the current. You can also set the number of StallGuard readings neccessary above or below the limit to get a more stable current adjustement. The current adjustement itself is configured by the number of steps the current gests in- or decreased and the absolut minimum current (1/2 or 1/4th otf the configured current). </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="_t_m_c26_x_stepper_8h.html#a28b1774bd4aa854fb5e4b6dc7db96ecb">COOL_STEP_HALF_CS_LIMIT</a>, COOL_STEP_QUARTER_CS_LIMIT </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00636">636</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a15bf0ed5a166a5d9a41f90f3ccbc6157"></a><!-- doxytag: member="TMC26XStepper::setCoolStepEnabled" ref="a15bf0ed5a166a5d9a41f90f3ccbc6157" args="(boolean enabled)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157">TMC26XStepper::setCoolStepEnabled</a> </td>
<td>(</td>
<td class="paramtype">boolean&#160;</td>
<td class="paramname"><em>enabled</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">enabled</td><td>true if CoolStep should be enabled, false if not. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00676">676</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aaa35fac83417c16b3a941fa168e4a4d2"></a><!-- doxytag: member="TMC26XStepper::setCurrent" ref="aaa35fac83417c16b3a941fa168e4a4d2" args="(unsigned int current)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2">TMC26XStepper::setCurrent</a> </td>
<td>(</td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>current</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>set the maximum motor current in mA (1000 is 1 Amp) Keep in mind this is the maximum peak Current. The RMS current will be 1/sqrt(2) smaller. The actual current can also be smaller by employing CoolStep. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">current</td><td>the maximum motor current in mA </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f" title="readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()">getCurrent()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00292">292</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a4472cd86ad5b65dec5ec45ce69158305"></a><!-- doxytag: member="TMC26XStepper::setEnabled" ref="a4472cd86ad5b65dec5ec45ce69158305" args="(boolean enabled)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305">TMC26XStepper::setEnabled</a> </td>
<td>(</td>
<td class="paramtype">boolean&#160;</td>
<td class="paramname"><em>enabled</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">enabled</td><td>a boolean value true if the motor should be enabled, false otherwise. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00716">716</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a21041579c7f9284567ee2e2a55a3afd0"></a><!-- doxytag: member="TMC26XStepper::setMicrosteps" ref="a21041579c7f9284567ee2e2a55a3afd0" args="(int number_of_steps)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0">TMC26XStepper::setMicrosteps</a> </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>number_of_steps</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set the number of microsteps in 2^i values (rounded) up to 256. </p>
<p>This method set's the number of microsteps per step in 2^i interval. This means you can select 1, 2, 4, 16, 32, 64, 128 or 256 as valid microsteps. If you give any other value it will be rounded to the next smaller number (3 would give a microstepping of 2). You can always check the current microstepping with <a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3" title="returns the effective current number of microsteps selected.">getMicrosteps()</a>. </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00394">394</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7ffd602cf4bf385847cba034417d5f0a"></a><!-- doxytag: member="TMC26XStepper::setRandomOffTime" ref="a7ffd602cf4bf385847cba034417d5f0a" args="(char value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a">TMC26XStepper::setRandomOffTime</a> </td>
<td>(</td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Use random off time for noise reduction (0 for off, -1 for on). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">value</td><td>0 for off, -1 for on</td></tr>
</table>
</dd>
</dl>
<p>In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized. The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity, thus it depends on the microstep position. With some motors a slightly audible beat can occur between the chopper frequencies, especially when they are near to each other. This typically occurs at a few microstep positions within each quarter wave. This effect normally is not audible when compared to mechanical noise generated by ball bearings, etc. Further factors which can cause a similar effect are a poor layout of sense resistor GND connection. In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided. It modulates the slow decay time setting when switched on. The random off time feature further spreads the chopper spectrum, reducing electromagnetic emission on single frequencies. </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00624">624</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a9478f43090995c8d5cdb4d4e8c07cdbd"></a><!-- doxytag: member="TMC26XStepper::setSpeed" ref="a9478f43090995c8d5cdb4d4e8c07cdbd" args="(unsigned int whatSpeed)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd">TMC26XStepper::setSpeed</a> </td>
<td>(</td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>whatSpeed</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the rotation speed in revolutions per minute. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">whatSpeed</td><td>the desired speed in rotations per minute. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00208">208</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa152bb7ddb72a2bc8465553a39232df2"></a><!-- doxytag: member="TMC26XStepper::setSpreadCycleChopper" ref="aa152bb7ddb72a2bc8465553a39232df2" args="(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2">TMC26XStepper::setSpreadCycleChopper</a> </td>
<td>(</td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>constant_off_time</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>blank_time</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>hysteresis_start</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>hysteresis_end</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>hysteresis_decrement</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets and configures with spread cycle chopper. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">constant_off_time</td><td>The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks) </td></tr>
<tr><td class="paramname">blank_time</td><td>Selects the comparator blank time. This time needs to safely cover the switching event and the duration of the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) … (3) amx setting </td></tr>
<tr><td class="paramname">hysteresis_start</td><td>Hysteresis start setting. Please remark, that this value is an offset to the hysteresis end value. 1 … 8 </td></tr>
<tr><td class="paramname">hysteresis_end</td><td>Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by hysteresis_decrement. The sum hysteresis_start + hysteresis_end must be &lt;16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited. </td></tr>
<tr><td class="paramname">hysteresis_decrement</td><td>Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time. 0 (fast decrement) … 3 (slow decrement).</td></tr>
</table>
</dd>
</dl>
<p>The spreadCycle chopper scheme (pat.fil.) is a precise and simple to use chopper principle, which automatically determines the optimum fast decay portion for the motor. Anyhow, a number of settings can be made in order to optimally fit the driver to the motor. Each chopper cycle is comprised of an on-phase, a slow decay phase, a fast decay phase and a second slow decay phase. The slow decay phases limit the maximum chopper frequency and are important for low motor and driver power dissipation. The hysteresis start setting limits the chopper frequency by forcing the driver to introduce a minimum amount of current ripple into the motor coils. The motor inductivity determines the ability to follow a changing motor current. The duration of the on- and fast decay phase needs to cover at least the blank time, because the current comparator is disabled during this time.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a" title="Use random off time for noise reduction (0 for off, -1 for on).">setRandomOffTime()</a> for spreading the noise over a wider spectrum </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00552">552</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af1a5abc23757860baf8ff421689a425a"></a><!-- doxytag: member="TMC26XStepper::setStallGuardThreshold" ref="af1a5abc23757860baf8ff421689a425a" args="(char stall_guard_threshold, char stall_guard_filter_enabled)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a">TMC26XStepper::setStallGuardThreshold</a> </td>
<td>(</td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>stall_guard_threshold</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>stall_guard_filter_enabled</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>set the StallGuard threshold in order to get sensible StallGuard readings. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">stall_guard_threshold</td><td>-64 … 63 the StallGuard threshold </td></tr>
<tr><td class="paramname">stall_guard_filter_enabled</td><td>0 if the filter is disabled, -1 if it is enabled</td></tr>
</table>
</dd>
</dl>
<p>The StallGuard threshold is used to optimize the StallGuard reading to sensible values. It should be at 0 at the maximum allowable load on the otor (but not before). = is a good starting point (and the default) If you get Stall Gaurd readings of 0 without any load or with too little laod increase the value. If you get readings of 1023 even with load decrease the setting.</p>
<p>If you switch on the filter the StallGuard reading is only updated each 4th full step to reduce the noise in the reading.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to read out the current value. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00346">346</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aad1ed82b3e05940bde5a6c7ed3d3e8f7"></a><!-- doxytag: member="TMC26XStepper::start" ref="aad1ed82b3e05940bde5a6c7ed3d3e8f7" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7">TMC26XStepper::start</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>configures and starts the TMC26X stepper driver. Before you called this function the stepper driver is in nonfunctional mode. </p>
<p>This routine configures the TMC26X stepper driver for the given values via SPI. Most member functions are non functional if the driver has not been started. Therefore it is best to call this in your Arduino setup() function. </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00157">157</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac073a742496885f1f60751f9fb9c395d"></a><!-- doxytag: member="TMC26XStepper::step" ref="ac073a742496885f1f60751f9fb9c395d" args="(int number_of_steps)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d">TMC26XStepper::step</a> </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>number_of_steps</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in the other direction. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">number_of_steps</td><td>The number of steps to move the motor. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the motor was not moving and moves now. -1 if the motor is moving and the new steps could not be set.</dd></dl>
<p>If the previous movement is not finished yet the function will return -1 and not change the steps to move the motor. If the motor does not move it return 0</p>
<p>The direction of the movement is indicated by the sign of the steps parameter. It is not determinable if positive values are right or left This depends on the internal construction of the motor and how you connected it to the stepper driver.</p>
<p>You can always verify with <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a> or even use <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123" title="Stops the motor regardless if it moves or not.">stop()</a> to stop the motor before giving it new step directions. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7" title="Get the number of steps left in the current movement.">getStepsLeft()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123" title="Stops the motor regardless if it moves or not.">stop()</a> </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00229">229</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6315c18eadbc6bf4f3d81a6f80296123"></a><!-- doxytag: member="TMC26XStepper::stop" ref="a6315c18eadbc6bf4f3d81a6f80296123" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123">TMC26XStepper::stop</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Stops the motor regardless if it moves or not. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>-1 if the motor was moving and is really stoped or 0 if it was not moving at all.</dd></dl>
<p>This method directly and apruptely stops the motor and may be used as an emergency stop. </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00282">282</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af968e70a13068f1e71ac0fa6865630c5"></a><!-- doxytag: member="TMC26XStepper::un_start" ref="af968e70a13068f1e71ac0fa6865630c5" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5">TMC26XStepper::un_start</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>resets the stepper in unconfigured mode. </p>
<p>This routine enables you to call start again. It does not change anything in the internal stepper configuration or the desired configuration. It just marks the stepper as not yet startet. You do not have to reconfigure the stepper to start it again, but it is not reset to any factory settings this has to be configured back by yourself. (Hint: Normally you do not need this function) </p>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00199">199</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab040d9df1e85d6fb0c105205a36b0215"></a><!-- doxytag: member="TMC26XStepper::version" ref="ab040d9df1e85d6fb0c105205a36b0215" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215">TMC26XStepper::version</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>library version </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the version number as int. </dd></dl>
<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00897">897</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a></li>
<li><a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a></li>
</ul>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

@ -0,0 +1,78 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: Class Index</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li class="current"><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Class Index</div> </div>
</div><!--header-->
<div class="contents">
<div class="qindex"><a class="qindex" href="#letter_T">T</a></div>
<table style="margin: 10px; white-space: nowrap;" align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
<tr><td rowspan="2" valign="bottom"><a name="letter_T"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;T&#160;&#160;</div></td></tr></table>
</td><td></td></tr>
<tr><td></td></tr>
<tr><td valign="top"><a class="el" href="class_t_m_c26_x_stepper.html">TMC26XStepper</a>&#160;&#160;&#160;</td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
<div class="qindex"><a class="qindex" href="#letter_T">T</a></div>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

@ -0,0 +1,949 @@
/* The standard CSS for doxygen */
body, table, div, p, dl {
font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
font-size: 13px;
line-height: 1.3;
}
/* @group Heading Levels */
h1 {
font-size: 150%;
}
.title {
font-size: 150%;
font-weight: bold;
margin: 10px 2px;
}
h2 {
font-size: 120%;
}
h3 {
font-size: 100%;
}
dt {
font-weight: bold;
}
div.multicol {
-moz-column-gap: 1em;
-webkit-column-gap: 1em;
-moz-column-count: 3;
-webkit-column-count: 3;
}
p.startli, p.startdd, p.starttd {
margin-top: 2px;
}
p.endli {
margin-bottom: 0px;
}
p.enddd {
margin-bottom: 4px;
}
p.endtd {
margin-bottom: 2px;
}
/* @end */
caption {
font-weight: bold;
}
span.legend {
font-size: 70%;
text-align: center;
}
h3.version {
font-size: 90%;
text-align: center;
}
div.qindex, div.navtab{
background-color: #EBEFF6;
border: 1px solid #A3B4D7;
text-align: center;
}
div.qindex, div.navpath {
width: 100%;
line-height: 140%;
}
div.navtab {
margin-right: 15px;
}
/* @group Link Styling */
a {
color: #3D578C;
font-weight: normal;
text-decoration: none;
}
.contents a:visited {
color: #4665A2;
}
a:hover {
text-decoration: underline;
}
a.qindex {
font-weight: bold;
}
a.qindexHL {
font-weight: bold;
background-color: #9CAFD4;
color: #ffffff;
border: 1px double #869DCA;
}
.contents a.qindexHL:visited {
color: #ffffff;
}
a.el {
font-weight: bold;
}
a.elRef {
}
a.code, a.code:visited {
color: #4665A2;
}
a.codeRef, a.codeRef:visited {
color: #4665A2;
}
/* @end */
dl.el {
margin-left: -1cm;
}
.fragment {
font-family: monospace, fixed;
font-size: 105%;
}
pre.fragment {
border: 1px solid #C4CFE5;
background-color: #FBFCFD;
padding: 4px 6px;
margin: 4px 8px 4px 2px;
overflow: auto;
word-wrap: break-word;
font-size: 9pt;
line-height: 125%;
}
div.ah {
background-color: black;
font-weight: bold;
color: #ffffff;
margin-bottom: 3px;
margin-top: 3px;
padding: 0.2em;
border: solid thin #333;
border-radius: 0.5em;
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
box-shadow: 2px 2px 3px #999;
-webkit-box-shadow: 2px 2px 3px #999;
-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
}
div.groupHeader {
margin-left: 16px;
margin-top: 12px;
font-weight: bold;
}
div.groupText {
margin-left: 16px;
font-style: italic;
}
body {
background-color: white;
color: black;
margin: 0;
}
div.contents {
margin-top: 10px;
margin-left: 8px;
margin-right: 8px;
}
td.indexkey {
background-color: #EBEFF6;
font-weight: bold;
border: 1px solid #C4CFE5;
margin: 2px 0px 2px 0;
padding: 2px 10px;
white-space: nowrap;
vertical-align: top;
}
td.indexvalue {
background-color: #EBEFF6;
border: 1px solid #C4CFE5;
padding: 2px 10px;
margin: 2px 0px;
}
tr.memlist {
background-color: #EEF1F7;
}
p.formulaDsp {
text-align: center;
}
img.formulaDsp {
}
img.formulaInl {
vertical-align: middle;
}
div.center {
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
padding: 0px;
}
div.center img {
border: 0px;
}
address.footer {
text-align: right;
padding-right: 12px;
}
img.footer {
border: 0px;
vertical-align: middle;
}
/* @group Code Colorization */
span.keyword {
color: #008000
}
span.keywordtype {
color: #604020
}
span.keywordflow {
color: #e08000
}
span.comment {
color: #800000
}
span.preprocessor {
color: #806020
}
span.stringliteral {
color: #002080
}
span.charliteral {
color: #008080
}
span.vhdldigit {
color: #ff00ff
}
span.vhdlchar {
color: #000000
}
span.vhdlkeyword {
color: #700070
}
span.vhdllogic {
color: #ff0000
}
/* @end */
/*
.search {
color: #003399;
font-weight: bold;
}
form.search {
margin-bottom: 0px;
margin-top: 0px;
}
input.search {
font-size: 75%;
color: #000080;
font-weight: normal;
background-color: #e8eef2;
}
*/
td.tiny {
font-size: 75%;
}
.dirtab {
padding: 4px;
border-collapse: collapse;
border: 1px solid #A3B4D7;
}
th.dirtab {
background: #EBEFF6;
font-weight: bold;
}
hr {
height: 0px;
border: none;
border-top: 1px solid #4A6AAA;
}
hr.footer {
height: 1px;
}
/* @group Member Descriptions */
table.memberdecls {
border-spacing: 0px;
padding: 0px;
}
.mdescLeft, .mdescRight,
.memItemLeft, .memItemRight,
.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
background-color: #F9FAFC;
border: none;
margin: 4px;
padding: 1px 0 0 8px;
}
.mdescLeft, .mdescRight {
padding: 0px 8px 4px 8px;
color: #555;
}
.memItemLeft, .memItemRight, .memTemplParams {
border-top: 1px solid #C4CFE5;
}
.memItemLeft, .memTemplItemLeft {
white-space: nowrap;
}
.memItemRight {
width: 100%;
}
.memTemplParams {
color: #4665A2;
white-space: nowrap;
}
/* @end */
/* @group Member Details */
/* Styles for detailed member documentation */
.memtemplate {
font-size: 80%;
color: #4665A2;
font-weight: normal;
margin-left: 9px;
}
.memnav {
background-color: #EBEFF6;
border: 1px solid #A3B4D7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
.mempage {
width: 100%;
}
.memitem {
padding: 0;
margin-bottom: 10px;
margin-right: 5px;
}
.memname {
white-space: nowrap;
font-weight: bold;
margin-left: 6px;
}
.memproto, dl.reflist dt {
border-top: 1px solid #A8B8D9;
border-left: 1px solid #A8B8D9;
border-right: 1px solid #A8B8D9;
padding: 6px 0px 6px 0px;
color: #253555;
font-weight: bold;
text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
/* opera specific markup */
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
border-top-right-radius: 8px;
border-top-left-radius: 8px;
/* firefox specific markup */
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
-moz-border-radius-topright: 8px;
-moz-border-radius-topleft: 8px;
/* webkit specific markup */
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-webkit-border-top-right-radius: 8px;
-webkit-border-top-left-radius: 8px;
background-image:url('nav_f.png');
background-repeat:repeat-x;
background-color: #E2E8F2;
}
.memdoc, dl.reflist dd {
border-bottom: 1px solid #A8B8D9;
border-left: 1px solid #A8B8D9;
border-right: 1px solid #A8B8D9;
padding: 2px 5px;
background-color: #FBFCFD;
border-top-width: 0;
/* opera specific markup */
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
/* firefox specific markup */
-moz-border-radius-bottomleft: 8px;
-moz-border-radius-bottomright: 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
/* webkit specific markup */
-webkit-border-bottom-left-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
}
dl.reflist dt {
padding: 5px;
}
dl.reflist dd {
margin: 0px 0px 10px 0px;
padding: 5px;
}
.paramkey {
text-align: right;
}
.paramtype {
white-space: nowrap;
}
.paramname {
color: #602020;
white-space: nowrap;
}
.paramname em {
font-style: normal;
}
.params, .retval, .exception, .tparams {
border-spacing: 6px 2px;
}
.params .paramname, .retval .paramname {
font-weight: bold;
vertical-align: top;
}
.params .paramtype {
font-style: italic;
vertical-align: top;
}
.params .paramdir {
font-family: "courier new",courier,monospace;
vertical-align: top;
}
/* @end */
/* @group Directory (tree) */
/* for the tree view */
.ftvtree {
font-family: sans-serif;
margin: 0px;
}
/* these are for tree view when used as main index */
.directory {
font-size: 9pt;
font-weight: bold;
margin: 5px;
}
.directory h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
/*
The following two styles can be used to replace the root node title
with an image of your choice. Simply uncomment the next two styles,
specify the name of your image and be sure to set 'height' to the
proper pixel height of your image.
*/
/*
.directory h3.swap {
height: 61px;
background-repeat: no-repeat;
background-image: url("yourimage.gif");
}
.directory h3.swap span {
display: none;
}
*/
.directory > h3 {
margin-top: 0;
}
.directory p {
margin: 0px;
white-space: nowrap;
}
.directory div {
display: none;
margin: 0px;
}
.directory img {
vertical-align: -30%;
}
/* these are for tree view when not used as main index */
.directory-alt {
font-size: 100%;
font-weight: bold;
}
.directory-alt h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
.directory-alt > h3 {
margin-top: 0;
}
.directory-alt p {
margin: 0px;
white-space: nowrap;
}
.directory-alt div {
display: none;
margin: 0px;
}
.directory-alt img {
vertical-align: -30%;
}
/* @end */
div.dynheader {
margin-top: 8px;
}
address {
font-style: normal;
color: #2A3D61;
}
table.doxtable {
border-collapse:collapse;
}
table.doxtable td, table.doxtable th {
border: 1px solid #2D4068;
padding: 3px 7px 2px;
}
table.doxtable th {
background-color: #374F7F;
color: #FFFFFF;
font-size: 110%;
padding-bottom: 4px;
padding-top: 5px;
text-align:left;
}
table.fieldtable {
width: 100%;
margin-bottom: 10px;
border: 1px solid #A8B8D9;
border-spacing: 0px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
}
.fieldtable td, .fieldtable th {
padding: 3px 7px 2px;
}
.fieldtable td.fieldtype, .fieldtable td.fieldname {
white-space: nowrap;
border-right: 1px solid #A8B8D9;
border-bottom: 1px solid #A8B8D9;
vertical-align: top;
}
.fieldtable td.fielddoc {
border-bottom: 1px solid #A8B8D9;
width: 100%;
}
.fieldtable tr:last-child td {
border-bottom: none;
}
.fieldtable th {
background-image:url('nav_f.png');
background-repeat:repeat-x;
background-color: #E2E8F2;
font-size: 90%;
color: #253555;
padding-bottom: 4px;
padding-top: 5px;
text-align:left;
-moz-border-radius-topleft: 4px;
-moz-border-radius-topright: 4px;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom: 1px solid #A8B8D9;
}
.tabsearch {
top: 0px;
left: 10px;
height: 36px;
background-image: url('tab_b.png');
z-index: 101;
overflow: hidden;
font-size: 13px;
}
.navpath ul
{
font-size: 11px;
background-image:url('tab_b.png');
background-repeat:repeat-x;
height:30px;
line-height:30px;
color:#8AA0CC;
border:solid 1px #C2CDE4;
overflow:hidden;
margin:0px;
padding:0px;
}
.navpath li
{
list-style-type:none;
float:left;
padding-left:10px;
padding-right:15px;
background-image:url('bc_s.png');
background-repeat:no-repeat;
background-position:right;
color:#364D7C;
}
.navpath li.navelem a
{
height:32px;
display:block;
text-decoration: none;
outline: none;
}
.navpath li.navelem a:hover
{
color:#6884BD;
}
.navpath li.footer
{
list-style-type:none;
float:right;
padding-left:10px;
padding-right:15px;
background-image:none;
background-repeat:no-repeat;
background-position:right;
color:#364D7C;
font-size: 8pt;
}
div.summary
{
float: right;
font-size: 8pt;
padding-right: 5px;
width: 50%;
text-align: right;
}
div.summary a
{
white-space: nowrap;
}
div.ingroups
{
margin-left: 5px;
font-size: 8pt;
padding-left: 5px;
width: 50%;
text-align: left;
}
div.ingroups a
{
white-space: nowrap;
}
div.header
{
background-image:url('nav_h.png');
background-repeat:repeat-x;
background-color: #F9FAFC;
margin: 0px;
border-bottom: 1px solid #C4CFE5;
}
div.headertitle
{
padding: 5px 5px 5px 7px;
}
dl
{
padding: 0 0 0 10px;
}
dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
{
border-left:4px solid;
padding: 0 0 0 6px;
}
dl.note
{
border-color: #D0C000;
}
dl.warning, dl.attention
{
border-color: #FF0000;
}
dl.pre, dl.post, dl.invariant
{
border-color: #00D000;
}
dl.deprecated
{
border-color: #505050;
}
dl.todo
{
border-color: #00C0E0;
}
dl.test
{
border-color: #3030E0;
}
dl.bug
{
border-color: #C08050;
}
#projectlogo
{
text-align: center;
vertical-align: bottom;
border-collapse: separate;
}
#projectlogo img
{
border: 0px none;
}
#projectname
{
font: 300% Tahoma, Arial,sans-serif;
margin: 0px;
padding: 2px 0px;
}
#projectbrief
{
font: 120% Tahoma, Arial,sans-serif;
margin: 0px;
padding: 0px;
}
#projectnumber
{
font: 50% Tahoma, Arial,sans-serif;
margin: 0px;
padding: 0px;
}
#titlearea
{
padding: 0px;
margin: 0px;
width: 100%;
border-bottom: 1px solid #5373B4;
}
.image
{
text-align: center;
}
.dotgraph
{
text-align: center;
}
.mscgraph
{
text-align: center;
}
.caption
{
font-weight: bold;
}
div.zoom
{
border: 1px solid #90A5CE;
}
dl.citelist {
margin-bottom:50px;
}
dl.citelist dt {
color:#334975;
float:left;
font-weight:bold;
margin-right:10px;
padding:5px;
}
dl.citelist dd {
margin:2px 0;
padding:5px 0;
}
@media print
{
#top { display: none; }
#side-nav { display: none; }
#nav-path { display: none; }
body { overflow:visible; }
h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
.summary { display: none; }
.memitem { page-break-inside: avoid; }
#doc-content
{
margin-left:0 !important;
height:auto !important;
width:auto !important;
overflow:inherit;
display:inline;
}
pre.fragment
{
overflow: visible;
text-wrap: unrestricted;
white-space: -moz-pre-wrap; /* Moz */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 */
word-wrap: break-word; /* IE 5.5+ */
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

@ -0,0 +1,72 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: File List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li class="current"><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">File List</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here is a list of all files with brief descriptions:</div><table>
<tr><td class="indexkey"><a class="el" href="_t_m_c26_x_stepper_8cpp.html">TMC26XStepper.cpp</a> <a href="_t_m_c26_x_stepper_8cpp_source.html">[code]</a></td><td class="indexvalue"></td></tr>
<tr><td class="indexkey"><a class="el" href="_t_m_c26_x_stepper_8h.html">TMC26XStepper.h</a> <a href="_t_m_c26_x_stepper_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
</table>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

@ -0,0 +1,261 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li class="current"><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="functions.html"><span>All</span></a></li>
<li><a href="functions_func.html"><span>Functions</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="#index_d"><span>d</span></a></li>
<li><a href="#index_g"><span>g</span></a></li>
<li><a href="#index_i"><span>i</span></a></li>
<li><a href="#index_m"><span>m</span></a></li>
<li><a href="#index_r"><span>r</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
<li><a href="#index_t"><span>t</span></a></li>
<li><a href="#index_u"><span>u</span></a></li>
<li><a href="#index_v"><span>v</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<div class="textblock">Here is a list of all class members with links to the classes they belong to:</div>
<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
<li>debugLastStatus()
: <a class="el" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_g"></a>- g -</h3><ul>
<li>getCoolStepCurrentIncrementSize()
: <a class="el" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883">TMC26XStepper</a>
</li>
<li>getCoolStepLowerCurrentLimit()
: <a class="el" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c">TMC26XStepper</a>
</li>
<li>getCoolStepLowerSgThreshold()
: <a class="el" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8">TMC26XStepper</a>
</li>
<li>getCoolStepNumberOfSGReadings()
: <a class="el" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46">TMC26XStepper</a>
</li>
<li>getCoolStepUpperSgThreshold()
: <a class="el" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f">TMC26XStepper</a>
</li>
<li>getCurrent()
: <a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f">TMC26XStepper</a>
</li>
<li>getCurrentCSReading()
: <a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1">TMC26XStepper</a>
</li>
<li>getCurrentCurrent()
: <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7">TMC26XStepper</a>
</li>
<li>getCurrentStallGuardReading()
: <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e">TMC26XStepper</a>
</li>
<li>getMicrosteps()
: <a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3">TMC26XStepper</a>
</li>
<li>getMotorPosition()
: <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125">TMC26XStepper</a>
</li>
<li>getOverTemperature()
: <a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7">TMC26XStepper</a>
</li>
<li>getResistor()
: <a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e">TMC26XStepper</a>
</li>
<li>getSpeed()
: <a class="el" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29">TMC26XStepper</a>
</li>
<li>getStallGuardFilter()
: <a class="el" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a">TMC26XStepper</a>
</li>
<li>getStallGuardThreshold()
: <a class="el" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def">TMC26XStepper</a>
</li>
<li>getStepsLeft()
: <a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
<li>isCoolStepEnabled()
: <a class="el" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d">TMC26XStepper</a>
</li>
<li>isCurrentScalingHalfed()
: <a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905">TMC26XStepper</a>
</li>
<li>isEnabled()
: <a class="el" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6">TMC26XStepper</a>
</li>
<li>isMoving()
: <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e">TMC26XStepper</a>
</li>
<li>isOpenLoadA()
: <a class="el" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c">TMC26XStepper</a>
</li>
<li>isOpenLoadB()
: <a class="el" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303">TMC26XStepper</a>
</li>
<li>isShortToGroundA()
: <a class="el" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf">TMC26XStepper</a>
</li>
<li>isShortToGroundB()
: <a class="el" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b">TMC26XStepper</a>
</li>
<li>isStallGuardOverThreshold()
: <a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41">TMC26XStepper</a>
</li>
<li>isStallGuardReached()
: <a class="el" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7">TMC26XStepper</a>
</li>
<li>isStandStill()
: <a class="el" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
<li>move()
: <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
<li>readStatus()
: <a class="el" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>setConstantOffTimeChopper()
: <a class="el" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649">TMC26XStepper</a>
</li>
<li>setCoolStepConfiguration()
: <a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e">TMC26XStepper</a>
</li>
<li>setCoolStepEnabled()
: <a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157">TMC26XStepper</a>
</li>
<li>setCurrent()
: <a class="el" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2">TMC26XStepper</a>
</li>
<li>setEnabled()
: <a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305">TMC26XStepper</a>
</li>
<li>setMicrosteps()
: <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0">TMC26XStepper</a>
</li>
<li>setRandomOffTime()
: <a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a">TMC26XStepper</a>
</li>
<li>setSpeed()
: <a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd">TMC26XStepper</a>
</li>
<li>setSpreadCycleChopper()
: <a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2">TMC26XStepper</a>
</li>
<li>setStallGuardThreshold()
: <a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a">TMC26XStepper</a>
</li>
<li>start()
: <a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7">TMC26XStepper</a>
</li>
<li>step()
: <a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d">TMC26XStepper</a>
</li>
<li>stop()
: <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
<li>TMC26XStepper()
: <a class="el" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_u"></a>- u -</h3><ul>
<li>un_start()
: <a class="el" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
<li>version()
: <a class="el" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215">TMC26XStepper</a>
</li>
</ul>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

@ -0,0 +1,261 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: Class Members - Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li class="current"><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li><a href="functions.html"><span>All</span></a></li>
<li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="#index_d"><span>d</span></a></li>
<li><a href="#index_g"><span>g</span></a></li>
<li><a href="#index_i"><span>i</span></a></li>
<li><a href="#index_m"><span>m</span></a></li>
<li><a href="#index_r"><span>r</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
<li><a href="#index_t"><span>t</span></a></li>
<li><a href="#index_u"><span>u</span></a></li>
<li><a href="#index_v"><span>v</span></a></li>
</ul>
</div>
</div>
<div class="contents">
&#160;
<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
<li>debugLastStatus()
: <a class="el" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_g"></a>- g -</h3><ul>
<li>getCoolStepCurrentIncrementSize()
: <a class="el" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883">TMC26XStepper</a>
</li>
<li>getCoolStepLowerCurrentLimit()
: <a class="el" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c">TMC26XStepper</a>
</li>
<li>getCoolStepLowerSgThreshold()
: <a class="el" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8">TMC26XStepper</a>
</li>
<li>getCoolStepNumberOfSGReadings()
: <a class="el" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46">TMC26XStepper</a>
</li>
<li>getCoolStepUpperSgThreshold()
: <a class="el" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f">TMC26XStepper</a>
</li>
<li>getCurrent()
: <a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f">TMC26XStepper</a>
</li>
<li>getCurrentCSReading()
: <a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1">TMC26XStepper</a>
</li>
<li>getCurrentCurrent()
: <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7">TMC26XStepper</a>
</li>
<li>getCurrentStallGuardReading()
: <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e">TMC26XStepper</a>
</li>
<li>getMicrosteps()
: <a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3">TMC26XStepper</a>
</li>
<li>getMotorPosition()
: <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125">TMC26XStepper</a>
</li>
<li>getOverTemperature()
: <a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7">TMC26XStepper</a>
</li>
<li>getResistor()
: <a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e">TMC26XStepper</a>
</li>
<li>getSpeed()
: <a class="el" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29">TMC26XStepper</a>
</li>
<li>getStallGuardFilter()
: <a class="el" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a">TMC26XStepper</a>
</li>
<li>getStallGuardThreshold()
: <a class="el" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def">TMC26XStepper</a>
</li>
<li>getStepsLeft()
: <a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
<li>isCoolStepEnabled()
: <a class="el" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d">TMC26XStepper</a>
</li>
<li>isCurrentScalingHalfed()
: <a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905">TMC26XStepper</a>
</li>
<li>isEnabled()
: <a class="el" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6">TMC26XStepper</a>
</li>
<li>isMoving()
: <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e">TMC26XStepper</a>
</li>
<li>isOpenLoadA()
: <a class="el" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c">TMC26XStepper</a>
</li>
<li>isOpenLoadB()
: <a class="el" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303">TMC26XStepper</a>
</li>
<li>isShortToGroundA()
: <a class="el" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf">TMC26XStepper</a>
</li>
<li>isShortToGroundB()
: <a class="el" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b">TMC26XStepper</a>
</li>
<li>isStallGuardOverThreshold()
: <a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41">TMC26XStepper</a>
</li>
<li>isStallGuardReached()
: <a class="el" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7">TMC26XStepper</a>
</li>
<li>isStandStill()
: <a class="el" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
<li>move()
: <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
<li>readStatus()
: <a class="el" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>setConstantOffTimeChopper()
: <a class="el" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649">TMC26XStepper</a>
</li>
<li>setCoolStepConfiguration()
: <a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e">TMC26XStepper</a>
</li>
<li>setCoolStepEnabled()
: <a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157">TMC26XStepper</a>
</li>
<li>setCurrent()
: <a class="el" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2">TMC26XStepper</a>
</li>
<li>setEnabled()
: <a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305">TMC26XStepper</a>
</li>
<li>setMicrosteps()
: <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0">TMC26XStepper</a>
</li>
<li>setRandomOffTime()
: <a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a">TMC26XStepper</a>
</li>
<li>setSpeed()
: <a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd">TMC26XStepper</a>
</li>
<li>setSpreadCycleChopper()
: <a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2">TMC26XStepper</a>
</li>
<li>setStallGuardThreshold()
: <a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a">TMC26XStepper</a>
</li>
<li>start()
: <a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7">TMC26XStepper</a>
</li>
<li>step()
: <a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d">TMC26XStepper</a>
</li>
<li>stop()
: <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
<li>TMC26XStepper()
: <a class="el" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_u"></a>- u -</h3><ul>
<li>un_start()
: <a class="el" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5">TMC26XStepper</a>
</li>
</ul>
<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
<li>version()
: <a class="el" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215">TMC26XStepper</a>
</li>
</ul>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

@ -0,0 +1,289 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: File Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li class="current"><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="globals.html"><span>All</span></a></li>
<li><a href="globals_defs.html"><span>Defines</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="#index_b"><span>b</span></a></li>
<li><a href="#index_c"><span>c</span></a></li>
<li><a href="#index_d"><span>d</span></a></li>
<li><a href="#index_h"><span>h</span></a></li>
<li><a href="#index_i"><span>i</span></a></li>
<li><a href="#index_m"><span>m</span></a></li>
<li><a href="#index_r"><span>r</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
<li><a href="#index_t"><span>t</span></a></li>
<li><a href="#index_v"><span>v</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<div class="textblock">Here is a list of all file members with links to the files they belong to:</div>
<h3><a class="anchor" id="index_b"></a>- b -</h3><ul>
<li>BLANK_TIMING_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a42cb2ce84258587d514ec3268548ba89">TMC26XStepper.cpp</a>
</li>
<li>BLANK_TIMING_SHIFT
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#abdac78f7f2c506972265a8e5883e1eae">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
<li>CHOPPER_CONFIG_REGISTER
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a70a540d1090b989b8600b5e4776659fe">TMC26XStepper.cpp</a>
</li>
<li>CHOPPER_MODE_STANDARD
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a57418a67ff726d540b813230bca1d536">TMC26XStepper.cpp</a>
</li>
<li>CHOPPER_MODE_T_OFF_FAST_DECAY
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aaf1b564ced7de8ff3245c964e3775826">TMC26XStepper.cpp</a>
</li>
<li>COOL_STEP_HALF_CS_LIMIT
: <a class="el" href="_t_m_c26_x_stepper_8h.html#a28b1774bd4aa854fb5e4b6dc7db96ecb">TMC26XStepper.h</a>
</li>
<li>COOL_STEP_QUARTDER_CS_LIMIT
: <a class="el" href="_t_m_c26_x_stepper_8h.html#a1a4db5eafd0a9247677153cb4c8b7d54">TMC26XStepper.h</a>
</li>
<li>COOL_STEP_REGISTER
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab9828bfaa075a0a8647c709136016317">TMC26XStepper.cpp</a>
</li>
<li>CURRENT_DOWN_STEP_SPEED_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#adbe13a0464355e42fbe786ca5f58ed8d">TMC26XStepper.cpp</a>
</li>
<li>CURRENT_SCALING_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a99dcb8c6d98b0b54c23699a3f90450e4">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
<li>DEFAULT_MICROSTEPPING_VALUE
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a6560b3471273e99e280ba795e3469ede">TMC26XStepper.cpp</a>
</li>
<li>DOUBLE_EDGE_STEP
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a770601bf0153e4bc639b9c3005b15af7">TMC26XStepper.cpp</a>
</li>
<li>DRIVER_CONFIG_REGISTER
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#af35f569d42ea3b1d634901a3b6a908ee">TMC26XStepper.cpp</a>
</li>
<li>DRIVER_CONTROL_REGISTER
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a108f18bf4a30a0e0f0991ac0e4ce0579">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
<li>HYSTERESIS_DECREMENT_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a424c248097b38c1e29e6a58ad48e6bd9">TMC26XStepper.cpp</a>
</li>
<li>HYSTERESIS_DECREMENT_SHIFT
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a36e554a87785ce6ba998b79aae9e74e0">TMC26XStepper.cpp</a>
</li>
<li>HYSTERESIS_LOW_SHIFT
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a38ce0bb0fa20db28351ac9167f28db98">TMC26XStepper.cpp</a>
</li>
<li>HYSTERESIS_LOW_VALUE_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ad9d2302f6d61cd84a612a2e2bcdeb56e">TMC26XStepper.cpp</a>
</li>
<li>HYSTERESIS_START_VALUE_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a0de4e98b412dced62c3a4452b7483af3">TMC26XStepper.cpp</a>
</li>
<li>HYSTERESIS_START_VALUE_SHIFT
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac2c1c939256126e605396c4aaee3c804">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
<li>INITIAL_MICROSTEPPING
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a54a6d12e96d851361974b10614a00e45">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
<li>MICROSTEPPING_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8f5cb0c066109ffb18cefc0e85ee1d1b">TMC26XStepper.cpp</a>
</li>
<li>MINIMUM_CURRENT_FOURTH
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8a261a77d198b85f6dd8416387b354b3">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
<li>RANDOM_TOFF_TIME
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a64520580cffd416668f3b91bd60f84e1">TMC26XStepper.cpp</a>
</li>
<li>READ_MICROSTEP_POSTION
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a143b7757272f07866d9655bde8303d9a">TMC26XStepper.cpp</a>
</li>
<li>READ_SELECTION_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a88a4b45fa6385eba8aa4f0342334b832">TMC26XStepper.cpp</a>
</li>
<li>READ_STALL_GUARD_AND_COOL_STEP
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aef62b7fdcbac0b33b2d6e9cea4b5f9b2">TMC26XStepper.cpp</a>
</li>
<li>READ_STALL_GUARD_READING
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac1bd4da94fab7ce1049be2f866211819">TMC26XStepper.cpp</a>
</li>
<li>READOUT_VALUE_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a5c3d76da63f585e37813c32be2e11ab7">TMC26XStepper.cpp</a>
</li>
<li>REGISTER_BIT_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a3b02ee1f518b0c90c16488f937abd443">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>SE_CURRENT_STEP_WIDTH_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aba6c07e5672e34e618bb3a550ab0d2bc">TMC26XStepper.cpp</a>
</li>
<li>SE_MAX_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac8f748bf735c447dbed7dd4c7b631a87">TMC26XStepper.cpp</a>
</li>
<li>SE_MIN_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae1862dfb958c03698b0abd95fda033ea">TMC26XStepper.cpp</a>
</li>
<li>STALL_GUARD2_LOAD_MEASURE_REGISTER
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a478d9bde09a6528eef6af6ffeeb6caba">TMC26XStepper.cpp</a>
</li>
<li>STALL_GUARD_CONFIG_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a99ac04f0615556fc13c0c9f3e1c1b49d">TMC26XStepper.cpp</a>
</li>
<li>STALL_GUARD_FILTER_ENABLED
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#afdbbefabd0c29c4b6e403c4663d0f0be">TMC26XStepper.cpp</a>
</li>
<li>STALL_GUARD_TRESHHOLD_VALUE_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae631457932894a974334892704550ecc">TMC26XStepper.cpp</a>
</li>
<li>STALL_GUARD_VALUE_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a6a1cb1fd61cf7c570f94376fa11fe55b">TMC26XStepper.cpp</a>
</li>
<li>STATUS_OPEN_LOAD_A
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae9cbbe5af7188e6bff8fe412f8e42f59">TMC26XStepper.cpp</a>
</li>
<li>STATUS_OPEN_LOAD_B
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab29dc5cd6c6c4e5bf99e71bd563e1be1">TMC26XStepper.cpp</a>
</li>
<li>STATUS_OVER_TEMPERATURE_SHUTDOWN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#adbb23d2f055c9eab55eac29d1a75deb4">TMC26XStepper.cpp</a>
</li>
<li>STATUS_OVER_TEMPERATURE_WARNING
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa317fd77f2f26fdfbfd331e21d9069e8">TMC26XStepper.cpp</a>
</li>
<li>STATUS_SHORT_TO_GROUND_A
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8e03041302a092174fa33b3cf837dca2">TMC26XStepper.cpp</a>
</li>
<li>STATUS_SHORT_TO_GROUND_B
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a903c3eba99695a32c6736463dcfd93ae">TMC26XStepper.cpp</a>
</li>
<li>STATUS_STALL_GUARD_STATUS
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa09ef662fd19bf2d063d6bd0f48eca14">TMC26XStepper.cpp</a>
</li>
<li>STATUS_STAND_STILL
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab96ed1635faee6650e9cce73598a2773">TMC26XStepper.cpp</a>
</li>
<li>STEP_INTERPOLATION
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa64245f223209654c60588e4558e0bab">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
<li>T_OFF_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa4e49237f2671e7f28aa34ae0e89da8d">TMC26XStepper.cpp</a>
</li>
<li>T_OFF_TIMING_PATERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a7659d842c803e47ba911a2a6e26327f3">TMC26XStepper.cpp</a>
</li>
<li>TMC26X_OVERTEMPERATURE_PREWARING
: <a class="el" href="_t_m_c26_x_stepper_8h.html#add42eee34f674f92c19bcd5266d2445f">TMC26XStepper.h</a>
</li>
<li>TMC26X_OVERTEMPERATURE_SHUTDOWN
: <a class="el" href="_t_m_c26_x_stepper_8h.html#adae814ce848677abd87758c7ac79a436">TMC26XStepper.h</a>
</li>
<li>TMC26X_READOUT_CURRENT
: <a class="el" href="_t_m_c26_x_stepper_8h.html#a01760ad15e3846536526a990efe47094">TMC26XStepper.h</a>
</li>
<li>TMC26X_READOUT_POSITION
: <a class="el" href="_t_m_c26_x_stepper_8h.html#aff05d4a47ef8821322ccc2a20785fbee">TMC26XStepper.h</a>
</li>
<li>TMC26X_READOUT_STALLGUARD
: <a class="el" href="_t_m_c26_x_stepper_8h.html#ac864ff8886123039c7d2d3c617f7ef87">TMC26XStepper.h</a>
</li>
</ul>
<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
<li>VSENSE
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a4fb1c008e2ff76eee9362600eed112e1">TMC26XStepper.cpp</a>
</li>
</ul>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

@ -0,0 +1,289 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: File Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li class="current"><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li><a href="globals.html"><span>All</span></a></li>
<li class="current"><a href="globals_defs.html"><span>Defines</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="#index_b"><span>b</span></a></li>
<li><a href="#index_c"><span>c</span></a></li>
<li><a href="#index_d"><span>d</span></a></li>
<li><a href="#index_h"><span>h</span></a></li>
<li><a href="#index_i"><span>i</span></a></li>
<li><a href="#index_m"><span>m</span></a></li>
<li><a href="#index_r"><span>r</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
<li><a href="#index_t"><span>t</span></a></li>
<li><a href="#index_v"><span>v</span></a></li>
</ul>
</div>
</div>
<div class="contents">
&#160;
<h3><a class="anchor" id="index_b"></a>- b -</h3><ul>
<li>BLANK_TIMING_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a42cb2ce84258587d514ec3268548ba89">TMC26XStepper.cpp</a>
</li>
<li>BLANK_TIMING_SHIFT
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#abdac78f7f2c506972265a8e5883e1eae">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
<li>CHOPPER_CONFIG_REGISTER
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a70a540d1090b989b8600b5e4776659fe">TMC26XStepper.cpp</a>
</li>
<li>CHOPPER_MODE_STANDARD
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a57418a67ff726d540b813230bca1d536">TMC26XStepper.cpp</a>
</li>
<li>CHOPPER_MODE_T_OFF_FAST_DECAY
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aaf1b564ced7de8ff3245c964e3775826">TMC26XStepper.cpp</a>
</li>
<li>COOL_STEP_HALF_CS_LIMIT
: <a class="el" href="_t_m_c26_x_stepper_8h.html#a28b1774bd4aa854fb5e4b6dc7db96ecb">TMC26XStepper.h</a>
</li>
<li>COOL_STEP_QUARTDER_CS_LIMIT
: <a class="el" href="_t_m_c26_x_stepper_8h.html#a1a4db5eafd0a9247677153cb4c8b7d54">TMC26XStepper.h</a>
</li>
<li>COOL_STEP_REGISTER
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab9828bfaa075a0a8647c709136016317">TMC26XStepper.cpp</a>
</li>
<li>CURRENT_DOWN_STEP_SPEED_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#adbe13a0464355e42fbe786ca5f58ed8d">TMC26XStepper.cpp</a>
</li>
<li>CURRENT_SCALING_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a99dcb8c6d98b0b54c23699a3f90450e4">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
<li>DEFAULT_MICROSTEPPING_VALUE
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a6560b3471273e99e280ba795e3469ede">TMC26XStepper.cpp</a>
</li>
<li>DOUBLE_EDGE_STEP
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a770601bf0153e4bc639b9c3005b15af7">TMC26XStepper.cpp</a>
</li>
<li>DRIVER_CONFIG_REGISTER
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#af35f569d42ea3b1d634901a3b6a908ee">TMC26XStepper.cpp</a>
</li>
<li>DRIVER_CONTROL_REGISTER
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a108f18bf4a30a0e0f0991ac0e4ce0579">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
<li>HYSTERESIS_DECREMENT_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a424c248097b38c1e29e6a58ad48e6bd9">TMC26XStepper.cpp</a>
</li>
<li>HYSTERESIS_DECREMENT_SHIFT
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a36e554a87785ce6ba998b79aae9e74e0">TMC26XStepper.cpp</a>
</li>
<li>HYSTERESIS_LOW_SHIFT
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a38ce0bb0fa20db28351ac9167f28db98">TMC26XStepper.cpp</a>
</li>
<li>HYSTERESIS_LOW_VALUE_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ad9d2302f6d61cd84a612a2e2bcdeb56e">TMC26XStepper.cpp</a>
</li>
<li>HYSTERESIS_START_VALUE_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a0de4e98b412dced62c3a4452b7483af3">TMC26XStepper.cpp</a>
</li>
<li>HYSTERESIS_START_VALUE_SHIFT
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac2c1c939256126e605396c4aaee3c804">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
<li>INITIAL_MICROSTEPPING
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a54a6d12e96d851361974b10614a00e45">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
<li>MICROSTEPPING_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8f5cb0c066109ffb18cefc0e85ee1d1b">TMC26XStepper.cpp</a>
</li>
<li>MINIMUM_CURRENT_FOURTH
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8a261a77d198b85f6dd8416387b354b3">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
<li>RANDOM_TOFF_TIME
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a64520580cffd416668f3b91bd60f84e1">TMC26XStepper.cpp</a>
</li>
<li>READ_MICROSTEP_POSTION
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a143b7757272f07866d9655bde8303d9a">TMC26XStepper.cpp</a>
</li>
<li>READ_SELECTION_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a88a4b45fa6385eba8aa4f0342334b832">TMC26XStepper.cpp</a>
</li>
<li>READ_STALL_GUARD_AND_COOL_STEP
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aef62b7fdcbac0b33b2d6e9cea4b5f9b2">TMC26XStepper.cpp</a>
</li>
<li>READ_STALL_GUARD_READING
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac1bd4da94fab7ce1049be2f866211819">TMC26XStepper.cpp</a>
</li>
<li>READOUT_VALUE_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a5c3d76da63f585e37813c32be2e11ab7">TMC26XStepper.cpp</a>
</li>
<li>REGISTER_BIT_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a3b02ee1f518b0c90c16488f937abd443">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>SE_CURRENT_STEP_WIDTH_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aba6c07e5672e34e618bb3a550ab0d2bc">TMC26XStepper.cpp</a>
</li>
<li>SE_MAX_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ac8f748bf735c447dbed7dd4c7b631a87">TMC26XStepper.cpp</a>
</li>
<li>SE_MIN_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae1862dfb958c03698b0abd95fda033ea">TMC26XStepper.cpp</a>
</li>
<li>STALL_GUARD2_LOAD_MEASURE_REGISTER
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a478d9bde09a6528eef6af6ffeeb6caba">TMC26XStepper.cpp</a>
</li>
<li>STALL_GUARD_CONFIG_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a99ac04f0615556fc13c0c9f3e1c1b49d">TMC26XStepper.cpp</a>
</li>
<li>STALL_GUARD_FILTER_ENABLED
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#afdbbefabd0c29c4b6e403c4663d0f0be">TMC26XStepper.cpp</a>
</li>
<li>STALL_GUARD_TRESHHOLD_VALUE_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae631457932894a974334892704550ecc">TMC26XStepper.cpp</a>
</li>
<li>STALL_GUARD_VALUE_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a6a1cb1fd61cf7c570f94376fa11fe55b">TMC26XStepper.cpp</a>
</li>
<li>STATUS_OPEN_LOAD_A
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ae9cbbe5af7188e6bff8fe412f8e42f59">TMC26XStepper.cpp</a>
</li>
<li>STATUS_OPEN_LOAD_B
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab29dc5cd6c6c4e5bf99e71bd563e1be1">TMC26XStepper.cpp</a>
</li>
<li>STATUS_OVER_TEMPERATURE_SHUTDOWN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#adbb23d2f055c9eab55eac29d1a75deb4">TMC26XStepper.cpp</a>
</li>
<li>STATUS_OVER_TEMPERATURE_WARNING
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa317fd77f2f26fdfbfd331e21d9069e8">TMC26XStepper.cpp</a>
</li>
<li>STATUS_SHORT_TO_GROUND_A
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a8e03041302a092174fa33b3cf837dca2">TMC26XStepper.cpp</a>
</li>
<li>STATUS_SHORT_TO_GROUND_B
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a903c3eba99695a32c6736463dcfd93ae">TMC26XStepper.cpp</a>
</li>
<li>STATUS_STALL_GUARD_STATUS
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa09ef662fd19bf2d063d6bd0f48eca14">TMC26XStepper.cpp</a>
</li>
<li>STATUS_STAND_STILL
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#ab96ed1635faee6650e9cce73598a2773">TMC26XStepper.cpp</a>
</li>
<li>STEP_INTERPOLATION
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa64245f223209654c60588e4558e0bab">TMC26XStepper.cpp</a>
</li>
</ul>
<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
<li>T_OFF_PATTERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#aa4e49237f2671e7f28aa34ae0e89da8d">TMC26XStepper.cpp</a>
</li>
<li>T_OFF_TIMING_PATERN
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a7659d842c803e47ba911a2a6e26327f3">TMC26XStepper.cpp</a>
</li>
<li>TMC26X_OVERTEMPERATURE_PREWARING
: <a class="el" href="_t_m_c26_x_stepper_8h.html#add42eee34f674f92c19bcd5266d2445f">TMC26XStepper.h</a>
</li>
<li>TMC26X_OVERTEMPERATURE_SHUTDOWN
: <a class="el" href="_t_m_c26_x_stepper_8h.html#adae814ce848677abd87758c7ac79a436">TMC26XStepper.h</a>
</li>
<li>TMC26X_READOUT_CURRENT
: <a class="el" href="_t_m_c26_x_stepper_8h.html#a01760ad15e3846536526a990efe47094">TMC26XStepper.h</a>
</li>
<li>TMC26X_READOUT_POSITION
: <a class="el" href="_t_m_c26_x_stepper_8h.html#aff05d4a47ef8821322ccc2a20785fbee">TMC26XStepper.h</a>
</li>
<li>TMC26X_READOUT_STALLGUARD
: <a class="el" href="_t_m_c26_x_stepper_8h.html#ac864ff8886123039c7d2d3c617f7ef87">TMC26XStepper.h</a>
</li>
</ul>
<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
<li>VSENSE
: <a class="el" href="_t_m_c26_x_stepper_8cpp.html#a4fb1c008e2ff76eee9362600eed112e1">TMC26XStepper.cpp</a>
</li>
</ul>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

@ -0,0 +1,72 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: TMC 260, 261, 262 Stepper Driver for Arduino</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">TMC 260, 261, 262 Stepper Driver for Arduino </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><dl class="author"><dt><b>Author:</b></dt><dd>Interactive MAtter, MArcus Nowotny, <a href="mailto:marcus@interactive-matter.eu">marcus@interactive-matter.eu</a> </dd></dl>
<h2><a class="anchor" id="HOWTO"></a>
How to use the driver</h2>
<p>Here we go with aminial how to description</p>
<h2><a class="anchor" id="COPYRIGHT_NOTIFICATION"></a>
COPYRIGHT NOTIFICATION</h2>
<dl class="user"><dt><b>(c) 2011 Interactive MAtter, Marcus Nowotny </b></dt><dd></dd></dl>
<dl class="user"><dt><b></b></dt><dd>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</dd></dl>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </p>
</div></div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

File diff suppressed because one or more lines are too long

@ -0,0 +1,68 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: mainpage.dox File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">mainpage.dox File Reference</div> </div>
</div><!--header-->
<div class="contents">
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

@ -0,0 +1,59 @@
.tabs, .tabs2, .tabs3 {
background-image: url('tab_b.png');
width: 100%;
z-index: 101;
font-size: 13px;
}
.tabs2 {
font-size: 10px;
}
.tabs3 {
font-size: 9px;
}
.tablist {
margin: 0;
padding: 0;
display: table;
}
.tablist li {
float: left;
display: table-cell;
background-image: url('tab_b.png');
line-height: 36px;
list-style: none;
}
.tablist a {
display: block;
padding: 0 20px;
font-weight: bold;
background-image:url('tab_s.png');
background-repeat:no-repeat;
background-position:right;
color: #283A5D;
text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
text-decoration: none;
outline: none;
}
.tabs3 .tablist a {
padding: 0 10px;
}
.tablist a:hover {
background-image: url('tab_h.png');
background-repeat:repeat-x;
color: #fff;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
text-decoration: none;
}
.tablist li.current a {
background-image: url('tab_a.png');
background-repeat:repeat-x;
color: #fff;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
}

@ -0,0 +1,82 @@
/*
TMC26XExample.ino - - TMC26X Stepper library Example for Wiring/Arduino
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <SPI.h>
#include <TMC26XStepper.h>
//we have a stepper motor with 200 steps per rotation, CS pin 2, dir pin 6, step pin 7 and a current of 300mA
TMC26XStepper tmc26XStepper = TMC26XStepper(200,2,6,7,700);
int curr_step;
int speed = 0;
int speedDirection = 100;
int maxSpeed = 1000;
void setup() {
Serial.begin(9600);
Serial.println("==============================");
Serial.println("TMC26X Stepper Driver Demo App");
Serial.println("==============================");
//set this according to you stepper
Serial.println("Configuring stepper driver");
//char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement
tmc26XStepper.setSpreadCycleChopper(2,24,8,6,0);
tmc26XStepper.setRandomOffTime(0);
tmc26XStepper.setMicrosteps(32);
tmc26XStepper.setStallGuardThreshold(4,0);
Serial.println("config finished, starting");
tmc26XStepper.start();
Serial.println("started");
}
void loop() {
if (!tmc26XStepper.isMoving()) {
speed+=speedDirection;
if (speed>maxSpeed) {
speed = maxSpeed;
speedDirection = -speedDirection;
} else if (speed<0) {
speedDirection = -speedDirection;
speed=speedDirection;
}
//setting the speed
Serial.print("setting speed to ");
Serial.println(speed);
tmc26XStepper.setSpeed(speed);
//we want some kind of constant running time - so the length is just a product of speed
Serial.print("Going ");
Serial.print(10*speed);
Serial.println(" steps");
tmc26XStepper.step(10*speed);
} else {
//we put out the status every 100 steps
if (tmc26XStepper.getStepsLeft()%100==0) {
Serial.print("Stall Guard: ");
Serial.println(tmc26XStepper.getCurrentStallGuardReading());
}
}
tmc26XStepper.move();
}

@ -0,0 +1,176 @@
/*
TMC26XMotorTest.ino - - TMC26X Stepper library tester for Wiring/Arduino
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
unsigned int motor_counter = 0;
unsigned char motor_moved = 0;
int sgThreshold = 4;
int sgFilter = 0;
int direction = 1;
unsigned int lower_SG_threshold = 0;
unsigned int upper_SG_threshold = 0;
unsigned char number_of_SG_readings=0;
unsigned char current_increment_step_size=0;
unsigned char lower_current_limit=0;
char chopperMode = 0; //0 for spread, 1 for constant off
char t_off = 2;
char t_blank = 24;
char h_start = 8;
char h_end = 6;
char h_decrement = 0;
void startMotor() {
Serial.println(F("Configuring stepper driver"));
//char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement
tmc26XStepper.setSpreadCycleChopper(t_off,t_blank,h_start,h_end,h_decrement);
tmc26XStepper.setRandomOffTime(0);
tmc26XStepper.setMicrosteps(32);
tmc26XStepper.setStallGuardThreshold(sgThreshold,sgFilter);
// Serial.println("config finished, starting");
digitalWrite(ENABLE_PIN,LOW);
tmc26XStepper.start();
tmc26XStepper.setSpeed(10);
TCNT2=setupTimer2(10000);
sei();
}
void runMotor() {
if (running && !tmc26XStepper.isMoving()) {
tmc26XStepper.step(direction*10000);
Serial.println("run");
}
if (!running & tmc26XStepper.isMoving()) {
tmc26XStepper.stop();
Serial.println("stop");
}
}
void setSpeed(unsigned int targetSpeed) {
if (targetSpeed>0 && targetSpeed<MAX_SPEED) {
Serial.print(F("Setting speed: "));
Serial.println(targetSpeed);
tmc26XStepper.setSpeed(targetSpeed);
}
else {
Serial.print(F("improper speed "));
Serial.println(targetSpeed);
}
}
void setMicrostepping(int microstepping) {
if (microstepping<1 || microstepping>256) {
Serial.print(F("Improperd microstepping setting [1...256]: "));
Serial.print(microstepping);
}
else {
tmc26XStepper.setMicrosteps(microstepping);
}
}
void setStallGuardThreshold(int threshold) {
if (threshold<-64 || threshold > 63) {
Serial.print(F("Improper Stall Guard Threshold [-64...63]: "));
Serial.println(threshold);
}
else {
sgThreshold = threshold;
tmc26XStepper.setStallGuardThreshold(threshold,sgFilter);
}
}
void setStallGuardFilter(int filter) {
if (filter) {
sgFilter=1;
}
else {
sgFilter=0;
}
tmc26XStepper.setStallGuardThreshold(sgThreshold,sgFilter);
}
void setCurrent(int current) {
if (current>0 && current <1700) {
tmc26XStepper.setCurrent(current);
}
else {
Serial.print(F("Improper current {0 ... 1200}: "));
Serial.print(current);
}
}
void updateChopper() {
//we can do only spread now
if (chopperMode==0) {
tmc26XStepper.setSpreadCycleChopper(t_off,t_blank,h_start,h_end,h_decrement);
}
}
void updateCoolStep() {
tmc26XStepper.setCoolStepConfiguration(
lower_SG_threshold, upper_SG_threshold, number_of_SG_readings,
current_increment_step_size, lower_current_limit);
}
//from http://www.uchobby.com/index.php/2007/11/24/arduino-interrupts/
//Setup Timer2.s
//Configures the ATMega168 8-Bit Timer2 to generate an interrupt
//at the specified frequency.
//Returns the timer load value which must be loaded into TCNT2
//inside your ISR routine.
//See the example usage below.
unsigned char setupTimer2(float timeoutFrequency){
unsigned char result; //The timer load value.
//Calculate the timer load value
result=(int)((257.0-(TIMER_CLOCK_FREQ/timeoutFrequency))+0.5);
//The 257 really should be 256 but I get better results with 257.
//Timer2 Settings: Timer Prescaler /8, mode 0
//Timer clock = 16MHz/8 = 2Mhz or 0.5us
//The /8 prescale gives us a good range to work with
//so we just hard code this for now.
TCCR2A = 0;
TCCR2B = 0<<CS22 | 1<<CS21 | 0<<CS20;
//Timer2 Overflow Interrupt Enable
TIMSK2 = 1<<TOIE2;
//load the timer for its first cycle
TCNT2=result;
return(result);
}
ISR(TIMER2_OVF_vect) {
motor_moved = tmc26XStepper.move();
motor_counter++;
}

@ -0,0 +1,369 @@
/*
TMC26XMotorTest.ino - - TMC26X Stepper library tester for Wiring/Arduino
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#define INPUT_BUFFER_LENGTH 32
#define SERIAL_SPEED 115200
#define STATUS_COUNTER 100
char inputBuffer[INPUT_BUFFER_LENGTH+1]; //ad on character to keep the trainling 0
unsigned char inputBufferPosition;
void startSerial() {
Serial.begin(SERIAL_SPEED);
Serial.println(F("================================="));
Serial.println(F("TMC26X Stepper Driver Motor Tester"));
Serial.println(F("================================="));
//empty the input buffer
for (unsigned char i=0; i< INPUT_BUFFER_LENGTH+1; i++) {
inputBuffer[i]=0;
}
inputBufferPosition=0;
}
void loopSerial() {
if (Serial.available()>0 && inputBufferPosition<INPUT_BUFFER_LENGTH) {
char c = Serial.read();
//Read the char
inputBuffer[inputBufferPosition]=c;
inputBufferPosition++;
//always terminate the string
inputBuffer[inputBufferPosition]=0;
//and if the line ended we execute the command
if (c=='\n') {
executeSerialCommand();
}
}
if (motor_moved) {
Serial.print("#sg");
Serial.print(tmc26XStepper.getCurrentStallGuardReading(),DEC);
Serial.print(",p");
Serial.print(tmc26XStepper.getMotorPosition(),DEC);
Serial.print(",k");
Serial.print(tmc26XStepper.getCurrentCurrent(),DEC);
Serial.println(',');
motor_moved=0;
}
if (motor_counter>STATUS_COUNTER) {
motor_counter=0;
char moving = tmc26XStepper.isMoving();
Serial.print('#');
if (moving) {
Serial.print('r');
}
else {
Serial.print('s');
}
Serial.print(',');
Serial.print('d');
Serial.print(direction);
Serial.print(',');
Serial.print("c");
Serial.print(tmc26XStepper.getCurrent(),DEC);
Serial.print(',');
Serial.print('S');
Serial.print(tmc26XStepper.getSpeed(),DEC);
Serial.print(',');
Serial.print('m');
Serial.print(tmc26XStepper.getMicrosteps(),DEC);
Serial.print(',');
Serial.print("t");
Serial.print(tmc26XStepper.getStallGuardThreshold(),DEC);
Serial.print(',');
Serial.print('f');
Serial.print(tmc26XStepper.getStallGuardFilter(),DEC);
Serial.print(',');
//print out the general cool step config
if (tmc26XStepper.isCoolStepEnabled()) {
Serial.print("Ke+,");
}
else {
Serial.print("Ke-,");
}
Serial.print("Kl");
Serial.print(tmc26XStepper.getCoolStepLowerSgThreshold(),DEC);
Serial.print(",Ku");
Serial.print(tmc26XStepper.getCoolStepUpperSgThreshold(),DEC);
Serial.print(",Kn");
Serial.print(tmc26XStepper.getCoolStepNumberOfSGReadings(),DEC);
Serial.print(",Ki");
Serial.print(tmc26XStepper.getCoolStepCurrentIncrementSize(),DEC);
Serial.print(",Km");
Serial.print(tmc26XStepper.getCoolStepLowerCurrentLimit(),DEC);
Serial.print(',');
//detect the winding status
if (tmc26XStepper.isOpenLoadA()) {
Serial.print("ao,");
}
else if(tmc26XStepper.isShortToGroundA()) {
Serial.print("ag,");
}
else {
Serial.print("a-,");
}
//detect the winding status
if (tmc26XStepper.isOpenLoadB()) {
Serial.print("bo,");
}
else if(tmc26XStepper.isShortToGroundB()) {
Serial.print("bg,");
}
else {
Serial.print("b-,");
}
char temperature = tmc26XStepper.getOverTemperature();
if (temperature==0) {
Serial.print("x-,");
}
else if (temperature==TMC26X_OVERTEMPERATURE_PREWARING) {
Serial.print("xw,");
}
else {
Serial.print("xe,");
}
if (tmc26XStepper.isEnabled()) {
Serial.print("e1,");
}
else {
Serial.print("e0,");
}
//write out the current chopper config
Serial.print("Cm");
Serial.print(chopperMode,DEC);
Serial.print(",Co");
Serial.print(t_off,DEC);
Serial.print(",Cb");
Serial.print(t_blank,DEC);
if (chopperMode==0) {
Serial.print(",Cs");
Serial.print(h_start,DEC);
Serial.print(",Ce");
Serial.print(h_end,DEC);
Serial.print(",Cd");
Serial.print(h_decrement,DEC);
}
Serial.print(',');
Serial.println();
}
}
void executeSerialCommand() {
Serial.print("Executing ");
Serial.println(inputBuffer);
//stimple runn & stop commands
switch(inputBuffer[0]) {
case 's':
running = 0;
break;
case 'r':
running = -1;
break;
case 'S':
{
int targetSpeed = decode(1);
setSpeed(targetSpeed);
}
break;
case 'm':
{
int microstepping = decode(1);
setMicrostepping(microstepping);
}
break;
case 't':
{
int threshold = decode(1);
setStallGuardThreshold(threshold);
}
break;
case 'f':
{
int filter = decode(1);
setStallGuardFilter(filter);
}
break;
case 'd':
{
int value = decode(1);
tmc26XStepper.stop();
if (value<0) {
direction=-1;
}
else {
direction=1;
}
}
break;
case 'c':
{
int current = decode(1);
setCurrent(current);
}
break;
case 'e':
{
int enabled = decode(1);
if (enabled) {
tmc26XStepper.setEnabled(true);
}
else {
tmc26XStepper.setEnabled(false);
}
}
break;
case 'C':
switch(inputBuffer[1]) {
case 'o':
{
int value = decode(2);
if (value>0 && value<16) {
t_off=value;
updateChopper();
}
}
break;
case 'b':
{
int value = decode(2);
if (value>=0 && value<=3) {
t_blank=value;
updateChopper();
}
}
break;
case 's':
{
int value = decode(2);
if (value>=0 && value<=8) {
h_start=value;
updateChopper();
}
}
break;
case 'e':
{
int value = decode(2);
if (value>=-3 && value<=12) {
h_end=value;
updateChopper();
}
}
break;
case 'd':
{
int value = decode(2);
if (value>=0 && value<=3) {
h_decrement=value;
updateChopper();
}
}
break;
}
break;
case 'K':
switch(inputBuffer[1]) {
case '+':
tmc26XStepper.setCoolStepEnabled(true);
break;
case '-':
tmc26XStepper.setCoolStepEnabled(false);
break;
case 'l':
{
int value = decode(2);
if (value>=0 && value<480) {
lower_SG_threshold=value;
updateCoolStep();
}
}
break;
case 'u':
{
int value = decode(2);
if (value>=0 && value<480) {
upper_SG_threshold=value;
updateCoolStep();
}
}
break;
case 'n':
{
int value = decode(2);
if (value>=0 && value<4) {
number_of_SG_readings=value;
updateCoolStep();
}
}
break;
case 'i':
{
int value = decode(2);
if (value>=0 && value<4) {
current_increment_step_size=value;
updateCoolStep();
}
}
break;
case 'm':
{
int value = decode(2);
if (value>=0 && value<2) {
lower_current_limit=value;
updateCoolStep();
}
}
break;
}
break;
}
//at the end delete buffer
inputBufferPosition=0;
inputBuffer[0]=0;
}
int decode(unsigned char startPosition) {
int result=0;
boolean negative = false;
if (inputBuffer[startPosition]=='-') {
negative=true;
startPosition++;
}
for (unsigned char i=startPosition; i< (INPUT_BUFFER_LENGTH+1) && inputBuffer[i]!=0; i++) {
char number = inputBuffer[i];
//this very dumb approac can lead to errors, but we expect only numbers after the command anyway
if (number <= '9' && number >='0') {
result *= 10;
result += number - '0';
}
}
if (negative) {
return -result;
}
else {
return result;
}
}

@ -0,0 +1,61 @@
/*
TMC26XMotorTest.ino - - TMC26X Stepper library Example for Wiring/Arduino
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <SPI.h>
#include <TMC26XStepper.h>
//you may adapt this to your shield or breakout board connection
#define CS_PIN 2
#define DIR_PIN 6
#define STEP_PIN 7
#define ENABLE_PIN 8 //if it is not connected it won't be a problem
#define TIMER_CLOCK_FREQ 2000000.0 //2MHz for /8 prescale from 16MHz
#define INITIAL_CURRENT 500 //in mA
#define MAX_SPEED 1000
//we have a stepper motor with 200 steps per rotation, CS pin 2, dir pin 3, step pin 4 and a current of 300mA
TMC26XStepper tmc26XStepper = TMC26XStepper(200,CS_PIN,DIR_PIN,STEP_PIN,INITIAL_CURRENT);
char running;
void setup() {
//configure the enable pin
pinMode(ENABLE_PIN, OUTPUT);
digitalWrite(ENABLE_PIN,HIGH);
startSerial();
startMotor();
//set this according to you stepper
Serial.println(F("started"));
}
void loop() {
loopSerial();
runMotor();
}

@ -0,0 +1,306 @@
/*
TMC26XMotorTest.pde - - TMC26X Stepper Tester for Processing
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
String channelAStatus=null;
String channelBStatus=null;
String temperatureStatus=null;
boolean motor_connected = false;
RadioButton serialButtons;
Button serialOkButton;
Button helpButton;
Textarea statusArea;
String[] ports;
int activePortIndex = -1;
String identString="TMC26X Stepper Driver Motor Tester";
int connectTimeout=10*1000; //how long do we wait until the Arduino is connected
StringBuilder serialStringBuilder = new StringBuilder();
void setupSerialConfig() {
Tab defaultTab = controlP5.getTab("default");
//add the list of serial interfaces - it get's populated later
serialButtons = controlP5.addRadioButton("serialport", 200, 100+TMCLogo.height*2+50);
serialConfigElements.add(serialButtons);
serialButtons.captionLabel().set("Select Serial Port");
serialButtons.showBar();
serialButtons.moveTo(defaultTab);
//ad the ok button
serialOkButton = controlP5.addButton("serialOk", 1, 200, height-300, 30, 30);
serialConfigElements.add(serialOkButton);
serialOkButton.setCaptionLabel("OK");
runToggle.moveTo(defaultTab);
//add the status area
statusArea = controlP5.addTextarea("statusArea","",200,height-250,300,50);
serialConfigElements.add(statusArea);
statusArea.moveTo(defaultTab);
helpButton = controlP5.addButton("help", 1, 200, height-250, 80, 30);
serialConfigElements.add(helpButton);
helpButton.moveTo(defaultTab);
//finally update the list of serial ports
updateSerialPortList();
}
void updateSerialPortList() {
//first remove all present serial ports
List items = serialButtons.getItems();
for (Object i:items) {
Toggle item = (Toggle) i;
serialButtons.removeItem(item.getName());
}
//add the serial ports
ports = Serial.list();
for (int i=0; i< ports.length; i++) {
serialButtons.addItem(ports[i],i);
}
serialButtons.setValue(-1);
serialOkButton.setVisible(false);
}
void serialport(int value) {
//ok button is only active if a serial port is selected
serialOkButton.setVisible(value>-1);
if (value>-1) {
statusArea.setText("");
}
activePortIndex = value;
}
void serialOk(int value) {
String error = null;
if (value!=0 && activePortIndex>-1) {
try {
arduinoPort = new Serial(this, ports[activePortIndex], 115200);
int timeStarted = millis();
StringBuilder identBuffer = new StringBuilder();
while (!motor_connected && (millis()-timeStarted)<connectTimeout) {
if (arduinoPort.available ()>0) {
char c = arduinoPort.readChar();
identBuffer.append(c);
if (c=='\n') {
if (identString.contains(identString)) {
motor_connected = true;
toggleUi(true);
return;
}
identBuffer = new StringBuilder();
}
}
}
} catch (RuntimeException e) {
//we simply do nothing
//TODO set status label
error = "There was a problem with serial port "+ports[activePortIndex]+": "+e.getMessage();
}
//ok appearantly we did not find an motor tester - so lets deselect that port
if (error == null) {
error = "Could not find TMC26XMotorTester on serial port "+ports[activePortIndex];
}
statusArea.setText(error);
Toggle selected = serialButtons.getItem(activePortIndex);
selected.setState(false);
serialOkButton.setVisible(false);
}
}
void decodeSerial() {
if (motor_connected) {
while (arduinoPort.available ()>0) {
char c = arduinoPort.readChar();
serialStringBuilder.append(c);
if (c=='\n') {
decodeSerial(serialStringBuilder.toString());
serialStringBuilder = new StringBuilder();
}
}
}
}
void sendCommand(String command) {
if (motor_connected) {
arduinoPort.write(command+"\n");
}
}
void decodeSerial(String line) {
settingStatus=true;
if (line.startsWith("#")) {
String status = line.substring(1);
StringTokenizer statusTokenizer = new StringTokenizer(status, ",");
while (statusTokenizer.hasMoreTokens ()) {
String statusToken = statusTokenizer.nextToken();
if ("s".equals(statusToken)) {
runToggle.setValue(0);
}
else if ("r".equals(statusToken)) {
runToggle.setValue(1);
}
else if (statusToken.startsWith("e")) {
int enabled = getValueOfToken(statusToken, 1);
if (enabled!=0) {
enabledToggle.setValue(1);
}
else {
enabledToggle.setValue(0);
}
}
else if (statusToken.startsWith("S")) {
speedSlider.setValue(getValueOfToken(statusToken, 1));
}
else if (statusToken.startsWith("m")) {
microsteppingButtons.activate("m_1/"+String.valueOf(getValueOfToken(statusToken, 1)));
}
else if (statusToken.startsWith("sg")) {
addStallGuardReading(getValueOfToken(statusToken, 2));
}
else if (statusToken.startsWith("p")) {
addPositionReading(getValueOfToken(statusToken, 1));
}
else if (statusToken.startsWith("k")) {
addCurrentReading(getValueOfToken(statusToken, 1));
}
else if (statusToken.startsWith("t")) {
sgtSlider.setValue(getValueOfToken(statusToken, 1));
}
else if (statusToken.startsWith("f")) {
sgFilterToggle.setValue(getValueOfToken(statusToken, 1));
}
else if (statusToken.startsWith("d")) {
setDirection(getValueOfToken(statusToken, 1));
}
else if (statusToken.startsWith("c")) {
setCurrent(getValueOfToken(statusToken, 1));
}
else if (statusToken.startsWith("a")) {
if (statusToken.charAt(1)=='o') {
channelAStatus="Open Load";
}
else if (statusToken.charAt(1)=='g') {
channelAStatus="Short to Ground!";
}
else {
channelAStatus=null;
}
}
else if (statusToken.startsWith("b")) {
if (statusToken.charAt(1)=='o') {
channelBStatus="Open Load";
}
else if (statusToken.charAt(1)=='g') {
channelBStatus="Short to Ground!";
}
else {
channelBStatus=null;
}
}
else if (statusToken.startsWith("x")) {
if (statusToken.charAt(1)=='w') {
temperatureStatus="Prewarning!";
}
else if (statusToken.charAt(1)=='e') {
temperatureStatus="Error";
}
else {
temperatureStatus=null;
}
}
else if (statusToken.startsWith("Cm")) {
//chopper mode is currently ignored
}
else if (statusToken.startsWith("Co")) {
constantOffSlider.setValue(getValueOfToken(statusToken, 2));
}
else if (statusToken.startsWith("Cb")) {
blankTimeSlider.setValue(getValueOfToken(statusToken, 2));
}
else if (statusToken.startsWith("Cs")) {
hysteresisStartSlider.setValue(getValueOfToken(statusToken, 2));
}
else if (statusToken.startsWith("Ce")) {
hysteresisEndSlider.setValue(getValueOfToken(statusToken, 2));
}
else if (statusToken.startsWith("Cd")) {
setHystDecrement(getValueOfToken(statusToken, 2));
}
else if ("Ke+".equals(statusToken)) {
coolStepActiveToggle.setValue(1);
}
else if ("Ke-".equals(statusToken)) {
coolStepActiveToggle.setValue(0);
}
else if (statusToken.startsWith("Kl")) {
coolStepMinSlider.setValue(getValueOfToken(statusToken, 2));
}
else if (statusToken.startsWith("Ku")) {
coolStepMaxSlider.setValue(getValueOfToken(statusToken, 2));
}
else if (statusToken.startsWith("Kn")) {
coolStepDecrementButtons.activate(getValueOfToken(statusToken, 2));
}
else if (statusToken.startsWith("Ki")) {
coolStepIncrementButtons.activate(getValueOfToken(statusToken, 2));
}
else if (statusToken.startsWith("Km")) {
coolStepMinButtons.activate(getValueOfToken(statusToken, 2));
}
}
}
else {
println(line);
}
settingStatus=false;
}
int getValueOfToken(String token, int position) {
String value = token.substring(position);
try {
return Integer.valueOf(value);
}
catch (NumberFormatException e) {
println("Unable to decode '"+value+"'of '"+token+"' !");
return 0;
}
}
void drawSerial() {
//draw the logo and some epxlaining text while setting up the serial port
if (!motor_connected) {
image(TMCLogo,200, 100);
fill(uiTextColor);
text("Select the serial port where your Arduino is connected\nIf in doubt check it in the Arduino IDE.\nThe Motor Tester will automatically verify if it can find an Motor tester ath the port.",200,100+TMCLogo.height+50);
}
}
void help(float value) {
if (value!=0) {
link(helpUrl);
}
}

@ -0,0 +1,175 @@
/*
TMC26XMotorTest.pde - - TMC26X Stepper Tester for Processing
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
Slider constantOffSlider;
Slider blankTimeSlider;
Toggle randomOffTimeToggle;
RadioButton ChopperModeButtons;
//for constant off time chopeer
Slider fastDecaySlider;
Slider sineWaveOffsetSlider;
Toggle currentComparatorToggle;
//for spread chopper
Slider hysteresisStartSlider;
Slider hysteresisEndSlider;
Numberbox motorVoltageBox;
Numberbox motorCurrentBox;
Numberbox motorResistanceBox;
Numberbox motorInductanceBox;
RadioButton hysteresisDecrementButtons;
PImage spreadChopperImage;
void setupChooperConfig() {
//add input fields for the various motor parameters
motorVoltageBox = controlP5.addNumberbox("motorvoltage",12.0,20,40,100,20);
motorVoltageBox.setCaptionLabel("Motor Voltage (V)");
motorVoltageBox.setMultiplier(0.025);
motorVoltageBox.setMin(0);
motorVoltageBox.setMax(40.0);
motorVoltageBox.moveTo(configureTab);
motorCurrentBox = controlP5.addNumberbox("motorcurrent",0.5,140,40,100,20);
motorCurrentBox.setCaptionLabel("Motor Current (A)");
motorCurrentBox.setMultiplier(0.025);
motorCurrentBox.setMin(0.46);
motorCurrentBox.setMax(1.7);
motorCurrentBox.moveTo(configureTab);
motorResistanceBox = controlP5.addNumberbox("motorresistance",2,260,40,100,20);
motorResistanceBox.setCaptionLabel("Motor Resistance (Ohm)");
motorResistanceBox.setMultiplier(0.1);
motorResistanceBox.setMin(0);
motorResistanceBox.setMax(250);
motorResistanceBox.moveTo(configureTab);
motorInductanceBox = controlP5.addNumberbox("motorinductance",2,380,40,100,20);
motorInductanceBox.setMultiplier(0.1);
motorInductanceBox.setMin(0);
motorInductanceBox.setMax(250);
motorInductanceBox.setCaptionLabel("Motor Inductance (mH)");
motorInductanceBox.moveTo(configureTab);
// add a vertical slider for speed
constantOffSlider = controlP5.addSlider("constantoff", 1, 15, 1, 20, 80, 400, 20);
constantOffSlider.setCaptionLabel("Constant Off Time");
constantOffSlider.setSliderMode(Slider.FIX);
constantOffSlider.moveTo(configureTab);
blankTimeSlider = controlP5.addSlider("blanktime", 0, 3, 2, 20, 120, 400, 20);
blankTimeSlider.setCaptionLabel("Blank Time");
blankTimeSlider.moveTo(configureTab);
hysteresisStartSlider = controlP5.addSlider("hysteresisstart", 0, 8, 2, 20, 160, 400, 20);
hysteresisStartSlider.setCaptionLabel("Hysteresis Start");
hysteresisStartSlider.moveTo(configureTab);
hysteresisEndSlider = controlP5.addSlider("hysteresisend", -3, 12, 2, 20, 200, 400, 20);
hysteresisEndSlider.setCaptionLabel("Hysteresis End");
hysteresisEndSlider.moveTo(configureTab);
hysteresisDecrementButtons =controlP5.addRadioButton("decrement", 20, 240);
hysteresisDecrementButtons.addItem("fastest", 0);
hysteresisDecrementButtons.addItem("fast", 1);
hysteresisDecrementButtons.addItem("medium", 2);
hysteresisDecrementButtons.addItem("slow", 3);
hysteresisDecrementButtons.showBar();
hysteresisDecrementButtons.moveTo(configureTab);
spreadChopperImage = loadImage("hysteresis.png");
}
void drawChopper() {
if (activeTab!=null && configureTab.equals(activeTab)) {
image(spreadChopperImage, 200, 400);
}
}
void constantoff(int theValue) {
if (!settingStatus) {
if (theValue>0 && theValue<16) {
println("Constant off "+theValue);
sendCommand("cO"+theValue);
}
else {
println("invalid blank time of "+theValue);
}
}
}
void blanktime(int theValue) {
if (!settingStatus) {
if (theValue>=0 && theValue<=3) {
println("blank time "+theValue);
sendCommand("Cb"+theValue);
}
}
}
void hysteresisstart(int start) {
if (!settingStatus) {
if (start>=1 && start<=8) {
println("hystereis start "+start);
sendCommand("Cs"+start);
}
}
}
void hysteresisend(int end) {
if (!settingStatus) {
if (end>=-3 && end<=12) {
println("hystereis end "+end);
sendCommand("Ce"+end);
}
}
}
void setHysteresisDecrement(int theValue) {
if (!settingStatus) {
if (theValue>=0 && theValue<=3) {
println("Hysteresis decrement "+theValue);
sendCommand("Cd"+theValue);
}
else {
println("cannot set decrement to "+theValue);
}
}
}
void setHystDecrement(int value) {
if (value>=0 && value<=3) {
hysteresisDecrementButtons.activate(value);
}
else {
println("this is no proper hysteresis decerement value: "+value);
}
}
void motorcurrent(float value) {
if (activeTab!=null && "default".equals(activeTab.name())) {
currentSlider.setValue(value);
}
}

@ -0,0 +1,327 @@
/*
TMC26XMotorTest.pde - - TMC26X Stepper Tester for Processing
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
//our graph dimensions
int plotBottom, plotTop;
int plotLeft, plotRight;
//we already know the minima and maxima of certain dates
int stallGuardMin = 0;
int stallGuardMax =1024;
int positionMin = 0;
int positionMax = 1024;
int dataPointsWidth = 3;
int dataLineWidth = 2;
int highLightWidth = 7;
int numberOfDataPoints=1000;
int legendTitleSize = 10;
int legendTextSize = 10;
int currentLabelInterval = 500;
int currentMinorTickInterval = 25;
DecimalFormat currentLabelFormat = new DecimalFormat("#0.0A");
int stallGuardLabelInterval = 100;
int stallGuardMinorTickInterval = 10;
int positionLabelInterval = 64;
int positionMinorTickInterval = 8;
int coolStepActiveStroke = 2;
int coolStepInactiveStroke = 1;
int stallGuardHighLightDistance = 1;
int positionHighLightDistance = 3;
int currentHighLightDistance = 3;
DataTable stallGuardTable = new DataTable(numberOfDataPoints);
DataTable positionTable = new DataTable(numberOfDataPoints);
DataTable currentTable = new DataTable(numberOfDataPoints);
int logoLeft = 10;
int logoTop = 50;
int logoWidth = 75;
int logoHeight = 75;
void setupData() {
plotBottom = height-50;
plotTop = 300;
plotLeft = 150;
plotRight= width-50;
//recalculate the image dimension for the Logo
logoHeight = (int)((float)logoWidth/(float)TMCLogo.width*(float)TMCLogo.height);
logoTop = height - 10 - logoHeight;
}
void drawData() {
if (motor_connected && activeTab!=null && runTab.equals(activeTab)) {
fill(diagramBackgroundColor);
noStroke();
rect(plotLeft, plotTop, plotRight, plotBottom);
noFill();
rectMode(CORNERS);
noStroke();
//rect(plotLeft, plotBottom, plotRight, plotTop);
strokeWeight(dataLineWidth);
stroke(positionColor);
drawDataLine(positionTable, positionMin, positionMax);
drawDataHighLight(positionTable, positionMin, positionMax, positionHighLightDistance, labelColor, "Microstep Position", false);
strokeWeight(dataLineWidth);
stroke(coolStepColor);
drawCurrentLine(currentTable);
drawCurrentHighLight(positionTable, currentHighLightDistance, labelColor, "Current Ratio", false);
strokeWeight(dataPointsWidth);
stroke(stallGuardColor);
drawDataPoints(stallGuardTable, stallGuardMin, stallGuardMax);
drawDataHighLight(stallGuardTable, stallGuardMin, stallGuardMax, stallGuardHighLightDistance, labelColor, "Stall Guard", true);
if (coolStepActive) {
strokeWeight(coolStepActiveStroke);
} else {
strokeWeight(coolStepInactiveStroke);
}
stroke(coolStepColor);
float coolStepMinHeight = map(coolStepMin, 0, stallGuardMax, plotBottom, plotTop);
line(plotLeft,coolStepMinHeight, plotRight, coolStepMinHeight);
float coolStepMaxHeight = map(coolStepMin+coolStepMax+1, 0, stallGuardMax, plotBottom, plotTop);
line(plotLeft,coolStepMaxHeight, plotRight, coolStepMaxHeight);
textSize(legendTitleSize);
textAlign(RIGHT);
fill(coolStepColor);
text("Motor Current", plotLeft - 50, plotTop - 10);
textSize(legendTextSize);
textAlign(RIGHT);
strokeWeight(1);
stroke(coolStepColor);
int currentScaleMax = (int)(maxCurrent*1000.0);
for (int i=0; i<=currentScaleMax; i++) {
float y = map(i, 0, currentScaleMax, plotBottom, plotTop);
if (i % currentLabelInterval == 0) {
if (i==0) {
textAlign(RIGHT, BOTTOM);
}
else if (i==currentScaleMax) {
textAlign(RIGHT, TOP);
}
else {
textAlign(RIGHT, CENTER);
}
text(currentLabelFormat.format((float)i/1000.0), plotLeft-58, y);
line (plotLeft-55, y, plotLeft-50, y);
}
else if (i % currentMinorTickInterval == 0) {
line (plotLeft-53, y, plotLeft-50, y);
}
}
textSize(legendTitleSize);
textAlign(LEFT);
fill(stallGuardColor);
text("Stall Guard Reading", plotLeft - 30, plotTop - 10);
textSize(legendTextSize);
textAlign(RIGHT);
strokeWeight(1);
stroke(stallGuardColor);
for (int i=stallGuardMin; i<=stallGuardMax; i++) {
float y = map(i, stallGuardMin, stallGuardMax, plotBottom, plotTop);
if (i % stallGuardLabelInterval == 0) {
if (i==stallGuardMin) {
textAlign(RIGHT, BOTTOM);
}
else if (i==stallGuardMax) {
textAlign(RIGHT, TOP);
}
else {
textAlign(RIGHT, CENTER);
}
text(i, plotLeft-8, y);
line (plotLeft-5, y, plotLeft, y);
}
else if (i % stallGuardMinorTickInterval == 0) {
line (plotLeft-3, y, plotLeft, y);
}
}
textSize(legendTitleSize);
fill(positionColor);
textAlign(RIGHT);
text("Position", plotRight + 30, plotTop - 10);
textSize(legendTextSize);
textAlign(LEFT);
strokeWeight(1);
stroke(positionColor);
for (int i=positionMin; i<=positionMax; i++) {
float y = map(i, positionMin, positionMax, plotBottom, plotTop);
if (i % positionLabelInterval == 0) {
if (i==positionMin) {
textAlign(LEFT, BOTTOM);
}
else if (i==stallGuardMax) {
textAlign(LEFT, TOP);
}
else {
textAlign(LEFT, CENTER);
}
text(i, plotRight+8, y);
line (plotRight, y, plotRight+5, y);
}
else if (i % positionMinorTickInterval == 0) {
line (plotRight, y, plotRight+3, y);
}
}
//draw the channel status
textSize(legendTextSize);
textAlign(CENTER);
strokeWeight(1);
int statusY = height - 20;
int channelAX = width/4;
int temperatureX = width/2;
int channelBX = width/4*3;
if (channelAStatus==null) {
fill(goodStatusColor);
text("Channel A: OK", channelAX, statusY);
}
else {
fill(badStatusColor);
text("Channel A: "+channelAStatus, channelAX, statusY);
}
if (channelBStatus==null) {
fill(goodStatusColor);
text("Channel B: OK", channelBX, statusY);
}
else {
fill(badStatusColor);
text("Channel B: "+channelBStatus, channelBX, statusY);
}
if (temperatureStatus==null) {
fill(goodStatusColor);
text("Temperature: OK", temperatureX, statusY);
}
else {
fill(badStatusColor);
text("Temperature: "+temperatureStatus, temperatureX, statusY);
}
}
}
void drawDataPoints(DataTable table, int minValue, int maxValue) {
int dataCount = table.getSize();
for (int i=0; i<dataCount; i++) {
int value = table.getEntry(i);
float x = map(i, 0, numberOfDataPoints-1, plotLeft+dataPointsWidth, plotRight-dataPointsWidth);
float y = map(value, minValue, maxValue, plotBottom-dataPointsWidth, plotTop+dataPointsWidth);
point(x, y);
}
}
void drawDataLine(DataTable table, int minValue, int maxValue) {
beginShape();
int dataCount = table.getSize();
for (int i=0; i<dataCount; i++) {
int value = table.getEntry(i);
float x = map(i, 0, numberOfDataPoints-1, plotLeft+dataPointsWidth, plotRight-dataPointsWidth);
float y = map(value, minValue, maxValue, plotBottom-dataPointsWidth, plotTop+dataPointsWidth);
vertex(x, y);
}
endShape();
}
void drawDataHighLight(DataTable table, int minValue, int maxValue, int distance, color textColor, String name, boolean top) {
int dataCount = table.getSize();
for (int i=0; i<dataCount; i++) {
int value = table.getEntry(i);
float x = map(i, 0, numberOfDataPoints-1, plotLeft+dataPointsWidth, plotRight-dataPointsWidth);
float y = map(value, minValue, maxValue, plotBottom-dataPointsWidth, plotTop+dataPointsWidth);
if (dist(mouseX, mouseY, x, y) < distance) {
strokeWeight(highLightWidth);
point(x, y);
fill(textColor);
textSize(10);
textAlign(CENTER);
if (top) {
text(name+": "+value, x, y-8);
}
else {
text(name+": "+value, x, y+8);
}
}
}
}
void drawCurrentLine(DataTable table) {
noFill();
beginShape();
int dataCount = table.getSize();
for (int i=0; i<dataCount; i++) {
float value = (table.getEntry(i)+1)/1000.0;
float x = map(i, 0, numberOfDataPoints-1, plotLeft+dataPointsWidth, plotRight-dataPointsWidth);
float y = map(value, 0.0, maxCurrent, (float)plotBottom-dataPointsWidth, (float)plotTop+dataPointsWidth);
vertex(x, y);
}
endShape();
}
void drawCurrentHighLight(DataTable table, int distance, color textColor, String name, boolean top) {
int dataCount = table.getSize();
for (int i=0; i<dataCount; i++) {
float value = (table.getEntry(i)+1)/1000.0;
float x = map(i, 0, numberOfDataPoints-1, plotLeft+dataPointsWidth, plotRight-dataPointsWidth);
float y = map(value, 0.0, maxCurrent, plotBottom-dataPointsWidth, plotTop+dataPointsWidth);
if (dist(mouseX, mouseY, x, y) < distance) {
strokeWeight(highLightWidth);
point(x, y);
fill(textColor);
textSize(10);
textAlign(CENTER);
if (top) {
text(name+": "+value, x, y-8);
}
else {
text(name+": "+value, x, y+8);
}
}
}
}
void addStallGuardReading(int value) {
stallGuardTable.addData(value);
}
void addPositionReading(int value) {
positionTable.addData(value);
}
void addCurrentReading(int value) {
currentTable.addData(value);
}

@ -0,0 +1,49 @@
/*
TMC26XMotorTest.pde - - TMC26X Stepper Tester for Processing
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class DataTable {
LinkedList<Integer> dataList = new LinkedList<Integer>();
int maxEntries;
DataTable(int maxEntries) {
this.maxEntries = maxEntries;
}
void addData(int value) {
dataList.add(value);
if (dataList.size()>maxEntries) {
dataList.remove();
}
}
int getSize() {
return dataList.size();
}
int getEntry(int position) {
return dataList.get(position);
}
}

@ -0,0 +1,335 @@
/*
TMC26XMotorTest.pde - - TMC26X Stepper Tester for Processing
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
Slider speedSlider;
Toggle runToggle;
RadioButton directionButtons;
Toggle enabledToggle;
RadioButton microsteppingButtons;
Slider sgtSlider;
Button sgtPlus;
Button sgtMinus;
Toggle sgFilterToggle;
Slider currentSlider;
Slider coolStepMinSlider;
Slider coolStepMaxSlider;
Toggle coolStepActiveToggle;
RadioButton coolStepIncrementButtons;
RadioButton coolStepDecrementButtons;
RadioButton coolStepMinButtons;
List runControls = new LinkedList();
Button trinamicButton;
Button motionControlButton;
void setupRunConfig() {
//the run configuration
//controlP5.getControlFont().setSize(10); - the font is too small, try to increase it!
//add a button te let the motor run
runToggle = controlP5.addToggle("run", false, 20, 40, 30, 30);
controlElements.add(runToggle);
runToggle.moveTo(runTab);
//add some directions buttons
directionButtons = controlP5.addRadioButton("direction", 20, 90);
controlElements.add(directionButtons);
directionButtons.addItem("forward", 1);
directionButtons.addItem("backward", -1);
directionButtons.activate(0);
directionButtons.moveTo(runTab);
enabledToggle = controlP5.addToggle("enabled", false, 20, 220, 30, 30);
controlElements.add(enabledToggle);
enabledToggle.moveTo(runTab);
// add a vertical slider for speed
speedSlider = controlP5.addSlider("speed", 1, 100, 10, 85, 40, 20, 210);
controlElements.add(speedSlider);
speedSlider.moveTo(runTab);
//ad a multilist for the microstepping setting
microsteppingButtons = controlP5.addRadioButton("microstepping", 150, 40);
controlElements.add(microsteppingButtons);
microsteppingButtons.addItem("m_1/1", 1);
microsteppingButtons.addItem("m_1/2", 2);
microsteppingButtons.addItem("m_1/4", 4);
microsteppingButtons.addItem("m_1/8", 8);
microsteppingButtons.addItem("m_1/16", 16);
microsteppingButtons.addItem("m_1/32", 32);
microsteppingButtons.addItem("m_1/64", 64);
microsteppingButtons.addItem("m_1/128", 128);
microsteppingButtons.addItem("m_1/256", 256);
for (Object o:microsteppingButtons.getItems()) {
Toggle t = (Toggle) o;
t.setCaptionLabel(t.getName().substring(2));
}
microsteppingButtons.showBar();
microsteppingButtons.moveTo(runTab);
currentSlider = controlP5.addSlider("current", 0.46, maxCurrent, 0.4, 250, 40, 20, 210);
controlElements.add(currentSlider);
currentSlider.moveTo(runTab);
// add a vertical slider for stallGuard threshold
sgtPlus = controlP5.addButton("sgtplus", 0, 400, 40, 20, 20);
controlElements.add(sgtPlus);
sgtPlus.setCaptionLabel("+");
sgtPlus.moveTo(runTab);
sgtMinus = controlP5.addButton("sgtminus", 1, 400, 70, 20, 20);
controlElements.add(sgtMinus);
sgtMinus.setCaptionLabel("-");
sgtMinus.moveTo(runTab);
sgtSlider = controlP5.addSlider("stallguardthreshold", -64, 63, 0, 350, 40, 20, 150);
controlElements.add(sgtSlider);
sgtSlider.setSliderMode(Slider.FIX);
sgtSlider.setCaptionLabel("Stall Guard Threshold");
sgtSlider.moveTo(runTab);
//ading some buttons to have finer sg control
//adding a button for the filter
sgFilterToggle = controlP5.addToggle("sgfilter", false, 350, 220, 30, 30);
controlElements.add(sgFilterToggle);
sgFilterToggle.setCaptionLabel("Stall GuardFilter");
sgFilterToggle.moveTo(runTab);
//add the coolstep sliders
coolStepMaxSlider = controlP5.addSlider("coolStepUpper", 0, 480, 0, 500, 40, 20, 90);
controlElements.add(coolStepMaxSlider);
coolStepMaxSlider.setCaptionLabel("Cool Step Hysteresis");
coolStepMaxSlider.moveTo(runTab);
coolStepMinSlider = controlP5.addSlider("coolStepLower", 0, 480, 0, 500, 160, 20, 90);
controlElements.add(coolStepMinSlider);
coolStepMinSlider.setCaptionLabel("Cool Step Minimum");
coolStepMinSlider.moveTo(runTab);
coolStepActiveToggle = controlP5.addToggle("coolStepActive", false, 600, 220, 30, 30);
controlElements.add(coolStepActiveToggle);
coolStepActiveToggle.setCaptionLabel("Enable CoolStep");
coolStepActiveToggle.moveTo(runTab);
coolStepIncrementButtons = controlP5.addRadioButton("coolStepIncrement", 600, 40);
controlElements.add(coolStepIncrementButtons);
coolStepIncrementButtons.captionLabel().set("Cool Step Increment");
coolStepIncrementButtons.addItem("i_1", 0);
coolStepIncrementButtons.addItem("i_2", 1);
coolStepIncrementButtons.addItem("i_4", 2);
coolStepIncrementButtons.addItem("i_8", 3);
for (Object o:coolStepIncrementButtons.getItems()) {
Toggle t = (Toggle) o;
t.setCaptionLabel(t.getName().substring(2));
}
coolStepIncrementButtons.showBar();
coolStepIncrementButtons.moveTo(runTab);
coolStepDecrementButtons = controlP5.addRadioButton("coolStepDecrement", 600, 110);
controlElements.add(coolStepDecrementButtons);
coolStepDecrementButtons.captionLabel().set("Cool Step Decrement");
coolStepDecrementButtons.addItem("d_32", 0);
coolStepDecrementButtons.addItem("d_8", 1);
coolStepDecrementButtons.addItem("d_2", 2);
coolStepDecrementButtons.addItem("d_1", 3);
for (Object o:coolStepDecrementButtons.getItems()) {
Toggle t = (Toggle) o;
t.setCaptionLabel(t.getName().substring(2));
}
coolStepDecrementButtons.showBar();
coolStepDecrementButtons.moveTo(runTab);
coolStepMinButtons = controlP5.addRadioButton("coolStepMin", 600, 180);
controlElements.add(coolStepMinButtons);
coolStepMinButtons.addItem("s_1/2", 0);
coolStepMinButtons.addItem("s_1/4", 1);
for (Object o:coolStepMinButtons.getItems()) {
Toggle t = (Toggle) o;
t.setCaptionLabel(t.getName().substring(2));
}
coolStepMinButtons.showBar();
coolStepMinButtons.moveTo(runTab);
trinamicButton = controlP5.addButton("trinamicLogo", 1.0, 750, 40, 200, 100);
trinamicButton.setImage(TMCLogo);
trinamicButton.moveTo(runTab);
controlElements.add(trinamicButton);
motionControlButton = controlP5.addButton("mcLogo", 1.0, 750, 150, 200, 100);
motionControlButton.setImage(MCLogo);
motionControlButton.moveTo(runTab);
controlElements.add(motionControlButton);
}
void speed(int theSpeed) {
if (!settingStatus) {
int speed = (int) theSpeed;
println("setting speed to "+speed);
sendCommand("S"+speed);
}
}
void run(int value) {
if (!settingStatus) {
println("button pressed");
if (running) {
println("stopping motor");
sendCommand("s");
running = false;
}
else {
println("starting motor");
sendCommand("r");
running = true;
}
}
}
void enabled(int value) {
if (!settingStatus) {
println("enabled: "+value);
sendCommand("e"+value);
}
}
void microstepping(int value) {
if (!settingStatus) {
println("microstepping: "+value);
sendCommand("m"+value);
}
}
void stallguardthreshold(int value) {
if (!settingStatus) {
println("stall guard threshold: "+value);
sendCommand("t"+value);
}
if (value==sgtSlider.max()) {
sgtPlus.lock();
}
else {
sgtPlus.unlock();
}
if (value==sgtSlider.min()) {
sgtMinus.lock();
}
else {
sgtMinus.unlock();
}
}
void sgtplus(int value) {
sgtSlider.setValue(sgtSlider.value()+1);
}
void sgtminus(int value) {
sgtSlider.setValue(sgtSlider.value()-1);
}
void sgfilter(int value) {
if (!settingStatus) {
println("filter: "+value);
sendCommand("f"+value);
}
}
void current(float value) {
if (!settingStatus) {
int realValue=(int)(value*1000.0);
println("current: "+((float)realValue/1000.0)+" = "+realValue);
sendCommand("c"+realValue);
if (activeTab!=null && "run".equals(activeTab.name())) {
motorCurrentBox.setValue(value);
}
}
}
void coolStepUpper(int value) {
coolStepMax=value;
if (!settingStatus) {
sendCommand("Ku"+value);
}
}
void coolStepLower(int value) {
coolStepMin = value;
if (!settingStatus) {
sendCommand("Kl"+value);
}
}
void setCoolStepIncrement(int value) {
if (!settingStatus) {
println("cool step increment :"+value);
sendCommand("Ki"+value);
}
}
void setCoolStepDecrement(int value) {
if (!settingStatus) {
println("cool step decrement :"+value);
sendCommand("Kn"+value);
}
}
void setCoolStepMin(int value) {
if (!settingStatus) {
println("cool step minimum :"+value);
sendCommand("Km"+value);
}
}
void coolStepActive(int value) {
if (!settingStatus) {
coolStepActive = (value!=0);
sendCommand(coolStepActive? "K+":"K-");
}
}
void setCurrent(int current) {
currentSlider.setValue((float)current/1000.0);
}
void setDirection(int direction) {
if (!settingStatus) {
if (direction<0) {
println("back");
sendCommand("d-1");
}
else {
sendCommand("d1");
}
}
}
void trinamicLogo(float value){
if (value!=0) {
link(trinamicUrl);
}
}
void mcLogo(float value) {
if (value!=0) {
link(mcUrl);
}
}

@ -0,0 +1,156 @@
/*
TMC26XMotorTest.pde - - TMC26X Stepper Tester for Processing
Copyright (c) 2011, Interactive Matter, Marcus Nowotny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
import controlP5.*;
import processing.serial.*;
import java.util.*;
import java.text.*;
ControlP5 controlP5;
Serial arduinoPort;
String helpUrl = "http://www.motioncontrol-community.org/";
String trinamicUrl = "http://trinamic.com";
String mcUrl = "http://www.motioncontrol-community.org/";
//TODO comde up with a nice color scheme
color activeColor = #01ADF1;
color foreGroundColor = #01ADF1;
color uiTextColor = #4D4D4F;
color uiElementColor = #ffffff;
color labelColor = #f0f0f0;
color valueColor = #f0f0f0;
color backgroundColor = #EDEEEF;
color stallGuardColor = #969696;
color positionColor = #01ADF1;
color goodStatusColor = labelColor;
color badStatusColor = stallGuardColor;
color coolStepColor = #4D4D4F;
color diagramBackgroundColor = #ffffff;
CColor uiColor = new CColor( foreGroundColor, uiElementColor, activeColor, uiTextColor, uiTextColor);
Tab configureTab;
Tab runTab;
Tab activeTab;
boolean settingStatus=false;
boolean running = false;
int coolStepMin = 0;
int coolStepMax = 0;
boolean coolStepActive = false;
float maxCurrent = 1.7;
List controlElements = new LinkedList();
List serialConfigElements = new LinkedList();
PImage TMCLogo;
PImage MCLogo;
void setup() {
size(1000, 800);
//load the logos
TMCLogo=loadImage("tmc_logo.jpg");
MCLogo=loadImage("mc_logo.jpg");
//create the UI
controlP5 = new ControlP5(this);
controlP5.setColor(uiColor);
runTab = controlP5.getTab("default");
configureTab =controlP5.addTab("configure");
//customize the tabs a bit
configureTab.setLabel("configure");
controlElements.add(configureTab);
activeTab = controlP5.getTab("default");
controlP5.setTabEventsActive(true);
configureTab.activateEvent(true);
runTab.activateEvent(true);
//configuring the general UI l&f
//the configuration UI
setupRunConfig();
setupChooperConfig();
setupSerialConfig();
//directly hide the controls again since we are not connected to the Arduino yet
toggleUi(motor_connected);
smooth();
setupData();
}
void toggleUi(boolean show_controls) {
for (Object c:controlElements) {
ControllerInterface controller = (ControllerInterface) c;
if (show_controls) {
controller.show();
} else {
controller.hide();
}
}
for (Object c:serialConfigElements) {
ControllerInterface controller = (ControllerInterface) c;
if (show_controls) {
controller.hide();
} else {
controller.show();
}
}
}
void draw() {
background(backgroundColor);
drawSerial();
drawChopper();
drawData();
decodeSerial();
}
void controlEvent(ControlEvent theEvent) {
if (theEvent.isGroup() && !settingStatus) {
if ("microstepping".equals(theEvent.group().name())) {
microstepping((int)theEvent.group().value());
} else
if ("direction".equals(theEvent.group().name())) {
setDirection((int)theEvent.group().value());
} else if ("decrement".equals(theEvent.group().name())) {
setHysteresisDecrement((int)theEvent.group().value());
} else if ("coolStepIncrement".equals(theEvent.group().name())) {
setCoolStepIncrement((int)theEvent.group().value());
} else if ("coolStepDecrement".equals(theEvent.group().name())) {
setCoolStepDecrement((int)theEvent.group().value());
} else if ("coolStepMin".equals(theEvent.group().name())) {
setCoolStepMin((int)theEvent.group().value());
}
}
else if (theEvent.isTab()) {
activeTab = theEvent.tab();
println("Tab: "+activeTab.name());
}
}

@ -0,0 +1,75 @@
#######################################
# Syntax Coloring Map For Test
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
Stepper TMC26XStepper
#######################################
# Methods and Functions (KEYWORD2)
#######################################
start KEYWORD2
step KEYWORD2
setSpeed KEYWORD2
getSpeed KEYWORD2
setMicrosteps KEYWORD2
getMicrosteps KEYWORD2
move KEYWORD2
isMoving KEYWORD2
getStepsLeft KEYWORD2
stop KEYWORD2
setConstantOffTimeChopper KEYWORD2
setSpreadCycleChopper KEYWORD2
setRandomOffTime KEYWORD2
setCurrent KEYWORD2
getCurrent KEYWORD2
setStallGuardThreshold KEYWORD2
getStallGuardThreshold KEYWORD2
getStallGuardFilter KEYWORD2
setCoolStepConfiguration KEYWORD2
setCoolStepEnabled KEYWORD2
isCoolStepEnabled KEYWORD2
getCoolStepLowerSgThreshold KEYWORD2
getCoolStepUpperSgThreshold KEYWORD2
getCoolStepNumberOfSGReadings KEYWORD2
getCoolStepCurrentIncrementSize KEYWORD2
getCoolStepLowerCurrentLimit KEYWORD2
getMotorPosition KEYWORD2
getCurrentStallGuardReading KEYWORD2
getCurrentCSReading KEYWORD2
isCurrentScalingHalfed KEYWORD2
getCurrentCurrent KEYWORD2
isStallGuardOverThreshold KEYWORD2
getOverTemperature KEYWORD2
isShortToGroundA KEYWORD2
isShortToGroundB KEYWORD2
isOpenLoadA KEYWORD2
isOpenLoadB KEYWORD2
isStandStill KEYWORD2
isStallGuardReached KEYWORD2
setEnabled KEYWORD2
isEnabled KEYWORD2
readStatus KEYWORD2
getResistor KEYWORD2
debugLastStatus KEYWORD2
version KEYWORD2
######################################
# Instances (KEYWORD2)
#######################################
#######################################
# Constants (LITERAL1)
#######################################
TMC262_OVERTEMPERATURE_PREWARING LITERAL1
TMC262_OVERTEMPERATURE_SHUTDOWN LITERAL1
TMC262_READOUT_POSITION LITERAL1
TMC262_READOUT_STALLGUARD LITERAL1
TMC262_READOUT_CURRENT LITERAL1
COOL_STEP_HALF_CS_LIMIT LITERAL1
COOL_STEP_QUARTDER_CS_LIMIT LITERAL1

@ -0,0 +1,30 @@
/*!
* \mainpage TMC 260, 261, 262 Stepper Driver for Arduino
* \author Interactive MAtter, MArcus Nowotny, marcus@interactive-matter.eu
* \section HOWTO How to use the driver
* Here we go with aminial how to description
*
*
* \section COPYRIGHT_NOTIFICATION COPYRIGHT NOTIFICATION
* \par (c) 2011 Interactive MAtter, Marcus Nowotny
*
* \par
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/

@ -461,6 +461,67 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#endif
#endif
/******************************************************************************\
* enable this section if you have TMC26X motor drivers.
* you need to import the TMC26XStepper library into the arduino IDE for this
******************************************************************************/
#define HAVE_TMCDRIVER
#ifdef HAVE_TMCDRIVER
#define X_IS_TMC
#define X_MAX_CURRENT 2000 //in mA
#define X_SENSE_RESISTOR 91 //in mOhms
#define X_MICROSTEPS 16 //number of microsteps
// #define X2_IS_TMC
#define X2_MAX_CURRENT 2000 //in mA
#define X2_SENSE_RESISTOR 91 //in mOhms
#define X2_MICROSTEPS 16 //number of microsteps
#define Y_IS_TMC
#define Y_MAX_CURRENT 2000 //in mA
#define Y_SENSE_RESISTOR 91 //in mOhms
#define Y_MICROSTEPS 16 //number of microsteps
// #define Y2_IS_TMC
#define Y2_MAX_CURRENT 2000 //in mA
#define Y2_SENSE_RESISTOR 91 //in mOhms
#define Y2_MICROSTEPS 16 //number of microsteps
#define Z_IS_TMC
#define Z_MAX_CURRENT 2000 //in mA
#define Z_SENSE_RESISTOR 91 //in mOhms
#define Z_MICROSTEPS 16 //number of microsteps
// #define Z2_IS_TMC
#define Z2_MAX_CURRENT 2000 //in mA
#define Z2_SENSE_RESISTOR 91 //in mOhms
#define Z2_MICROSTEPS 16 //number of microsteps
#define E0_IS_TMC
#define E0_MAX_CURRENT 2000 //in mA
#define E0_SENSE_RESISTOR 91 //in mOhms
#define E0_MICROSTEPS 16 //number of microsteps
#define E1_IS_TMC
#define E1_MAX_CURRENT 2000 //in mA
#define E1_SENSE_RESISTOR 91 //in mOhms
#define E1_MICROSTEPS 16 //number of microsteps
// #define E2_IS_TMC
#define E2_MAX_CURRENT 2000 //in mA
#define E2_SENSE_RESISTOR 91 //in mOhms
#define E2_MICROSTEPS 16 //number of microsteps
// #define E3_IS_TMC
#define E3_MAX_CURRENT 2000 //in mA
#define E3_SENSE_RESISTOR 91 //in mOhms
#define E3_MICROSTEPS 16 //number of microsteps
#endif
//===========================================================================
//============================= Define Defines ============================
//===========================================================================

@ -54,3 +54,8 @@
#if defined(DIGIPOT_I2C)
#include <Wire.h>
#endif
#ifdef HAVE_TMCDRIVER
#include <SPI.h>
#include <TMC26XStepper.h>
#endif

@ -33,7 +33,6 @@
#include <SPI.h>
#endif
//===========================================================================
//=============================public variables ============================
//===========================================================================
@ -88,6 +87,37 @@ static bool check_endstops = true;
volatile long count_position[NUM_AXIS] = { 0, 0, 0, 0};
volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1};
// Stepper objects of TMC steppers are used
#ifdef X_IS_TMC
TMC26XStepper stepperX(200,X_ENABLE_PIN,X_STEP_PIN,X_DIR_PIN,X_MAX_CURRENT,X_SENSE_RESISTOR);
#endif
#ifdef X2_IS_TMC
TMC26XStepper stepperX2(200,X2_ENABLE_PIN,X2_STEP_PIN,X2_DIR_PIN,X2_MAX_CURRENT,X2_SENSE_RESISTOR);
#endif
#ifdef Y_IS_TMC
TMC26XStepper stepperY(200,Y_ENABLE_PIN,Y_STEP_PIN,Y_DIR_PIN,Y_MAX_CURRENT,Y_SENSE_RESISTOR);
#endif
#ifdef Y2_IS_TMC
TMC26XStepper stepperY2(200,Y2_ENABLE_PIN,Y2_STEP_PIN,Y2_DIR_PIN,Y2_MAX_CURRENT,Y2_SENSE_RESISTOR);
#endif
#ifdef Z_IS_TMC
TMC26XStepper stepperZ(200,Z_ENABLE_PIN,Z_STEP_PIN,Z_DIR_PIN,Z_MAX_CURRENT,Z_SENSE_RESISTOR);
#endif
#ifdef Z2_IS_TMC
TMC26XStepper stepperZ2(200,Z2_ENABLE_PIN,Z2_STEP_PIN,Z2_DIR_PIN,Z2_MAX_CURRENT,Z2_SENSE_RESISTOR);
#endif
#ifdef E0_IS_TMC
TMC26XStepper stepperE0(200,E0_ENABLE_PIN,E0_STEP_PIN,E0_DIR_PIN,E0_MAX_CURRENT,E0_SENSE_RESISTOR);
#endif
#ifdef E1_IS_TMC
TMC26XStepper stepperE1(200,E1_ENABLE_PIN,E1_STEP_PIN,E1_DIR_PIN,E1_MAX_CURRENT,E1_SENSE_RESISTOR);
#endif
#ifdef E2_IS_TMC
TMC26XStepper stepperE2(200,E2_ENABLE_PIN,E2_STEP_PIN,E2_DIR_PIN,E2_MAX_CURRENT,E2_SENSE_RESISTOR);
#endif
#ifdef E3_IS_TMC
TMC26XStepper stepperE3(200,E3_ENABLE_PIN,E3_STEP_PIN,E3_DIR_PIN,E3_MAX_CURRENT,E3_SENSE_RESISTOR);
#endif
//===========================================================================
//=============================functions ============================
//===========================================================================
@ -838,6 +868,11 @@ void st_init()
digipot_init(); //Initialize Digipot Motor Current
microstep_init(); //Initialize Microstepping Pins
// initialise TMC Steppers
#ifdef HAVE_TMCDRIVER
tmc_init();
#endif
//Initialize Dir Pins
#if defined(X_DIR_PIN) && X_DIR_PIN > -1
X_DIR_INIT;
@ -1386,3 +1421,48 @@ void microstep_readings()
#endif
}
#ifdef HAVE_TMCDRIVER
void tmc_init()
{
#ifdef X_IS_TMC
stepperX.setMicrosteps(X_MICROSTEPS);
stepperX.start();
#endif
#ifdef X2_IS_TMC
stepperX2.setMicrosteps(X2_MICROSTEPS);
stepperX2.start();
#endif
#ifdef Y_IS_TMC
stepperY.setMicrosteps(Y_MICROSTEPS);
stepperY.start();
#endif
#ifdef Y2_IS_TMC
stepperY2.setMicrosteps(Y2_MICROSTEPS);
stepperY2.start();
#endif
#ifdef Z_IS_TMC
stepperZ.setMicrosteps(Z_MICROSTEPS);
stepperZ.start();
#endif
#ifdef Z2_IS_TMC
stepperZ2.setMicrosteps(Z2_MICROSTEPS);
stepperZ2.start();
#endif
#ifdef E0_IS_TMC
stepperE0.setMicrosteps(E0_MICROSTEPS);
stepperE0.start();
#endif
#ifdef E1_IS_TMC
stepperE1.setMicrosteps(E1_MICROSTEPS);
stepperE1.start();
#endif
#ifdef E2_IS_TMC
stepperE2.setMicrosteps(E2_MICROSTEPS);
stepperE2.start();
#endif
#ifdef E3_IS_TMC
stepperE3.setMicrosteps(E3_MICROSTEPS);
stepperE3.start();
#endif
}
#endif

@ -24,6 +24,11 @@
#include "planner.h"
#include "stepper_indirection.h"
#ifdef HAVE_TMCDRIVER
#include <SPI.h>
#include <TMC26XStepper.h>
#endif
#if EXTRUDERS > 3
#define WRITE_E_STEP(v) { if(current_block->active_extruder == 3) { E3_STEP_WRITE(v); } else { if(current_block->active_extruder == 2) { E2_STEP_WRITE(v); } else { if(current_block->active_extruder == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}}}
#define NORM_E_DIR() { if(current_block->active_extruder == 3) { E3_DIR_WRITE( !INVERT_E3_DIR); } else { if(current_block->active_extruder == 2) { E2_DIR_WRITE(!INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { E1_DIR_WRITE(!INVERT_E1_DIR); } else { E0_DIR_WRITE(!INVERT_E0_DIR); }}}}
@ -101,6 +106,39 @@ void microstep_readings();
void babystep(const uint8_t axis,const bool direction); // perform a short step with a single stepper motor, outside of any convention
#endif
#ifdef HAVE_TMCDRIVER
void tmc_init();
#ifdef X_IS_TMC
extern TMC26XStepper stepperX;
#endif
#ifdef X2_IS_TMC
extern TMC26XStepper stepperX2;
#endif
#ifdef Y_IS_TMC
extern TMC26XStepper stepperY;
#endif
#ifdef Y2_IS_TMC
extern TMC26XStepper stepperY2;
#endif
#ifdef Z_IS_TMC
extern TMC26XStepper stepperZ;
#endif
#ifdef Z2_IS_TMC
extern TMC26XStepper stepperZ2;
#endif
#ifdef E0_IS_TMC
extern TMC26XStepper stepperE0;
#endif
#ifdef E1_IS_TMC
extern TMC26XStepper stepperE1;
#endif
#ifdef E2_IS_TMC
extern TMC26XStepper stepperE2;
#endif
#ifdef E3_IS_TMC
extern TMC26XStepper stepperE3;
#endif
#endif
#endif

@ -152,5 +152,111 @@
#define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE)
#define E3_ENABLE_READ READ(E3_ENABLE_PIN)
//////////////////////////////////
// Pin redefines for TMC drivers.
// TMC26X drivers have step and dir on normal pins, but everything else via SPI
//////////////////////////////////
#ifdef HAVE_TMCDRIVER
#ifdef X_IS_TMC
#undef X_ENABLE_INIT
#define X_ENABLE_INIT
#undef X_ENABLE_WRITE
#define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE)
#undef X_ENABLE_READ
#define X_ENABLE_READ stepperX.isEnabled()
#endif
#ifdef X2_IS_TMC
#undef X2_ENABLE_INIT
#define X2_ENABLE_INIT
#undef X2_ENABLE_WRITE
#define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE)
#undef X2_ENABLE_READ
#define X2_ENABLE_READ stepperX2.isEnabled()
#endif
#ifdef Y_IS_TMC
#undef Y_ENABLE_INIT
#define Y_ENABLE_INIT
#undef Y_ENABLE_WRITE
#define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE)
#undef Y_ENABLE_READ
#define Y_ENABLE_READ stepperY.isEnabled()
#endif
#ifdef Y2_IS_TMC
#undef Y2_ENABLE_INIT
#define Y2_ENABLE_INIT
#undef Y2_ENABLE_WRITE
#define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE)
#undef Y2_ENABLE_READ
#define Y2_ENABLE_READ stepperY2.isEnabled()
#endif
#ifdef Z_IS_TMC
#undef Z_ENABLE_INIT
#define Z_ENABLE_INIT
#undef Z_ENABLE_WRITE
#define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE)
#undef Z_ENABLE_READ
#define Z_ENABLE_READ stepperZ.isEnabled()
#endif
#ifdef Z2_IS_TMC
#undef Z2_ENABLE_INIT
#define Z2_ENABLE_INIT
#undef Z2_ENABLE_WRITE
#define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE)
#undef Z2_ENABLE_READ
#define Z2_ENABLE_READ stepperZ2.isEnabled()
#endif
#ifdef E0_IS_TMC
#undef E0_ENABLE_INIT
#define E0_ENABLE_INIT
#undef E0_ENABLE_WRITE
#define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE)
#undef E0_ENABLE_READ
#define E0_ENABLE_READ stepperE0.isEnabled()
#endif
#ifdef E1_IS_TMC
#undef E1_ENABLE_INIT
#define E1_ENABLE_INIT
#undef E1_ENABLE_WRITE
#define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE)
#undef E1_ENABLE_READ
#define E1_ENABLE_READ stepperE1.isEnabled()
#endif
#ifdef E2_IS_TMC
#undef E2_ENABLE_INIT
#define E2_ENABLE_INIT
#undef E2_ENABLE_WRITE
#define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE)
#undef E2_ENABLE_READ
#define E2_ENABLE_READ stepperE2.isEnabled()
#endif
#ifdef E3_IS_TMC
#undef E3_ENABLE_INIT
#define E3_ENABLE_INIT
#undef E3_ENABLE_WRITE
#define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE)
#undef E3_ENABLE_READ
#define E3_ENABLE_READ stepperE3.isEnabled()
#endif
#endif
#endif

Loading…
Cancel
Save