aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTero Kontkanen <tero.kontkanen@granitedevices.fi>2016-02-04 00:41:59 +0200
committerTero Kontkanen <tero.kontkanen@granitedevices.fi>2016-02-04 00:41:59 +0200
commit8a6591a0e0d483b79c326430c48ab29b8c68b44b (patch)
tree3127b0bb5d2b2c022c4d5e28b7e29d42a2ff19f8
parent3229ad386d4f36e11afe8d65bc54023ab5ab2c8a (diff)
parentb7f2ddf73b03d94533173e7ab2e8c8acd7a0f147 (diff)
downloadSimpleMotionV2-8a6591a0e0d483b79c326430c48ab29b8c68b44b.tar.gz
SimpleMotionV2-8a6591a0e0d483b79c326430c48ab29b8c68b44b.zip
Merge branch 'develop'
-rw-r--r--doc/SMV2Protocol.pngbin0 -> 490470 bytes
-rw-r--r--doc/SMV2Protocol.svg643
-rw-r--r--simplemotion.c74
-rw-r--r--simplemotion.h4
-rw-r--r--simplemotion_defs.h298
-rw-r--r--simplemotion_private.h1
-rw-r--r--sm485.h8
-rw-r--r--sm_consts.c36
8 files changed, 1027 insertions, 37 deletions
diff --git a/doc/SMV2Protocol.png b/doc/SMV2Protocol.png
new file mode 100644
index 0000000..7325afc
--- /dev/null
+++ b/doc/SMV2Protocol.png
Binary files differ
diff --git a/doc/SMV2Protocol.svg b/doc/SMV2Protocol.svg
new file mode 100644
index 0000000..8be482b
--- /dev/null
+++ b/doc/SMV2Protocol.svg
@@ -0,0 +1,643 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="942.66589"
+ height="1512.0173"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="SMV2Protocol.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.7"
+ inkscape:cx="658.67136"
+ inkscape:cy="660.87686"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ showborder="true"
+ inkscape:window-width="2560"
+ inkscape:window-height="1538"
+ inkscape:window-x="-8"
+ inkscape:window-y="-8"
+ inkscape:window-maximized="1"
+ fit-margin-top="55"
+ fit-margin-left="55"
+ fit-margin-right="55"
+ fit-margin-bottom="55">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3129"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(42.665867,417.65518)">
+ <rect
+ style="fill:#dee3db;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="rect3369"
+ width="140"
+ height="150"
+ x="700"
+ y="-187.63782" />
+ <rect
+ style="fill:#ddff55;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="rect3367"
+ width="170"
+ height="150"
+ x="530"
+ y="-187.63782" />
+ <rect
+ style="fill:#f4eed7;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="rect3365"
+ width="190"
+ height="150"
+ x="340"
+ y="-187.63782" />
+ <rect
+ style="fill:#ffeeaa;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="rect3363"
+ width="200"
+ height="150"
+ x="140"
+ y="-187.63782" />
+ <rect
+ style="fill:#ffe680;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none"
+ id="rect3361"
+ width="120"
+ height="150"
+ x="20"
+ y="-187.63782" />
+ <text
+ xml:space="preserve"
+ style="font-size:62.80782318px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="153.61578"
+ y="106.66248"
+ id="text2987"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan2989"
+ x="153.61578"
+ y="106.66248"
+ style="font-size:23.55293465px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">Subpacket 1</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:56.6688652px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="30.15147"
+ y="-156.8459"
+ id="text2987-1-8-7"
+ sodipodi:linespacing="125%"
+ transform="scale(0.99497636,1.005049)"><tspan
+ sodipodi:role="line"
+ id="tspan2989-7-2-1"
+ x="30.15147"
+ y="-156.8459"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">1 byte</tspan><tspan
+ sodipodi:role="line"
+ x="30.15147"
+ y="-130.28236"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3208">Packet</tspan><tspan
+ sodipodi:role="line"
+ x="30.15147"
+ y="-103.71883"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3152">type</tspan><tspan
+ sodipodi:role="line"
+ x="30.15147"
+ y="-77.155304"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3154" /></text>
+ <text
+ xml:space="preserve"
+ style="font-size:56.6688652px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="150.75735"
+ y="-156.8459"
+ id="text2987-1-8-7-1"
+ sodipodi:linespacing="125%"
+ transform="scale(0.99497636,1.005049)"><tspan
+ sodipodi:role="line"
+ x="150.75735"
+ y="-156.8459"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3154-7">0 or 1 bytes</tspan><tspan
+ sodipodi:role="line"
+ x="150.75735"
+ y="-130.28236"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3206">Number of payload</tspan><tspan
+ sodipodi:role="line"
+ x="150.75735"
+ y="-103.71883"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3188">bytes unless</tspan><tspan
+ sodipodi:role="line"
+ x="150.75735"
+ y="-77.155304"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3192">fixed lenght defined </tspan><tspan
+ sodipodi:role="line"
+ x="150.75735"
+ y="-50.59177"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3190">by packet type</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:56.6688652px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="361.81763"
+ y="-156.8459"
+ id="text2987-1-8-7-6"
+ sodipodi:linespacing="125%"
+ transform="scale(0.99497636,1.005049)"><tspan
+ sodipodi:role="line"
+ id="tspan2989-7-2-1-1"
+ x="361.81763"
+ y="-156.8459"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">1 byte</tspan><tspan
+ sodipodi:role="line"
+ x="361.81763"
+ y="-130.28236"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3154-3">Target device</tspan><tspan
+ sodipodi:role="line"
+ x="361.81763"
+ y="-103.71883"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3247">address 1-255 </tspan><tspan
+ sodipodi:role="line"
+ x="361.81763"
+ y="-77.155304"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3251">or 0 if broadcast </tspan><tspan
+ sodipodi:role="line"
+ x="361.81763"
+ y="-50.59177"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3253">to all devices</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:56.6688652px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="552.77698"
+ y="-156.8459"
+ id="text2987-1-8-7-2"
+ sodipodi:linespacing="125%"
+ transform="scale(0.99497636,1.005049)"><tspan
+ sodipodi:role="line"
+ id="tspan2989-7-2-1-2"
+ x="552.77698"
+ y="-156.8459"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">0-120 bytes</tspan><tspan
+ sodipodi:role="line"
+ x="552.77698"
+ y="-130.28236"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3154-8">Payload data</tspan><tspan
+ sodipodi:role="line"
+ x="552.77698"
+ y="-103.71883"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3298">made of</tspan><tspan
+ sodipodi:role="line"
+ x="552.77698"
+ y="-77.155304"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3300">subpackets</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:56.6688652px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="723.63525"
+ y="-156.8459"
+ id="text2987-1-8-7-6-5"
+ sodipodi:linespacing="125%"
+ transform="scale(0.99497636,1.005049)"><tspan
+ sodipodi:role="line"
+ id="tspan2989-7-2-1-1-7"
+ x="723.63525"
+ y="-156.8459"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">2 byte</tspan><tspan
+ sodipodi:role="line"
+ x="723.63525"
+ y="-130.28236"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3253-9">CRC </tspan><tspan
+ sodipodi:role="line"
+ x="723.63525"
+ y="-103.71883"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3359">checksum</tspan></text>
+ <rect
+ style="fill:#e5ff80;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="rect3363-2"
+ width="200"
+ height="120"
+ x="174"
+ y="128.36221" />
+ <rect
+ style="fill:#ccff00;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none"
+ id="rect3361-7"
+ width="120"
+ height="120"
+ x="53.999996"
+ y="128.36221" />
+ <text
+ xml:space="preserve"
+ style="font-size:56.6688652px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="64.323135"
+ y="157.56667"
+ id="text2987-1-8-7-9"
+ sodipodi:linespacing="125%"
+ transform="scale(0.99497636,1.005049)"><tspan
+ sodipodi:role="line"
+ id="tspan2989-7-2-1-5"
+ x="64.323135"
+ y="157.56667"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">2 bits</tspan><tspan
+ sodipodi:role="line"
+ x="64.323135"
+ y="184.1302"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3154-1">subpacket</tspan><tspan
+ sodipodi:role="line"
+ x="64.323135"
+ y="210.69373"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4200">type and</tspan><tspan
+ sodipodi:role="line"
+ x="64.323135"
+ y="237.25726"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4202">lenght</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:56.6688652px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="184.92902"
+ y="157.56667"
+ id="text2987-1-8-7-1-2"
+ sodipodi:linespacing="125%"
+ transform="scale(0.99497636,1.005049)"><tspan
+ sodipodi:role="line"
+ x="184.92902"
+ y="157.56667"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3154-7-3">6, 14, 22 or 30 bits</tspan><tspan
+ sodipodi:role="line"
+ x="184.92902"
+ y="184.1302"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3190-1">Value data</tspan><tspan
+ sodipodi:role="line"
+ x="184.92902"
+ y="210.69373"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4213">(write / read value</tspan><tspan
+ sodipodi:role="line"
+ x="184.92902"
+ y="237.25726"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4215">of parameter)</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:62.80782318px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="593.61578"
+ y="106.6625"
+ id="text2987-3"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan2989-8"
+ x="593.61578"
+ y="106.6625"
+ style="font-size:23.55293465px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">Subpacket N</tspan></text>
+ <rect
+ style="fill:#e5ff80;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="rect3363-2-7"
+ width="200"
+ height="120"
+ x="614"
+ y="128.36221" />
+ <rect
+ style="fill:#ccff00;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none"
+ id="rect3361-7-4"
+ width="120"
+ height="120"
+ x="494"
+ y="128.36221" />
+ <text
+ xml:space="preserve"
+ style="font-size:56.6688652px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="506.54468"
+ y="157.56667"
+ id="text2987-1-8-7-9-2"
+ sodipodi:linespacing="125%"
+ transform="scale(0.99497636,1.005049)"><tspan
+ sodipodi:role="line"
+ id="tspan2989-7-2-1-5-7"
+ x="506.54468"
+ y="157.56667"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">2 bits</tspan><tspan
+ sodipodi:role="line"
+ x="506.54468"
+ y="184.1302"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3154-1-7">subpacket</tspan><tspan
+ sodipodi:role="line"
+ x="506.54468"
+ y="210.69373"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4200-9">type and</tspan><tspan
+ sodipodi:role="line"
+ x="506.54468"
+ y="237.25726"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4202-3">lenght</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:56.6688652px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="627.15057"
+ y="157.56667"
+ id="text2987-1-8-7-1-2-1"
+ sodipodi:linespacing="125%"
+ transform="scale(0.99497636,1.005049)"><tspan
+ sodipodi:role="line"
+ x="627.15057"
+ y="157.56667"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3154-7-3-9">6, 14, 22 or 30 bits</tspan><tspan
+ sodipodi:role="line"
+ x="627.15057"
+ y="184.1302"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3190-1-8">Value data</tspan><tspan
+ sodipodi:role="line"
+ x="627.15057"
+ y="210.69373"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4213-6">(write / read value</tspan><tspan
+ sodipodi:role="line"
+ x="627.15057"
+ y="237.25726"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4215-5">of parameter)</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:66.42854309px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="394"
+ y="193.36221"
+ id="text4296"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan4298"
+ x="394"
+ y="193.36221">. . .</tspan></text>
+ <path
+ style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 530,-17.637817 530,2.3621826 53.999998,88.36222 l 0,20"
+ id="path4302"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccc" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 700,-17.637817 0,19.9999996 114,86.0000374 0,20"
+ id="path4304"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccc" />
+ <text
+ xml:space="preserve"
+ style="font-size:62.80782318px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="180"
+ y="-247.63782"
+ id="text2987-0"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ x="180"
+ y="-247.63782"
+ style="font-size:23.55293465px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4327">SimpleMotion V2 outbound or inbound packet</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="301.42856"
+ y="-281.20926"
+ id="text4331"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan4333"
+ x="301.42856"
+ y="-281.20926"></tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:53.08763885px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="340"
+ y="-217.63782"
+ id="text2987-0-8"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ x="340"
+ y="-217.63782"
+ style="font-size:19.90786552px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4327-6">3 - 125 bytes total</tspan></text>
+ <rect
+ style="fill:#ffe680;fill-opacity:1;stroke:#000000;stroke-width:1.99999988;stroke-miterlimit:4;stroke-dasharray:none"
+ id="rect3361-6"
+ width="820"
+ height="300"
+ x="23.999998"
+ y="302.36221" />
+ <text
+ xml:space="preserve"
+ style="font-size:56.6688652px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="34.171661"
+ y="330.69238"
+ id="text2987-1-8-7-13"
+ sodipodi:linespacing="125%"
+ transform="scale(0.99497636,1.005049)"><tspan
+ sodipodi:role="line"
+ id="tspan2989-7-2-1-8"
+ x="34.171661"
+ y="330.69238"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">Packet types</tspan><tspan
+ sodipodi:role="line"
+ x="34.171661"
+ y="357.25592"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4450" /><tspan
+ sodipodi:role="line"
+ x="34.171661"
+ y="383.81946"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3152-3">Outbound (host to devices):</tspan><tspan
+ sodipodi:role="line"
+ x="34.171661"
+ y="410.38297"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4442">- execute payload subpackets instantly</tspan><tspan
+ sodipodi:role="line"
+ x="34.171661"
+ y="436.9465"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4438">- place payload subpackets in buffer executed by timed fashion</tspan><tspan
+ sodipodi:role="line"
+ x="34.171661"
+ y="463.51004"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4440">- get device clock value (used to sync buffered execution)</tspan><tspan
+ sodipodi:role="line"
+ x="34.171661"
+ y="490.07358"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4452" /><tspan
+ sodipodi:role="line"
+ x="34.171661"
+ y="516.63708"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4444">Inbound (device to host)</tspan><tspan
+ sodipodi:role="line"
+ x="34.171661"
+ y="543.20062"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4446">- Return data packets (one type for each outbound type),</tspan><tspan
+ sodipodi:role="line"
+ x="34.171661"
+ y="569.76416"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4448"> these contain payload data (read values) or clock value</tspan><tspan
+ sodipodi:role="line"
+ x="34.171661"
+ y="596.3277"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3154-4" /></text>
+ <rect
+ style="fill:#ccff00;fill-opacity:1;stroke:#000000;stroke-width:1.99999976;stroke-miterlimit:4;stroke-dasharray:none"
+ id="rect3361-7-46"
+ width="820"
+ height="396.00003"
+ x="23.999998"
+ y="642.36218" />
+ <text
+ xml:space="preserve"
+ style="font-size:56.6688652px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="34.171665"
+ y="668.98511"
+ id="text2987-1-8-7-9-0"
+ sodipodi:linespacing="125%"
+ transform="scale(0.99497636,1.005049)"><tspan
+ sodipodi:role="line"
+ id="tspan2989-7-2-1-5-6"
+ x="34.171665"
+ y="668.98511"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">Subpacket types</tspan><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="695.54865"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan3154-1-6" /><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="722.11218"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4491">Outbound</tspan><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="748.67572"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4489">- set parameter address where next values are written to, 2 bytes long</tspan><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="775.23926"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4487">- write parameter value, 3 or 4 bytes long</tspan><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="801.8028"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4533" /><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="828.36627"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4543">Inbound</tspan><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="854.92981"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4552">- SM bus status value, 1 byte long</tspan><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="881.49335"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4554">- read parameter value, 2, 3 or 4 bytes long</tspan><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="908.05688"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4558" /><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="934.62042"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4531">Each outbound subpacket will give one inbound subpacket in return when device</tspan><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="961.18396"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4537">sends the response to a SM packet. Content of inbound subpackets are defined by</tspan><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="987.7475"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4539">writable parameters SMP_RETURN_PARAM_ADDR and </tspan><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="1014.311"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4541">SMP_RETURN_PARAM_LEN.</tspan><tspan
+ sodipodi:role="line"
+ x="34.171665"
+ y="1040.8745"
+ style="font-size:21.25082588px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4202-8" /></text>
+ <text
+ xml:space="preserve"
+ style="font-size:98.96096039px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Audiowide;-inkscape-font-specification:Audiowide"
+ x="10.667066"
+ y="-335.63782"
+ id="text2987-0-4"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ x="10.667066"
+ y="-335.63782"
+ style="font-size:37.11036301px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial"
+ id="tspan4327-9">SimpleMotion V2 Protocol</tspan></text>
+ </g>
+</svg>
diff --git a/simplemotion.c b/simplemotion.c
index 5b09860..cea0238 100644
--- a/simplemotion.c
+++ b/simplemotion.c
@@ -94,7 +94,6 @@ void smDebug( smbus handle, smVerbosityLevel verbositylevel, char *format, ...)
va_end(fmtargs);
fprintf(smDebugOut,"%s: %s",smBus[handle].busDeviceName, buffer);
}
-
}
#else
#define smDebug(...)
@@ -143,6 +142,19 @@ smuint16 calcCRC16Buf(const char *buffer, smuint16 buffer_length)
return (crc_hi << 8 | crc_lo);
}
+smuint8 calcCRC8Buf( smuint8 *buf, int len, int crcinit )
+{
+ int i;
+ smuint8 crc=crcinit;
+
+ for(i=0;i<len;i++)
+ {
+ crc=table_crc8[crc^buf[i]];
+ }
+
+ return crc;
+}
+
SM_STATUS smSetTimeout( smuint16 millsecs )
{
if(millsecs<=5000)
@@ -222,7 +234,7 @@ LIB SM_STATUS smCloseBus( const smbus bushandle )
if( smBDClose(smBus[bushandle].bdHandle) == smfalse ) return recordStatus(bushandle,SM_ERR_BUS);
- return recordStatus(bushandle,SM_OK);
+ return SM_OK;
}
char *cmdidToStr(smuint8 cmdid )
@@ -242,6 +254,8 @@ char *cmdidToStr(smuint8 cmdid )
#endif
case SMCMD_GET_CLOCK: str="SMCMD_GET_CLOCK";break;
case SMCMD_GET_CLOCK_RET :str="SMCMD_GET_CLOCK_RET";break;
+ case SMCMD_FAST_UPDATE_CYCLE:str="SMCMD_FAST_UPDATE_CYCLE";break;
+ case SMCMD_FAST_UPDATE_CYCLE_RET:str="SMCMD_FAST_UPDATE_CYCLE_RET";break;
default: str="unknown cmdid";break;
}
//puts(str);
@@ -323,6 +337,62 @@ SM_STATUS smSendSMCMD( smbus handle, smuint8 cmdid, smuint8 addr, smuint8 datale
}
+SM_STATUS smFastUpdateCycle( smbus handle, smuint8 nodeAddress, smuint16 write1, smuint16 write2, smuint16 *read1, smuint16 *read2)
+{
+ //check if bus handle is valid & opened
+ if(smIsHandleOpen(handle)==smfalse) return SM_ERR_NODEVICE;
+
+ smDebug(handle, Mid, "> %s (addr=%d, w1=%d, w2=%d)\n",cmdidToStr(SMCMD_FAST_UPDATE_CYCLE),
+ nodeAddress,
+ write1,write2);
+
+
+ //form the tx packet
+ smuint8 cmd[8];
+ int i;
+ cmd[0]=SMCMD_FAST_UPDATE_CYCLE;
+ cmd[1]=nodeAddress;
+ bufput16bit(cmd,2,write1);
+ bufput16bit(cmd,4,write2);
+ cmd[6]=calcCRC8Buf(cmd,6,0x52);
+
+ //send
+ for(i=0;i<7;i++)
+ {
+ if( smWriteByte(handle,cmd[i], NULL) != smtrue )
+ return recordStatus(handle,SM_ERR_BUS);
+ }
+ smTransmitBuffer(handle);//this sends the bytes entered with smWriteByte
+
+ smDebug(handle, High, " Reading reply packet\n");
+ for(i=0;i<6;i++)
+ {
+ smbool success;
+ smuint8 rx;
+ success=smBDRead(smBus[handle].bdHandle,&rx);
+ cmd[i]=rx;
+ if(success!=smtrue)
+ return recordStatus(handle,SM_ERR_BUS|SM_ERR_LENGTH);//no enough data received
+ }
+
+ //parse
+ if( cmd[5]!=calcCRC8Buf(cmd,5,0x52) || cmd[0]!=SMCMD_FAST_UPDATE_CYCLE_RET )
+ {
+ return recordStatus(handle,SM_ERR_COMMUNICATION);//packet error
+ }
+ if(read1!=NULL)
+ *read1=bufget16bit(cmd,1);
+ if(read2!=NULL)
+ *read2=bufget16bit(cmd,3);
+
+ //return data read complete
+ smDebug(handle,Mid, "< %s (id=%d, r1=%d, r2=%d)\n",
+ cmdidToStr( cmd[0] ),
+ cmd[0],*read1,*read2);
+
+ return recordStatus(handle,SM_OK);
+}
+
SM_STATUS smReceiveErrorHandler( smbus handle, smbool flushrx )
diff --git a/simplemotion.h b/simplemotion.h
index 28743c4..056c745 100644
--- a/simplemotion.h
+++ b/simplemotion.h
@@ -134,6 +134,10 @@ LIB SM_STATUS smSetParameter( const smbus handle, const smaddr nodeAddress, cons
LIB SM_STATUS smGetBufferClock( const smbus handle, const smaddr targetaddr, smuint16 *clock );
+/** smFastUpdateCycle uses special SimpleMotion command to perform fast turaround communication. May be used with cyclic real time control. Parameter & return data
+ *content are application specific and defined . */
+LIB SM_STATUS smFastUpdateCycle( smbus handle, smuint8 nodeAddress, smuint16 write1, smuint16 write2, smuint16 *read1, smuint16 *read2);
+
#ifdef __cplusplus
}
#endif
diff --git a/simplemotion_defs.h b/simplemotion_defs.h
index c0a0e78..d5f6630 100644
--- a/simplemotion_defs.h
+++ b/simplemotion_defs.h
@@ -17,6 +17,51 @@
* 8191 NOP command. if SM command SMPCMD_SET_PARAM_ADDR with SMP_ADDR_NOP as parameter is sent, no actions are taken in nodes. it's NOP (no operation) command.
*/
+/* SMV2 protocol change log:
+ * Version 20:
+ * -V20 was introduced with Argon FW 1.0.0 and present at least until 1.4.0
+ * Version 21 (is backwards compatible in syntax but not in setpoint behavior, see details below):
+ * -V25 was introduced with IONI
+ * -setpoint calculation is different:
+ * now there is only one common setpoint and all ABS and INC commands (buffered & instant)
+ * change the same variable. In V20 there was separate setpoint variables for each stream
+ * (instant & buffered) and for INC and ABS separately and finally all setpoints were summed together.
+ * Formula for total setpoint is = SMV2setpoint+OptionalPhysicalSetpoint (step/dir, analog etc)
+ * -in buffered stream, only setpoint commands execute on timed pace. all others execute as fast as possible.
+ * this makes it possible to insert any parameter read/write commands in middle of buffered motion.
+ * -implemented watchdog functionality in new param SMP_FAULT_BEHAVIOR
+ * -added param SMP_ADDRESS_OFFSET
+ */
+
+/* Important when using SMV2 protocol:
+ *
+ * SMP_SM_VERSION_COMPAT defines the oldest SM bus version in which the current version is
+ * fully backwards compatible. If you write app that supports SM bus versions between N and M (i.e. N=20 M=25),
+ * then check that connected device complies with the test (pseudo code):
+ *
+ *
+ smuint32 NEWEST_SUPPORTED_SMV2_VERSION=M;
+ smuint32 OLDEST_SUPPORTED_SMV2_VERSION=N;
+ smuint32 smv2version=getParam(SMP_SM_VERSION);
+ smuint32 smv2compatversion=getParam(SMP_SM_COMPAT_VERSION);
+
+ if(smv2version>NEWEST_SUPPORTED_SMV2_VERSION && smv2compatversion>NEWEST_SUPPORTED_SMV2_VERSION)
+ {
+ error("SimpleMotion protocol version too new, not supported by this software version. Check for upgrades. Connected SMV2 Version: " + smv2version);
+ return false;
+ }
+ if(smv2version<OLDEST_SUPPORTED_SMV2_VERSION && smv2compatversion < OLDEST_SUPPORTED_SMV2_VERSION)
+ {
+ error("SimpleMotion protocol version too old, not supported by this software version. Try older versions. Connected SMV2 Version: " + smv2version);
+ return false;
+ }
+ *
+ * If test fails, then connected device may not be compatible with your app.
+ *
+ * Its strongly recommended to read these paramers and verify compatibility before any other actions
+ * and do same kind of test also with SMP_FIRMWARE_VERSION and SMP_FIRMWARE_BACKWARDS_COMP_VERSION.
+ */
+
#ifndef SIMPLEMOTION_DEFS_H_
#define SIMPLEMOTION_DEFS_H_
@@ -32,14 +77,7 @@
#endif
-//SMP command types
-#define SMPCMD_SETPARAMADDR 2
-#define SMPCMD_24B 1
-#define SMPCMD_32B 0
-#define SMPRET_OTHER 3
-#define SMPRET_16B 2
-#define SMPRET_24B 1
-#define SMPRET_32B 0
+
/*
@@ -59,15 +97,69 @@
//mask for addresses
#define SMP_ADDRESS_BITS_MASK 0x1FFF //E=1110
+/*
+ * SM payload command types and return value types.
+ */
//SMP packet header bits (2 bits). These determine content length and type
-#define SMPCMD_SET_PARAM_ADDR 2
-#define SMPCMD_24B 1
-#define SMPCMD_32B 0
-#define SMPRET_CMD_STATUS 3
-#define SMPRET_16B 2
-#define SMPRET_24B 1
-#define SMPRET_32B 0
+#define SMPCMD_SETPARAMADDR 2 //Deprecated name, dont use these. Use new names seen below
+#define SMPCMD_SET_PARAM_ADDR 2 //Deprecated name, dont use these. Use new names seen below
+#define SMPCMD_24B 1 //Deprecated name, dont use these. Use new names seen below
+#define SMPCMD_32B 0 //Deprecated name, dont use these. Use new names seen below
+#define SMPRET_CMD_STATUS 3 //Deprecated name, dont use these. Use new names seen below
+#define SMPRET_OTHER 3 //Deprecated name, dont use these. Use new names seen below
+#define SMPRET_16B 2 //Deprecated name, dont use these. Use new names seen below
+#define SMPRET_24B 1 //Deprecated name, dont use these. Use new names seen below
+#define SMPRET_32B 0 //Deprecated name, dont use these. Use new names seen below
+
+//
+//new naming for the above values (more clear meanings):
+//
+
+//OUTBOUND SM COMMAND PAYLOAD SUBPACKET TYPES
+//each SMCMD_INSTANT_CMD and SMCMD_BUFFERED_CMD payload is filled with subpackets of following types
+ //sets param address (one of SMP_ defines) where next written value goes to.
+ //consumes 2 bytes from payload buffer.
+ #define SM_SET_WRITE_ADDRESS 2
+ //writes value to previously defined address. consumes 3 bytes (24 bits) from payload buffer.
+ //can hold value size up to 22 bits. bits above 22 are clipped (transmitted as 0s)
+ #define SM_WRITE_VALUE_24B 1
+ //writes value to previously defined address. consumes 4 bytes (32 bits) from payload buffer.
+ //can hold value size up to 30 bits. bits above 30 are clipped (transmitted as 0s)
+ #define SM_WRITE_VALUE_32B 0
+
+//INBOUND SM COMMAND PAYLOAD SUBPACKET TYPES
+//each outbound subpacket will return one of these. the type and address what is being returned
+//is defined by parameters SMP_RETURN_PARAM_ADDR and SMP_RETURN_PARAM_LEN
+ //return value contains SM bus status bits (possible faults etc).
+ //consumes 1 byte from payload buffer
+ #define SM_RETURN_STATUS 3
+ //return value contains a read value from address defined by SMP_RETURN_PARAM_ADDR
+ //consumes 2 byte from payload buffer. can contain value up to 14 bits. value greater than 14 bits is clipped (padded with 0s)
+ #define SM_RETURN_VALUE_16B 2
+ //return value contains a read value from address defined by SMP_RETURN_PARAM_ADDR
+ //consumes 3 byte from payload buffer. can contain value up to 14 bits. value greater than 22 bits is clipped (padded with 0s)
+ #define SM_RETURN_VALUE_24B 1
+ //return value contains a read value from address defined by SMP_RETURN_PARAM_ADDR
+ //consumes 4 byte from payload buffer. can contain value up to 30 bits. value greater than 14 bits is clipped (padded with 0s)
+ #define SM_RETURN_VALUE_32B 0
+
+/* subpacket format
+ *
+ * header:
+ * 2 bits packet type which defines also lenght of subpacket
+ * data:
+ * rest of subpacket contains the transmitted value
+ *
+ * example:
+ * SM_WRITE_VALUE_32B packet looks like this
+ *
+ * -2 first bits are 00
+ * -next 30 bits carry the value
+ *
+ * SMV2 library takes care of forming subpackets so user only needs to care about using the macros above
+ *
+ */
//if command is to set param addr to this -> NOP
#define SMP_ADDR_NOP 0x3fff
@@ -88,7 +180,15 @@
#define SMP_NULL 0
#define SMP_NODE_ADDRSS 1
#define SMP_BUS_MODE 2
+//possible values:
+ #define SMP_BUS_MODE_DFU 0
+ #define SMP_BUS_MODE_NORMAL 1
+ #define _SMP_BUS_MODE_LAST 1
+
+/* SMP_SM_VERSION returns current SM protocol version */
#define SMP_SM_VERSION 3
+/* SMP_SM_VERSION_COMPAT defines the oldest SM bus version in which the current version is
+ * fully backwards compatible. */
#define SMP_SM_VERSION_COMPAT 4
#define SMP_BUS_SPEED 5
#define SMP_BUFFER_FREE_BYTES 6
@@ -96,8 +196,24 @@
#define SMP_BUFFERED_CMD_PERIOD 8
#define SMP_RETURN_PARAM_ADDR 9
#define SMP_RETURN_PARAM_LEN 10
+/*SMP_TIMOUT defines how long device waits for one packet to transmit before discarding it. unit 0.1 milliseconds*/
#define SMP_TIMEOUT 12
#define SMP_CUMULATIVE_STATUS 13 //error bits are set here if any, (SMP_CMD_STATUS_... bits). clear by writing 0
+#define SMP_ADDRESS_OFFSET 14 /*used to set or offset device address along physical method, i.e. DIP SW + offset to allow greater range of addresses than switch allows. */
+/* SMP_FAULT_BEHAVIOR defines maximum amount of time between to valid received SM packets to device and other SM
+ * fault behavior that affect drive operation.
+ *
+ * If comm is broken longer than watchdog time, drive will go fault stop state.
+ * Can be used for additional safety stop when drives are controlled only onver SM bus.
+ *
+ * Parameter is bit field:
+ * bit 0 (LSB): enable device fault stop on any SM comm error (CRC, invalid value etc)
+ * bits 1-7: reserved, always 0
+ * bits 8-17: watchdog timeout value. nonzero enables watchdog. scale: 1 count=10ms, so allows 0.01-10.230 s delay.
+ * bits 18-32: reserved, always 0
+ */
+#define SMP_FAULT_BEHAVIOR 15
+
//bit mask
#define SM_BUFCMD_STAT_IDLE 1
@@ -142,6 +258,7 @@
// continue to .. 200
+
/*
* List of motor control parameters.
*
@@ -183,7 +300,7 @@
#define SMP_FIRST_FAULT 8115
#define SMP_STATUS 553
//bitfield bits:
- #define STAT_POWER_ON BV(0)
+ #define STAT_RESERVED_ BV(0)
#define STAT_TARGET_REACHED BV(1)//this is 1 when trajectory planner target reached
#define STAT_FERROR_RECOVERY BV(2)
#define STAT_RUN BV(3)//run is true only if motor is being actually driven. run=0 clears integrators etc
@@ -210,6 +327,23 @@
#define SMP_SYSTEM_SAMPLE_TEST_VARIABLES 8 //production testing function
#define SMP_SYSTEM_START_PRODUCTION_TEST 16 //production testing function
#define SMP_SYSTEM_STOP_PRODUCTION_TEST 32 //production testing function
+ //restart device into DFU mode
+ #define SMP_SYSTEM_CONTROL_RESTART_TO_DFU_MODE 64
+ //read miscellaneous device specific flag bits
+ #define SMP_SYSTEM_CONTROL_GET_FLAGS 128
+ /*start measure motor RL function.
+ * poll debug param 5 for state
+ * -100 fail
+ * 700 busy
+ * 800 success -new RL values inserted in drive params
+ *
+ * SMP_STATUS must obey:
+ * requiredStats=STAT_INITIALIZED|STAT_RUN|STAT_ENABLED|STAT_VOLTAGES_OK;
+ deniedStats=STAT_FERROR_RECOVERY|STAT_PERMANENT_STOP|STAT_STO_ACTIVE|STAT_FAULTSTOP|STAT_HOMING;
+ */
+ #define SMP_SYSTEM_CONTROL_MEASURE_MOTOR_RL 256
+ //resets position mode FB and setpoint values to 0, and also resets homing status. useful after using in vel or torq mode.
+ #define SMP_SYSTEM_CONTROL_RESET_FB_AND_SETPOINT 512
//follow error tolerance for position control:
#define SMP_POS_FERROR_TRIP 555
@@ -228,18 +362,26 @@
#define MOTOR_AC_VECTOR_2PHA 2 /*2 phase ac or bldc */
//3 phase AC motor
#define MOTOR_AC_VECTOR 3 /*3 phase ac or bldc */
+ //2 phase stepper
+ #define MOTOR_STEPPER_2PHA 4 /*2 phase stepper */
//for drive internal use only:
#define _MOTOR_LAST 7
+
+
+
+//position follow error trip point
+//velocity follow error trip point. units: velocity command (counts per PIDcycle * divider)
+
//#define CFG_INPUT_FILTER_LEN 30
#define SMP_CONTROL_MODE 559
//control mode choices:
#define CM_TORQUE 3
#define CM_VELOCITY 2
#define CM_POSITION 1
+ #define CM_NONE 0
#define SMP_INPUT_MULTIPLIER 560
#define SMP_INPUT_DIVIDER 561
-//setpoint source
#define SMP_INPUT_REFERENCE_MODE 562
//choices:
#define SMP_INPUT_REFERENCE_MODE_SERIALONLY 0
@@ -265,24 +407,33 @@
//flag bits & general
#define SMP_DRIVE_FLAGS 567
//bitfield bits:
- #define FLAG_DISABLED_AT_STARTUP BV(0)
- #define FLAG_NO_DCBUS_FAULT BV(1)
- #define FLAG_INVERT_ENCODER BV(3)
- #define FLAG_INVERT_MOTOR_DIRECTION BV(4) /*invert positive direction*/
- #define FLAG_DISABLE_DEADTIMECORR_LO_SPEED BV(5)
- #define FLAG_USE_PULSE_IN_ACCEL_LIMIT BV(7)
- #define FLAG_2PHASE_AC_MOTOR BV(9)
- #define FLAG_ALLOW_VOLTAGE_CLIPPING BV(10)
- #define FLAG_USE_INPUT_LP_FILTER BV(11)
- #define FLAG_USE_PID_CONTROLLER BV(12)//PIV is the default if bit is 0
- #define FLAG_INVERTED_HALLS BV(13)
- #define FLAG_USE_HALLS BV(14)
+ #define FLAG_DISABLED_AT_STARTUP BV(0)
+ #define FLAG_NO_DCBUS_FAULT BV(1)/*obsolete?*/
+ #define FLAG_ENABLE_DIR_INPUT_ON_ABS_SETPOINT BV(2) /*if 1, then use direction input signal for analog and PWM setpoint mode*/
+ #define FLAG_INVERT_ENCODER BV(3)
+ #define FLAG_INVERT_MOTOR_DIRECTION BV(4) /*invert positive direction*/
+ #define FLAG_ENABLE_REQUIRES_PULSING BV(5) /*enable signal must be fed 50hz-1khz toggling signal to validate enable status*/
+ #define FLAG_USE_PULSE_IN_ACCEL_LIMIT BV(7)/*obsolete*/
+ #define FLAG_2PHASE_AC_MOTOR BV(9)/*obsolete*/
+ #define FLAG_ALLOW_VOLTAGE_CLIPPING BV(10)
+ #define FLAG_USE_INPUT_LP_FILTER BV(11)
+ #define FLAG_USE_PID_CONTROLLER BV(12)//PIV is the default if bit is 0/*obsolete*/
+ #define FLAG_INVERTED_HALLS BV(13)
+ #define FLAG_USE_HALLS BV(14)
#define FLAG_MECH_BRAKE_DURING_PHASING BV(15)
+ #define FLAG_LIMIT_SWITCHES_NORMALLY_CLOSED_TYPE BV(16)
#define SMP_MOTION_FAULT_THRESHOLD 568
#define SMP_HV_VOLTAGE_HI_LIMIT 569
#define SMP_HV_VOLTAGE_LOW_LIMIT 570
+#define SMP_MAX_OUTPUT_POWER 571 //in watts
#define SMP_MOTOR_MAX_SPEED 572
+//in Ioni only
+#define SMP_ELECTRICAL_MODE 573
+ #define EL_MODE_STANDARD 0
+ #define EL_MODE_IONICUBE 1
+ #define EL_MODE_IONIZER 2
+
//primary feedback loop 200-299
#define SMP_VEL_I 200
@@ -290,6 +441,7 @@
#define SMP_VEL_P 202
#define SMP_VEL_FF 220
#define SMP_ACC_FF 221
+#define SMP_POS_FF 222
//anti dither limits
#define SMP_ANTIDITHER_MODE 230
@@ -315,6 +467,34 @@
#define SMP_TORQUEFAULT_MARGIN 420
#define SMP_TORQUEFAULT_OC_TOLERANCE 421
+/* next four parameters allow compensation of motor detent torque and torque ripple (cogging torque).
+ * xxx_TORQUE_FUNCTION and xxx_TORQUE_AMPLITUDE sets function, value range is 0-25 and used like:
+ *
+ * if((function%1)==0) xxx_torque_modifier=sin(electrical_angle*(function/2))*amplitude;
+ * else xxx_torque_modifier=cos(electrical_angle*(function/2))*amplitude;
+ *
+ * i.e. functions go like:
+ * 0=no effect (sin(0a))
+ * 1=constant (cos(0a))
+ * 2=sin(1a)
+ * 3=cos(1a)
+ * 4=sin(2a)
+ * 5=cos(a2)
+ * 6=sin(3a)
+ * 7=cos(3a)
+ *
+ *
+ * Detent torque compensation value (static_torque modifier) is added to the original torque setpoint.
+ * Ripple torque compensation value (dynamic_torque modifier) will modulate the original torque setpoint.
+ * Overall formula how these affect to troque output is:
+ *
+ * torqueSetpoint=torqueSetpoint*(dynamic_torque_modifier+1) +static_torque_modifier;
+ */
+#define SMP_MOTOR_STATIC_TORQUE_FUNCTION 424
+#define SMP_MOTOR_STATIC_TORQUE_AMPLITUDE 425
+#define SMP_MOTOR_DYNAMIC_TORQUE_FUNCTION 426
+#define SMP_MOTOR_DYNAMIC_TORQUE_AMPLITUDE 427
+
//motor thermal time constant in seconds:
#define SMP_MOTOR_THERMAL_TIMECONSTANT 430
//how fast to ramp up voltage during phase search:
@@ -330,7 +510,17 @@
#define SMP_AXIS_UNITS 492
//0=none 1=qei1 2=qei2 3=resolver 4=ssi 5=biss
#define SMP_FB1_DEVICE_SELECTION 493
+ #define SMP_FBD_NONE 0
+ #define SMP_FBD_INCR1 1
+ #define SMP_FBD_INCR2 2
+ #define SMP_FBD_RESOLVER 3
+ #define SMP_FBD_SSI 4
+ #define SMP_FBD_BISS 5
+ #define SMP_FBD_SINCOS16X 6
+ #define SMP_FBD_SINCOS64X 7
+ #define SMP_FBD_SINCOS256X 8
#define SMP_FB2_DEVICE_SELECTION 494
+
//in 1/2500 seconds.
#define SMP_GOAL_FAULT_FILTER_TIME 495
//in speed scale
@@ -350,21 +540,23 @@
//bitfiled values:
//CB1 & CB2 enables must be 1 to have drive enabled
//Control bits 1 are controlled by host software
- #define SMP_CB1_ENABLE BV(0)
+ #define SMP_CB1_ENABLE BV(0)//software enable
#define SMP_CB1_CLEARFAULTS BV(1)
- #define SMP_CB1_QUICKSTOP BV(2)
- #define SMP_CB1_USE_TRAJPLANNER BV(3)
+ #define SMP_CB1_QUICKSTOP BV(2)//not implemented at the moment
+ #define SMP_CB1_USE_TRAJPLANNER BV(3)//not implemented at the moment
+ #define SMP_CB1_START_HOMING BV(4)//write 1 here to start homing //not implemented at the moment
#define SMP_STATIC_CBS1 (SMP_CB1_ENABLE|SMP_CB1_USE_TRAJPLANNER)
#define SMP_CONTROL_BITS2 2534
//bitfiled values:
//both enables must be 1 to have drive enabled
- //Control bits 2 are controlled by physical inputs
- #define SMP_CB2_ENABLE BV(0)
+ //Control bits 2 are controlled by physical inputs, dont try to write on these thu SMV2. reading is ok
+ #define SMP_CB2_ENABLE BV(0)//hadrware enable pin
#define SMP_CB2_ENA_POS_FEED BV(1)
#define SMP_CB2_ENA_NEG_FEED BV(2)
#define SMP_CB2_HOMESW_ON BV(3)
#define SMP_CB2_CLEARFAULTS BV(4)
+ #define SMP_CB2_START_HOMING BV(5)
//trajectory planner
#define SMP_TRAJ_PLANNER_ACCEL 800
@@ -407,9 +599,33 @@
#define SMP_SCOPE_CHANNEL_SELECT 905
#define SMP_MECH_BRAKE_RELEASE_DELAY 910
-#define SMP_BRAKE_STOP_ENGAGE_DELAY 911
+#define SMP_MECH_BRAKE_ENGAGE_DELAY 911
#define SMP_DYNAMIC_BRAKING_SPEED 912
+#define SMP_BRAKE_STOP_ENGAGE_DELAY SMP_MECH_BRAKE_ENGAGE_DELAY /* SMP_BRAKE_STOP_ENGAGE_DELAY is old name, kept for compatibility*/
+/*Special torque mode specific settings, currently IONI only. This paramterer is a bitfield
+ * defined as: bits 0-7: option bits, bits 8-29: rotation angle limit (in feedback counts).
+ *
+ * Guide:
+ * 0 = disabled, standard drive operation
+ * nonzero = calculate value by: round(allowed_rotation_in_counts/256)*256 + modebits
+ *
+ * where modebits is a bitfield defined as:
+ * bit 0: input scaling. if true, analog input 0-5V sets torque scale to 10-100%. Note: cant use analog input for torque setpoint now.
+ * bits 1-7: reserved for future use.
+ *
+ * example 1: we want rotation limit of 8000 encoder counts (for each direction) and no scaling input, we
+ * use value 7936.
+ *
+ * example 2: we want rotation limit of 8000 encoder counts (for each direction) and torque
+ * command scaling input, we use value 7937
+
+ * example 3: no rotation limit but just saling is on: use value 1
+ *
+ * Tip: use Granity Ctrl+P (Shortcut) dialog to set value:
+ * http://granitedevices.com/wiki/Reading_and_writing_an_arbitrary_parameter_with_Granity
+ */
+#define SMP_TORQUE_MODE_ATTRIBUTES 920
//////////////////////////////////////////////////////////////////////////////////RUNTIME PARAMS 5000-9999
@@ -463,6 +679,7 @@
//#define RUNTIME_FEATURES1 6000
#define SMP_SERIAL_NR 6002
+#define SMP_UID_NR 6003
#define SMP_DRIVE_CAPABILITIES 6006
#define SMP_FIRMWARE_VERSION 6010
#define SMP_FIRMWARE_BACKWARDS_COMP_VERSION 6011
@@ -479,6 +696,15 @@
#define SMP_TORQUE_CMD_OVERRIDE 8001
#define SMP_OVERRIDE_COMMUTATION_FREQ 8003
#define SMP_OVERRIDE_REGENRES_DUTY 8004
+#define SMP_DEVICE_TEMPERATURE 8007//reported in 0.01 celsius steps
+#define SMP_CURRENT_LIMITED_TO_MA 8008//actual current limit (based on user settings, device temperature, voltage etc)
+#define SMP_CURRENT_LIMIT_REASON 8009 //last reason why current was clampled
+ #define CURR_LIMIT_REASON_NONE 0
+ #define CURR_LIMIT_REASON_VOLTAGE_SATURATION 1
+ #define CURR_LIMIT_REASON_SETTINGS 2
+ #define CURR_LIMIT_REASON_I2T 3
+ #define CURR_LIMIT_REASON_DRIVE_TEMPERATURE 4
+ #define CURR_LIMIT_REASON_POWER_CAP 5
/*IO side CPU sends encoder counter at index every time index is encountered. homing uses this info */
#define SMP_INDEX_PULSE_LOCATION 8005
@@ -518,6 +744,8 @@
//bootloaded status
#define SMP_BOOTLOADER_STAT 193
#define BOOTLOADER_STAT_FLASH_VERIFIED_OK BV(0)
+#define SMP_BOOTLOADER_WRITE_OTP 194
+
/*DFU Bootloader parameters end*/
diff --git a/simplemotion_private.h b/simplemotion_private.h
index 9cfdabc..d1e37a3 100644
--- a/simplemotion_private.h
+++ b/simplemotion_private.h
@@ -38,6 +38,7 @@
extern const smuint8 table_crc16_hi[];
extern const smuint8 table_crc16_lo[];
+extern const smuint8 table_crc8[];
extern FILE *smDebugOut; //such as stderr or file handle. if NULL, debug info disbled
extern smuint16 readTimeoutMs;
diff --git a/sm485.h b/sm485.h
index 40d9fdb..2d79815 100644
--- a/sm485.h
+++ b/sm485.h
@@ -52,6 +52,14 @@
#define SMCMD_GET_CLOCK SMCMD_ID(10,SMCMD_MASK_0_PARAMS)
#define SMCMD_GET_CLOCK_RET SMCMD_ID(10,SMCMD_MASK_2_PARAMS|SMCMD_MASK_RETURN)
+// SMCMD_FAST_UPDATE_CYCLE is a high priority command for fast realtime cyclic operation. content and lenght of
+// payload data may be application specific and may be controlled by other variables
+// cmd u8 ID, u8 toaddr, u32 data u16 crc
+// ret u8 ID, u8 fromaddr, u32 data, u16 crc
+#define SMCMD_FAST_UPDATE_CYCLE SMCMD_ID(2,SMCMD_MASK_0_PARAMS)
+#define SMCMD_FAST_UPDATE_CYCLE_RET SMCMD_ID(2,SMCMD_MASK_0_PARAMS|SMCMD_MASK_RETURN)
+
+
#ifdef PROCESS_IMAGE_SUPPORT
//PROCESS_IMAGE communication not supported by SM V2.0.0. placeholders here
diff --git a/sm_consts.c b/sm_consts.c
index 3ac98bb..62439af 100644
--- a/sm_consts.c
+++ b/sm_consts.c
@@ -59,3 +59,39 @@ const smuint8 table_crc16_lo[] = {
0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42,
0x43, 0x83, 0x41, 0x81, 0x80, 0x40
};
+
+//http://www.maxim-ic.com/appnotes.cfm/an_pk/3749
+const smuint8 table_crc8[] = {
+ 0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15,
+ 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d,
+ 0x70, 0x77, 0x7E, 0x79, 0x6C, 0x6B, 0x62, 0x65,
+ 0x48, 0x4F, 0x46, 0x41, 0x54, 0x53, 0x5A, 0x5D,
+ 0xE0, 0xE7, 0xEE, 0xE9, 0xFC, 0xFB, 0xF2, 0xF5,
+ 0xD8, 0xDF, 0xD6, 0xD1, 0xC4, 0xC3, 0xCA, 0xCD,
+ 0x90, 0x97, 0x9E, 0x99, 0x8C, 0x8B, 0x82, 0x85,
+ 0xA8, 0xAF, 0xA6, 0xA1, 0xB4, 0xB3, 0xBA, 0xBD,
+ 0xC7, 0xC0, 0xC9, 0xCE, 0xDB, 0xDC, 0xD5, 0xD2,
+ 0xFF, 0xF8, 0xF1, 0xF6, 0xE3, 0xE4, 0xED, 0xEA,
+ 0xB7, 0xB0, 0xB9, 0xBE, 0xAB, 0xAC, 0xA5, 0xA2,
+ 0x8F, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9D, 0x9A,
+ 0x27, 0x20, 0x29, 0x2E, 0x3B, 0x3C, 0x35, 0x32,
+ 0x1F, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0D, 0x0A,
+ 0x57, 0x50, 0x59, 0x5E, 0x4B, 0x4C, 0x45, 0x42,
+ 0x6F, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7D, 0x7A,
+ 0x89, 0x8E, 0x87, 0x80, 0x95, 0x92, 0x9B, 0x9C,
+ 0xB1, 0xB6, 0xBF, 0xB8, 0xAD, 0xAA, 0xA3, 0xA4,
+ 0xF9, 0xFE, 0xF7, 0xF0, 0xE5, 0xE2, 0xEB, 0xEC,
+ 0xC1, 0xC6, 0xCF, 0xC8, 0xDD, 0xDA, 0xD3, 0xD4,
+ 0x69, 0x6E, 0x67, 0x60, 0x75, 0x72, 0x7B, 0x7C,
+ 0x51, 0x56, 0x5F, 0x58, 0x4D, 0x4A, 0x43, 0x44,
+ 0x19, 0x1E, 0x17, 0x10, 0x05, 0x02, 0x0B, 0x0C,
+ 0x21, 0x26, 0x2F, 0x28, 0x3D, 0x3A, 0x33, 0x34,
+ 0x4E, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5C, 0x5B,
+ 0x76, 0x71, 0x78, 0x7F, 0x6A, 0x6D, 0x64, 0x63,
+ 0x3E, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2C, 0x2B,
+ 0x06, 0x01, 0x08, 0x0F, 0x1A, 0x1D, 0x14, 0x13,
+ 0xAE, 0xA9, 0xA0, 0xA7, 0xB2, 0xB5, 0xBC, 0xBB,
+ 0x96, 0x91, 0x98, 0x9F, 0x8A, 0x8D, 0x84, 0x83,
+ 0xDE, 0xD9, 0xD0, 0xD7, 0xC2, 0xC5, 0xCC, 0xCB,
+ 0xE6, 0xE1, 0xE8, 0xEF, 0xFA, 0xFD, 0xF4, 0xF3
+};