aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source/language.rst
blob: edc027ddec9324e2350b18f336936c4c17dbc9a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.. _language:

==========================
 Maple Language Reference
==========================

The Maple can be programmed in a mostly-complete subset of the the
`Wiring <http://www.wiring.org.co/reference/>`_ language, which is the
same language used to program the `Arduino <http://arduino.cc/>`_
boards.  The entire language will be supported in a future release.
Please see the extensive `language reference
<http://arduino.cc/en/Reference/HomePage>`_ on the Arduino webpage for
more information, or follow a direct link below.

Unique Maple Additions
----------------------

``ASSERT(...)``
    The ``ASSERT()`` function can be very useful for basic program
    debugging. The function accepts a boolean; for example:

      ``ASSERT(state == WAIT);``

    zero is false and any other number is true. If the boolean is true
    the assertion passes and the program continues as usual. If it is
    false, the assertion fails: the program is halted, debug
    information is printed to USART2, and the status LED begins to
    throb in intensity (it's noticeably different from blinking). The
    debug information is printed at 9600 baud and consists of the
    filename and line number where the particular assertion failed.

    Including assertions in a program increases the program size. When
    using libmaple from the command line, they can be silently
    disabled by setting the ``DEBUG_LEVEL`` variable to ``DEBUG_NONE``
    in `libmaple.h <>`; in this case all assertions pass without any
    lost clock cycles.

Arduino Documentation Links
---------------------------

.. .. list-table:: Frozen Delights!
..    :widths: 15 10 30
..    :header-rows: 1

..    * - Treat
..      - Quantity
..      - Description
..    * - Albatross
..      - 2.99
..      - On a stick!
..    * - Crunchy Frog
..      - 1.49
..      - If we took the bones out, it wouldn't be
..        crunchy, now would it?
..    * - Gannet Ripple
..      - 1.99
..      - On a stick!

.. =====  =====  =======
.. A      B      A and B
.. =====  =====  =======
.. False  False  False
.. True   False  False
.. False  True   False
.. True   True   True
.. =====  =====  =======

.. +------------------------+------------+----------+----------+
.. | Header row, column 1   | Header 2   | Header 3 | Header 4 |
.. | (header rows optional) |            |          |          |
.. +========================+============+==========+==========+
.. | body row 1, column 1   | column 2   | column 3 | column 4 |
.. +------------------------+------------+----------+----------+
.. | body row 2             | ...        | ...      |          |
.. +------------------------+------------+----------+----------+

Recommended Reading
-------------------

* `newlib Documentation <http://sourceware.org/newlib/>`_
* STMicro documentation for STM32F103RB microcontroller:

    * `All documents <http://www.st.com/mcu/devicedocs-STM32F103RB-110.html>`_
    * `Datasheet (pdf) <http://www.st.com/stonline/products/literature/ds/13587.pdf>`_
    * `Reference Manual (pdf) <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_
    * `Programming Manual (pdf) <http://www.st.com/stonline/products/literature/pm/15491.pdf>`_ (assembly language and register reference)