aboutsummaryrefslogtreecommitdiffstats
path: root/source/language.rst
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-03-30 00:55:51 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-03-30 07:19:13 -0400
commit1e42c8777e04e100d2b1589ae71c6e76a1646eb9 (patch)
treed0de541e0f19b9690092a9044a45f5f03d4e642d /source/language.rst
parentd7d69bf0aa45ef7f9e5b06a30f914c4b7252821d (diff)
downloadlibrambutan-1e42c8777e04e100d2b1589ae71c6e76a1646eb9.tar.gz
librambutan-1e42c8777e04e100d2b1589ae71c6e76a1646eb9.zip
Board-specific values; corresponding QA test generalizations.
Various board-specific #defines and arrays of pins added. For the changelog (some of this information predates this commit): * wirish/boards.h now declares the following arrays of pin numbers: * boardPWMPins - PWM-capable pins * boardADCPins - ADC-capable pins * boardUsedPins - pins already in use, e.g. BOARD_BUTTON_PIN It also declares a bool boardUsesPin(uint8 pin) function for convenient testing of whether a pin is in use. * wirish/boards/*.h now define: * BOARD_USART1_TX_PIN * BOARD_USART1_RX_PIN * BOARD_USART2_TX_PIN * BOARD_USART2_RX_PIN * BOARD_USART3_TX_PIN * BOARD_USART3_RX_PIN * BOARD_NR_GPIO_PINS (renamed from NR_GPIO_PINS) * BOARD_NR_USARTS (renamed from NR_USARTS) * BOARD_NR_PWM_PINS * BOARD_NR_ADC_PINS * BOARD_NR_USED_PINS * wirish/boards/maple_native.h now defines: * BOARD_UART4_TX_PIN * BOARD_UART4_RX_PIN * BOARD_UART5_TX_PIN * BOARD_UART5_RX_PIN (Unfortunately, wirish/boards/maple_RET6.h cannot, since at least one of the UART4/UART5 pins are used already; this will require layout changes for a wide-release Maple form factor RET6 board). * wirish/boards/*.cpp all include the corresponding array definitions. They all live in flash by default, thanks to the new __FLASH__ macro in wirish/wirish_types.h, which is a synonym for the existing __attr_flash #define in libmaple/libmaple_types.h. The documentation was updated to include this information. It also gained various FIXME/TODO comments related to its generalization across boards. The quality assurance-related examples (examples/qa-slave-shield.cpp and examples/test-session.cpp) now make heavy use of board-specific values to ensure portability.
Diffstat (limited to 'source/language.rst')
-rw-r--r--source/language.rst46
1 files changed, 32 insertions, 14 deletions
diff --git a/source/language.rst b/source/language.rst
index d340aec..ea841f5 100644
--- a/source/language.rst
+++ b/source/language.rst
@@ -10,6 +10,9 @@ The Maple can be programmed in the `Wiring
<http://www.wiring.org.co/reference/>`_ language, which is the same
language used to program the `Arduino <http://arduino.cc/>`_ boards.
+.. TODO Wiring tutorial -- just describe setup()/loop(), then link to
+.. some of the the bajillion external tutorials
+
C or C++ programmers curious about the differences between the Wiring
language and C++ may wish to skip to the
:ref:`arduino_c_for_c_hackers`.
@@ -25,6 +28,21 @@ Maple Language Reference
The following table summarizes the available core language features.
A more exhaustive index is available at the :ref:`language-index`.
+**Looking for something else?**
+
+- See the :ref:`libraries` for extra built-in libraries for dealing
+ with different kinds of hardware.
+
+.. FIXME mention Maple Native supports malloc(), free(), operator
+.. new(), and operator delete(), when that is a true thing to say.
+
+- If you're looking for something from the C standard library (like
+ ``atoi()``, for instance): the :ref:`CodeSourcery GCC compiler
+ <arm-gcc>` used to compile your programs is configured to link
+ against `newlib <http://sourceware.org/newlib/>`_, and allows the
+ use of any of its header files. However, dynamic memory allocation
+ (``malloc()``, etc.) is not available.
+
+--------------------------------------------+----------------------------------------------+---------------------------------------------------+
| Structure | Variables | Functions |
| | | |
@@ -40,13 +58,13 @@ A more exhaustive index is available at the :ref:`language-index`.
| |* :ref:`true <lang-constants-true>` | |* :ref:`togglePin() <lang-togglepin>` |
|* :ref:`for <lang-for>` | :ref:`false <lang-constants-false>` | |
| | |* :ref:`toggleLED() <lang-toggleled>` |
-|* :ref:`switch/case <lang-switchcase>` |* :ref:`BOARD_LED_PIN <lang-constants-led>` | | |
-| | :ref:`BOARD_BUTTON_PIN <lang-constants-but>`|* :ref:`isButtonPressed() <lang-isbuttonpressed>` |
-|* :ref:`while <lang-while>` | | |
-| |* :ref:`Constants |* :ref:`waitForButtonPress() |
-|* :ref:`do...while <lang-dowhile>` | <lang-constants>` (:ref:`integers | <lang-waitforbuttonpress>` |
-| | <lang-constants-integers>`, :ref:`floating | |
-|* :ref:`break <lang-break>` | point <lang-constants-fp>`) |**Analog I/O** |
+|* :ref:`switch/case <lang-switchcase>` |* :ref:`Constants | |
+| | <lang-constants>` (:ref:`integers |* :ref:`isButtonPressed() <lang-isbuttonpressed>` |
+|* :ref:`while <lang-while>` | <lang-constants-integers>`, :ref:`floating | |
+| | point <lang-constants-fp>`) |* :ref:`waitForButtonPress() |
+|* :ref:`do...while <lang-dowhile>` | | <lang-waitforbuttonpress>` |
+| |* :ref:`Board-specific values | |
+|* :ref:`break <lang-break>` | <lang-board-values>` |**Analog I/O** |
| | | |
|* :ref:`continue <lang-continue>` |**Data Types** |* :ref:`analogRead() <lang-analogread>` |
| | | |
@@ -76,7 +94,7 @@ A more exhaustive index is available at the :ref:`language-index`.
|**Arithmetic Operators** | <lang-int>` | |
| | |* :ref:`delayMicroseconds() |
|* :ref:`= <lang-assignment>` |* ``unsigned long`` (4 bytes), synonym for | <lang-delaymicroseconds>` |
-| (assignment operator) | :ref:`unsigned int <lang-unsignedint>` | |
+| (assignment) | :ref:`unsigned int <lang-unsignedint>` | |
| | | |
|* :ref:`+ <lang-arithmetic>` (addition) |* :ref:`long long <lang-longlong>` (8 bytes) |**Math** |
| | | |
@@ -153,13 +171,13 @@ A more exhaustive index is available at the :ref:`language-index`.
| | | |
|* :ref:`++ <lang-increment>` | |* :ref:`Serial <lang-serial>` |
| (increment) | | |
-| | |**Looking for something else?** |
+| | | |
|* :ref:`- - <lang-increment>` | | |
-| (decrement) | | See the :ref:`libraries` page for interfacing with|
-| | | particular types of hardware. Maple links |
-|* :ref:`+= <lang-compoundarithmetic>` | | against `newlib <http://sourceware.org/newlib/>`_ |
-| (compound add) | | and allows the use of any of its functions; see |
-| | | its documentation for more details. |
+| (decrement) | | |
+| | | |
+|* :ref:`+= <lang-compoundarithmetic>` | | |
+| (compound add) | | |
+| | | |
|* :ref:`-= | | |
| <lang-compoundarithmetic>` (compound | | |
| subtract) | | |