aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source
diff options
context:
space:
mode:
Diffstat (limited to 'docs/source')
-rw-r--r--docs/source/arduino/doublecast.rst30
-rw-r--r--docs/source/bootloader.rst27
-rw-r--r--docs/source/wirish/serialusb.rst6
3 files changed, 53 insertions, 10 deletions
diff --git a/docs/source/arduino/doublecast.rst b/docs/source/arduino/doublecast.rst
new file mode 100644
index 0000000..9aaf12c
--- /dev/null
+++ b/docs/source/arduino/doublecast.rst
@@ -0,0 +1,30 @@
+.. highlight:: cpp
+
+.. _arduino-doublecast:
+
+double() (cast)
+===============
+
+Description
+-----------
+
+Converts a value to the :ref:`double <arduino-double>` floating point
+data type. Here is an example::
+
+ int x = 2;
+ double d = double(x); // d now holds 2.0, a double value
+
+The value ``x`` can be of any type. However, if ``x`` is not a number
+(like an ``int`` or ``long``), you will get strange results.
+
+See the :ref:`double <arduino-double>` reference for details about the
+precision and limitations of ``double`` values on the Maple.
+
+See Also
+--------
+
+- :ref:`double <arduino-double>`
+- :ref:`float <arduino-float>`
+- :ref:`float() <arduino-floatcast>`
+
+.. include:: cc-attribution.txt
diff --git a/docs/source/bootloader.rst b/docs/source/bootloader.rst
index 4be8e93..46c2cf0 100644
--- a/docs/source/bootloader.rst
+++ b/docs/source/bootloader.rst
@@ -218,20 +218,25 @@ A bootloader packet is composed of a sequence of fields, as follows.
- Description
* - START
- - 2
- - 0x7EAF
+ - 1
+ - 0x1B
- Magic constant, indicates bootloader packet
* - SEQUENCE_NUM
- 1
- - 0--255
+ - 0--0xFF
- Queries and responses must have the same sequence number; rolls
- over to 0 after 255.
+ over to 0 after 0xFF.
* - MESSAGE_SIZE
- 2
- - 0--65,535
- - Size of message body, currently limited to a 512B maximum
+ - 0--0xFFFF
+ - Size of message body, currently limited to a 1024B maximum
+
+ * - TOKEN
+ - 1
+ - 0x7F
+ - Differs from STK500 value of 0x0E
* - MESSAGE_BODY
- Variable, determined by MESSAGE_SIZE field
@@ -240,8 +245,10 @@ A bootloader packet is composed of a sequence of fields, as follows.
* - CHECKSUM
- 4
- - XOR of all other bytes in packet
- -
+ - XOR of all other 32-bit words in packet
+ - Words are checksummed little-endian; however, like all
+ multi-byte fields, the CHECKSUM is transmitted between PC and
+ device in network (big-endian) order.
.. _bootloader-commands:
@@ -253,8 +260,8 @@ and responses are transacted inside of the message body. Following in
the footsteps of the STK-500 protocol, each query or response begins
with the single byte CMD field. For each query, the resultant response
must begin with the same CMD byte. For each type of CMD, the structure
-of queries and responses are of fixed size. As in STK-500, fields
-longer than 1 byte are transmitted MSB first (big endian). However,
+of queries and responses is of fixed size. Following STK-500, fields
+longer than 1 byte are transmitted MSB first (big-endian). However,
READ and WRITE commands operate byte-wise (not word-wise); it is up to
the host PC to ensure that alignment and ordering issues are handled
appropriately.
diff --git a/docs/source/wirish/serialusb.rst b/docs/source/wirish/serialusb.rst
new file mode 100644
index 0000000..d0eac98
--- /dev/null
+++ b/docs/source/wirish/serialusb.rst
@@ -0,0 +1,6 @@
+.. _wirish-serialusb:
+
+Serial over USB Communications
+==============================
+
+Stub.