diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2011-04-25 21:23:00 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2011-04-25 22:03:25 -0400 |
commit | 1b12488ce8b7c69968709b0c1c17975e519b0f5e (patch) | |
tree | dc29e7c5cd22ad57cc52e4eb517174891bc3ea81 /source/lang/api | |
parent | ff0706b87a806451fe0f3a48e5dab8d83cf3e6d9 (diff) | |
download | librambutan-1b12488ce8b7c69968709b0c1c17975e519b0f5e.tar.gz librambutan-1b12488ce8b7c69968709b0c1c17975e519b0f5e.zip |
Better debug port support.
- gpio.h: afio_mapr_swj_config() renamed afio_cfg_debug_ports()
- [new] wirish_debug.h: disableDebugPorts(), enableDebugPorts()
- Maple, Maple Native, and Maple RET6 PIN_MAPs are now larger by 5,
have mappings for the extra JTAG/SW pins.
Documentation was updated appropriately.
Diffstat (limited to 'source/lang/api')
-rw-r--r-- | source/lang/api/board-values.rst | 22 | ||||
-rw-r--r-- | source/lang/api/disabledebugports.rst | 31 | ||||
-rw-r--r-- | source/lang/api/enabledebugports.rst | 31 |
3 files changed, 82 insertions, 2 deletions
diff --git a/source/lang/api/board-values.rst b/source/lang/api/board-values.rst index d6d78f6..e274163 100644 --- a/source/lang/api/board-values.rst +++ b/source/lang/api/board-values.rst @@ -84,8 +84,25 @@ Constants * ``BOARD_NR_USARTS``: Number of serial ports on the board. This number includes UARTs 4 and 5 if they are available. +.. _lang-board-values-debug: + +- Debug (JTAG, SW-Debug) related constants: ``BOARD_JTMS_SWDIO_PIN``, + ``BOARD_JTCK_SWCLK_PIN``, ``BOARD_JTDI_PIN``, ``BOARD_JTDO_PIN``, + and ``BOARD_NJTRST_PIN``. + + These constants are the pin numbers for :ref:`GPIOs <gpio>` used by + the :ref:`jtag` and Serial-Wire Debug peripherals. Except for the + Maple Mini, these pins are usually reserved for special purposes by + default (i.e., they are in :ref:`boardUsedPins + <lang-board-values-used-pins>`). However, they can be used as + ordinary GPIOs if you call the :ref:`lang-disabledebugports` + function. (Be careful with this on the Maple, as writing to + ``BOARD_NJTRST_PIN`` may cause your board to reset!). + .. _lang-board-values-pwm-pins: + .. _lang-board-values-adc-pins: + .. _lang-board-values-used-pins: Pin Arrays @@ -94,8 +111,7 @@ Pin Arrays Some :ref:`arrays <lang-array>` of pin numbers are available which you can use to find out certain important information about a given pin. -.. TODO add links to the board-specific hardware information on what -.. are in these arrays +.. TODO [0.1.0] links to board-specific hardware information - ``boardPWMPins``: Pin numbers of each pin capable of :ref:`PWM <pwm>` output, using :ref:`pwmWrite() <lang-pwmwrite>`. The total @@ -159,3 +175,5 @@ See Also - :ref:`lang-toggleled` - :ref:`lang-analogread` - :ref:`lang-pwmwrite` +- :ref:`lang-enabledebugports` +- :ref:`lang-disabledebugports` diff --git a/source/lang/api/disabledebugports.rst b/source/lang/api/disabledebugports.rst new file mode 100644 index 0000000..43ac337 --- /dev/null +++ b/source/lang/api/disabledebugports.rst @@ -0,0 +1,31 @@ +.. highlight:: cpp + +.. _lang-disabledebugports: + +disableDebugPorts() +=================== + +Used to disable the JTAG and Serial Wire debugging ports. + +Library Documentation +--------------------- + +.. doxygenfunction:: disableDebugPorts + +Example +------- + + :: + + void setup() { + disableDebugPorts(); + } + + void loop() { + // Now you can use the debug port pins as ordinary pins + } + +See Also +-------- + +* :ref:`lang-enabledebugports` diff --git a/source/lang/api/enabledebugports.rst b/source/lang/api/enabledebugports.rst new file mode 100644 index 0000000..bee2b0a --- /dev/null +++ b/source/lang/api/enabledebugports.rst @@ -0,0 +1,31 @@ +.. highlight:: cpp + +.. _lang-enabledebugports: + +enableDebugPorts() +================== + +Used to enable the JTAG and Serial Wire debugging ports. + +Library Documentation +--------------------- + +.. doxygenfunction:: enableDebugPorts + +Example +------- + + :: + + void setup() { + enableDebugPorts(); + // Now you can debug using JTAG and SW-Debug + } + + void loop() { + } + +See Also +-------- + +* :ref:`lang-disabledebugports` |