diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-10-22 21:10:34 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-10-22 21:10:34 -0400 |
commit | dd7e6ecdafcb8938e23dfd18a36d70628fbc74bd (patch) | |
tree | 8ed97b472530cc08ded6f906624eaa059949fb6a /docs | |
parent | 22ff1db8a76c7047b61a424ae1fa5f43697fcb34 (diff) | |
download | librambutan-dd7e6ecdafcb8938e23dfd18a36d70628fbc74bd.tar.gz librambutan-dd7e6ecdafcb8938e23dfd18a36d70628fbc74bd.zip |
docs
Diffstat (limited to 'docs')
-rw-r--r-- | docs/1 | 91 | ||||
-rw-r--r-- | docs/Makefile | 2 | ||||
-rw-r--r-- | docs/source/adc.rst | 10 | ||||
-rw-r--r-- | docs/source/arduino/assignment.rst | 13 | ||||
-rw-r--r-- | docs/source/arduino/attachinterrupt.rst | 69 | ||||
-rw-r--r-- | docs/source/epilog.rst | 52 | ||||
-rw-r--r-- | docs/source/external-interrupts.rst | 126 | ||||
-rw-r--r-- | docs/source/foo.rst | 4 | ||||
-rw-r--r-- | docs/source/gpio.rst | 6 | ||||
-rw-r--r-- | docs/source/i2c.rst | 6 | ||||
-rw-r--r-- | docs/source/index.rst | 1 | ||||
-rw-r--r-- | docs/source/jtag.rst | 6 | ||||
-rw-r--r-- | docs/source/language.rst | 10 | ||||
-rw-r--r-- | docs/source/maple-ide-install.rst | 2 | ||||
-rw-r--r-- | docs/source/maple-quickstart.rst | 2 | ||||
-rw-r--r-- | docs/source/pwm.rst | 6 | ||||
-rw-r--r-- | docs/source/spi.rst | 6 | ||||
-rw-r--r-- | docs/source/unix-toolchain.rst | 2 | ||||
-rw-r--r-- | docs/source/usart.rst | 6 | ||||
-rw-r--r-- | docs/source/usb.rst | 8 |
20 files changed, 309 insertions, 119 deletions
@@ -0,0 +1,91 @@ +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/analogreference.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/analogwrite.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/bit.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/bitclear.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/bitread.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/bitset.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/bitshift.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/bitwiseand.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/bitwisecompound.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/bitwisexornot.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/bitwrite.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/boolean.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/booleanvariables.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/braces.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/break.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/byte.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/bytecast.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/changes.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/char.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/charcast.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/comments.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/comparison.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/const.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/constants.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/constrain.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/continue.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/cos.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/define.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/delay.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/delaymicroseconds.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/detachinterrupt.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/digitalread.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/digitalwrite.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/double.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/dowhile.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/else.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/float.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/floatcast.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/for.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/fpconstants.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/goto.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/highbyte.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/if.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/include.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/increment.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/incrementcompound.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/int.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/intcast.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/integerconstants.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/interrupts.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/long.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/longcast.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/loop.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/lowbyte.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/map.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/max.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/micros.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/millis.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/min.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/modulo.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/nointerrupts.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/notone.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/pointer.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/pow.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/pulsein.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/random.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/randomseed.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/return.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/scope.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/semicolon.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/serial.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/setup.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/shiftout.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/sin.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/sizeof.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/sqrt.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/static.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/string.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/stringobject.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/switchcase.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/tan.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/tone.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/unsignedchar.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/unsignedint.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/unsignedlong.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/void.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/volatile.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/while.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/word.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arduino/wordcast.rst:: WARNING: document isn't included in any toctree +/Users/mbolivar/hack/leaf/libmaple/docs/source/arm-gcc.rst:: WARNING: document isn't included in any toctree diff --git a/docs/Makefile b/docs/Makefile index c182a90..eb14c90 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -36,7 +36,7 @@ help: clean: -rm -rf $(BUILDDIR)/* -html: doxygen +html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." diff --git a/docs/source/adc.rst b/docs/source/adc.rst index c1281be..c088652 100644 --- a/docs/source/adc.rst +++ b/docs/source/adc.rst @@ -70,8 +70,8 @@ Recommended Reading * `Arduino Analog Input Tutorial <http://arduino.cc/en/Tutorial/AnalogInputPins>`_ * STMicro documentation for STM32F103RB microcontroller: - * `All <stm32-all>`_ - * `Datasheet <datasheet>`_ (pdf) - * `Reference Manual <full-manual>`_ (pdf) - * `Application Note on ADC Modes (pdf) <stm32-adc-modes>`_ - * `Application Note on ADC Oversampling (pdf) <stm32-adc-oversampling>`_ + * `All <http://www.st.com/mcu/devicedocs-STM32F103RB-110.html>`_ + * `Datasheet <http://www.st.com/stonline/products/literature/ds/13587.pdf>`_ (pdf) + * `Reference Manual <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_ (pdf) + * `Application Note on ADC Modes (pdf) <http://www.st.com/stonline/products/literature/an/16840.pdf>`_ + * `Application Note on ADC Oversampling (pdf) <http://www.st.com/stonline/products/literature/an/14183.pdf>`_ diff --git a/docs/source/arduino/assignment.rst b/docs/source/arduino/assignment.rst index 8b851e8..1c790bb 100644 --- a/docs/source/arduino/assignment.rst +++ b/docs/source/arduino/assignment.rst @@ -11,7 +11,7 @@ the left of the equal sign. The single equal sign in the C++ programming language is called the assignment operator. It has a different meaning than in algebra -class where it indicated an equation or equality. The assignment +class, where it indicated an equation or equality. The assignment operator tells the microcontroller to evaluate whatever value or expression is on the right side of the equal sign, and store it in the variable to the left of the equal sign [#fgross]_. @@ -23,7 +23,7 @@ Example :: - int sensVal; // declare an integer variable named sensVal + int sensVal; // declare an integer variable named sensVal senVal = analogRead(0); // store the (digitized) input voltage at analog pin 0 in SensVal @@ -56,8 +56,9 @@ See Also .. rubric:: Footnotes - Experienced C++ programmers know this to be an oversimplification - of what happens when the variable on the left hand side is an - object. See Richard Gillam's wonderful and scary `The Anatomy of - the Assignment Operator +.. [#fgross] Experienced C++ programmers know this to be an + oversimplification of what happens when the variable on the left + hand side is an object. See Richard Gillam's wonderful and scary + `The Anatomy of the Assignment Operator <http://icu-project.org/docs/papers/cpp_report/the_anatomy_of_the_assignment_operator.html>`_ + for more information. diff --git a/docs/source/arduino/attachinterrupt.rst b/docs/source/arduino/attachinterrupt.rst index 27a1d77..189141b 100644 --- a/docs/source/arduino/attachinterrupt.rst +++ b/docs/source/arduino/attachinterrupt.rst @@ -1,59 +1,30 @@ +.. highlight:: cpp + .. _arduino-attachinterrupt: attachInterrupt(interrupt, function, mode) ========================================== +.. doxygenfunction:: attachInterrupt +.. doxygenenum:: ExtIntTriggerMode -Description ------------ - -Specifies a function to call when an external interrupt occurs. -Replaces any previous function that was attached to the interrupt. -Most Arduino boards have two external interrupts: numbers 0 (on -digital pin 2) and 1 (on digital pin 3). The Arduino Mega has an -additional four: numbers 2 (pin 21), 3 (pin 20), 4 (pin 19), and 5 -(pin 18). - +.. doxygentypedef:: voidFuncPtr - -Parameters +Discussion ---------- -**interrupt**: the number of the interrupt (*int*) - - - -**function**: the function to call when the interrupt occurs; this -function must take no parameters and return nothing. This function -is sometimes referred to as an *interrupt service routine.* - - - -**mode** defines when the interrupt should be triggered. Four -contstants are predefined as valid values: - - -- **LOW** to trigger the interrupt whenever the pin is low, -- **CHANGE** to trigger the interrupt whenever the pin changes - value -- **RISING** to trigger when the pin goes from low to high, -- **FALLING** for when the pin goes from high to low. - - - -Returns -------- - -none - - +Specifies a function to call when an external interrupt occurs. +Replaces any previous function that was attached to the interrupt. +For more information on external interrupts on the Maple Note ---- -*Inside the attached function, delay() won't work and the value returned by millis() will not increment. Serial data received while in the function may be lost. You should declare as volatile any variables that you modify within the attached function.* - +Inside the attached function, delay() won't work, and the value +returned by millis() will not increment. Serial data received while in +the function may be lost. You should declare as volatile any variables +that you modify within the attached function. Using Interrupts @@ -84,18 +55,18 @@ Example :: - int pin = 13; + int maple_led_pin = 13; volatile int state = LOW; void setup() { - pinMode(pin, OUTPUT); + pinMode(maple_led_pin, OUTPUT); attachInterrupt(0, blink, CHANGE); } void loop() { - digitalWrite(pin, state); + digitalWrite(maple_led_pin, state); } void blink() @@ -104,6 +75,14 @@ Example } +Arduino Compatibility Note +-------------------------- + +Most Arduino boards have two external interrupts: numbers 0 (on +digital pin 2) and 1 (on digital pin 3). The Arduino Mega has an +additional four: numbers 2 (pin 21), 3 (pin 20), 4 (pin 19), and 5 +(pin 18). + See also -------- diff --git a/docs/source/epilog.rst b/docs/source/epilog.rst index 73aab6d..4234dd9 100644 --- a/docs/source/epilog.rst +++ b/docs/source/epilog.rst @@ -5,44 +5,38 @@ .. _forum: http://forums.leaflabs.com .. _contact: http://leaflabs.com/contact/ - -.. _stm32-all: http://www.st.com/mcu/devicedocs-STM32F103RB-110.html -.. _stm32-programming: http://www.st.com/stonline/products/literature/pm/15491.pdf -.. _stm32-adc-modes: http://www.st.com/stonline/products/literature/an/16840.pdf -.. _stm32-adc-oversampling: http://www.st.com/stonline/products/literature/an/14183.pdf -.. _full-manual: http://www.st.com/stonline/products/literature/rm/13902.pdf -.. _datasheet: http://www.st.com/stonline/products/literature/ds/13587.pdf +.. _contact us directly: http://leaflabs.com/contact/ .. Arduino built-in functions .. _setup(): http://arduino.cc/en/Reference/Setup -.. _loop(): http://arduino.cc/en/Reference/Loop +.. _loop(): http://arduino.cc/en/Reference/Loop -.. _pinMode(): http://arduino.cc/en/Reference/PinMode +.. _pinMode(): http://arduino.cc/en/Reference/PinMode .. _digitalWrite(): http://arduino.cc/en/Reference/DigitalWrite -.. _digitalRead(): http://arduino.cc/en/Reference/DigitalRead +.. _digitalRead(): http://arduino.cc/en/Reference/DigitalRead .. _analogReference(): http://arduino.cc/en/Reference/AnalogReference -.. _analogRead(): http://arduino.cc/en/Reference/AnalogRead -.. _analogWrite(): http://arduino.cc/en/Reference/AnalogWrite +.. _analogRead(): http://arduino.cc/en/Reference/AnalogRead +.. _analogWrite(): http://arduino.cc/en/Reference/AnalogWrite -.. _tone(): http://arduino.cc/en/Reference/Tone -.. _noTone(): http://arduino.cc/en/Reference/NoTone +.. _tone(): http://arduino.cc/en/Reference/Tone +.. _noTone(): http://arduino.cc/en/Reference/NoTone .. _shiftOut(): http://arduino.cc/en/Reference/ShiftOut -.. _pulseIn(): http://arduino.cc/en/Reference/PulseIn +.. _pulseIn(): http://arduino.cc/en/Reference/PulseIn -.. _millis(): http://arduino.cc/en/Reference/Millis -.. _micros(): http://arduino.cc/en/Reference/Micros -.. _delay(): http://arduino.cc/en/Reference/Delay +.. _millis(): http://arduino.cc/en/Reference/Millis +.. _micros(): http://arduino.cc/en/Reference/Micros +.. _delay(): http://arduino.cc/en/Reference/Delay .. _delayMicroseconds(): http://arduino.cc/en/Reference/DelayMicroseconds -.. _min(): http://arduino.cc/en/Reference/Min -.. _max(): http://arduino.cc/en/Reference/Max -.. _abs(): http://arduino.cc/en/Reference/Abs +.. _min(): http://arduino.cc/en/Reference/Min +.. _max(): http://arduino.cc/en/Reference/Max +.. _abs(): http://arduino.cc/en/Reference/Abs .. _constrain(): http://arduino.cc/en/Reference/Constrain -.. _map(): http://arduino.cc/en/Reference/Map -.. _pow(): http://arduino.cc/en/Reference/Pow +.. _map(): http://arduino.cc/en/Reference/Map +.. _pow(): http://arduino.cc/en/Reference/Pow .. _sqrt(): http://arduino.cc/en/Reference/Sqrt .. _sin(): http://arduino.cc/en/Reference/Sin @@ -50,18 +44,18 @@ .. _tan(): http://arduino.cc/en/Reference/Tan .. _randomSeed(): http://arduino.cc/en/Reference/RandomSeed -.. _random(): http://arduino.cc/en/Reference/Random +.. _random(): http://arduino.cc/en/Reference/Random -.. _lowByte(): http://arduino.cc/en/Reference/LowByte +.. _lowByte(): http://arduino.cc/en/Reference/LowByte .. _highByte(): http://arduino.cc/en/Reference/HighByte -.. _bitRead(): http://arduino.cc/en/Reference/BitRead +.. _bitRead(): http://arduino.cc/en/Reference/BitRead .. _bitWrite(): http://arduino.cc/en/Reference/BitWrite -.. _bitSet(): http://arduino.cc/en/Reference/BitSet +.. _bitSet(): http://arduino.cc/en/Reference/BitSet .. _bitClear(): http://arduino.cc/en/Reference/BitClear -.. _bit(): http://arduino.cc/en/Reference/Bit +.. _bit(): http://arduino.cc/en/Reference/Bit .. _attachInterrupt(): http://arduino.cc/en/Reference/AttachInterrupt .. _detachInterrupt(): http://arduino.cc/en/Reference/DetachInterrupt -.. _interrupts(): http://arduino.cc/en/Reference/Interrupts +.. _interrupts(): http://arduino.cc/en/Reference/Interrupts .. _noInterrupts(): http://arduino.cc/en/Reference/NoInterrupts diff --git a/docs/source/external-interrupts.rst b/docs/source/external-interrupts.rst new file mode 100644 index 0000000..bc9d6cd --- /dev/null +++ b/docs/source/external-interrupts.rst @@ -0,0 +1,126 @@ +.. highlight:: cpp + +.. _external-interrupts: + +External Interrupts +=================== + +External interrupts can be used to trigger routines to run in response +to changes in voltage on a pin. Each GPIO pin on the Maple can be used +to detect transitions such as when the voltage goes from low to high, +or from high to low. This technique can be used to avoid unnecessary +polling of the state of a pin. + +.. _contents: Contents + :local: + + +Overview +-------- + +External interrupts are often used to detect when events happen +outside of the microcontroller. These can be used to tell the Maple +when events happen, such as when a sensor has data ready to be read, +or when a button has been pushed. When such an event happens, an +interrupt is raised and the Maple can react to it with a preset +*interrupt handler*. + +Every GPIO pin on the Maple can be used as an external interrupt, +subject to certain constraints; there can be a maximum of 16 different +external interrupts set up at a time on the Maple. This is because the +external interrupt lines on the STM32 are multiplexed between GPIO +ports. In effect, this means that every pin on the Maple maps to a +certain EXTI line, and within that EXTI line, only one of the pins +that maps to it can be used as an external interrupt at a time. + +The following table shows which pins can be used on which lines. + +.. list-table:: + :widths: 1 1 + :header-rows: 1 + + * - EXTI Line + - Maple pins + * - EXTI0 + - 2, 15, 27 + * - EXTI1 + - 3, 16, 28 + * - EXTI2 + - 1, 17, 25 + * - EXTI3 + - 0, 18 + * - EXTI4 + - 10, 19 + * - EXTI5 + - 4, 13, 20 + * - EXTI6 + - 5, 12, 35 + * - EXTI7 + - 9, 11, 36 + * - EXTI8 + - 6, 14, 37 + * - EXTI9 + - 7, 25, 28 + * - EXTI10 + - 8, 26, 29 + * - EXTI11 + - 30 + * - EXTI12 + - 31 + * - EXTI13 + - 21, 32 + * - EXTI14 + - 22, 33 + * - EXTI15 + - 23, 34 + +.. note:: + + You should set the :ref:`pin mode <arduino-pinmode>` of your + desired pin to an input mode (e.g ``INPUT`` or ``INPUT_FLOATING``, + ``INPUT_PULLUP``, ``INPUT_PULLDOWN``). + + +Function Reference +------------------ + +.. doxygenfunction:: attachInterrupt + +.. doxygenfunction:: detachInterrupt + +.. doxygenenum:: ExtIntTriggerMode + +.. doxygentypedef:: voidFuncPtr + + +Code example +------------ + +Blink the LED on every transition:: + + int pin = 13; + volatile int state = LOW; + + void setup() { + pinMode(pin, OUTPUT); + pinMode(0, INPUT_FLOATING); + attachInterrupt(0, blink, CHANGE); + } + + void loop() { + digitalWrite(pin, state); + } + + void blink() { + state = !state; + } + + +Recommended Reading +------------------- + +* STMicro documentation for STM32F103RB microcontroller: + + * `All <http://www.st.com/mcu/devicedocs-STM32F103RB-110.html>`_ + * `Datasheet <http://www.st.com/stonline/products/literature/ds/13587.pdf>`_ (pdf) + * `Reference Manual <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_ (pdf) diff --git a/docs/source/foo.rst b/docs/source/foo.rst index d2ac4c6..769e666 100644 --- a/docs/source/foo.rst +++ b/docs/source/foo.rst @@ -15,9 +15,9 @@ This is the index of the imported Arduino docs. Arithmetic <arduino/arithmetic> Arrays <arduino/array> Assignment <arduino/assignment> + attachInterrupt() <arduino/attachinterrupt> + bit <arduino/bit> -.. attachinterrupt <arduino-attachinterrupt> -.. bit <arduino-bit> .. bitclear <arduino-bitclear> .. bitread <arduino-bitread> .. bitset <arduino-bitset> diff --git a/docs/source/gpio.rst b/docs/source/gpio.rst index bd562a7..7a9031a 100644 --- a/docs/source/gpio.rst +++ b/docs/source/gpio.rst @@ -100,6 +100,6 @@ Recommended Reading STMicro documentation for STM32F103RB microcontroller: - * `All <stm32-all>`_ - * `Datasheet <datasheet>`_ (pdf) - * `Reference Manual <full-manual>`_ (pdf) + * `All <http://www.st.com/mcu/devicedocs-STM32F103RB-110.html>`_ + * `Datasheet <http://www.st.com/stonline/products/literature/ds/13587.pdf>`_ (pdf) + * `Reference Manual <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_ (pdf) diff --git a/docs/source/i2c.rst b/docs/source/i2c.rst index 764a342..ddb2ac9 100644 --- a/docs/source/i2c.rst +++ b/docs/source/i2c.rst @@ -80,9 +80,9 @@ Recommended Reading * `Arduino i2c/TWI reference <http://www.arduino.cc/playground/Learning/I2C>`_ * STMicro documentation for STM32F103RB microcontroller: - * `All <stm32-all>`_ - * `Datasheet <datasheet>`_ (pdf) - * `Reference Manual <full-manual>`_ (pdf) + * `All <http://www.st.com/mcu/devicedocs-STM32F103RB-110.html>`_ + * `Datasheet <http://www.st.com/stonline/products/literature/ds/13587.pdf>`_ (pdf) + * `Reference Manual <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_ (pdf) * `Application Note on Advanced I2C Usage <http://www.st.com/stonline/products/literature/an/15021.pdf>`_ (pdf) diff --git a/docs/source/index.rst b/docs/source/index.rst index 3e72e85..ac92d4b 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -30,6 +30,7 @@ Table of contents: libmaple Command-Line Tools and APIs <libmaple> Troubleshooting <troubleshooting> Hardware-Specific Documentation <hardware> + External Interrupts <external-interrupts> Maple bootloader <bootloader> Known Problems <errata> [Temporary] Arduino docs TOC <foo> diff --git a/docs/source/jtag.rst b/docs/source/jtag.rst index 4ef417d..9b8ee14 100644 --- a/docs/source/jtag.rst +++ b/docs/source/jtag.rst @@ -66,6 +66,6 @@ Recommended Reading * `STM32/gdb/OpenOCD HOWTO <http://fun-tech.se/stm32/OpenOCD/gdb.php>`_ * STMicro documentation for STM32F103RB microcontroller: - * `All <stm32-all>`_ - * `Datasheet <datasheet>`_ (pdf) - * `Reference Manual <full-manual>`_ (pdf) + * `All <http://www.st.com/mcu/devicedocs-STM32F103RB-110.html>`_ + * `Datasheet <http://www.st.com/stonline/products/literature/ds/13587.pdf>`_ (pdf) + * `Reference Manual <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_ (pdf) diff --git a/docs/source/language.rst b/docs/source/language.rst index d3c7895..5a2efad 100644 --- a/docs/source/language.rst +++ b/docs/source/language.rst @@ -213,7 +213,6 @@ Arduino Documentation Links typedef uint16 word; -.. setup()/loop() are part of the standard rst_epilog in conf.py .. _if: http://arduino.cc/en/Reference/If .. _if...else: http://arduino.cc/en/Reference/Else .. _for: http://arduino.cc/en/Reference/For @@ -483,8 +482,7 @@ Recommended Reading * `newlib Documentation <http://sourceware.org/newlib/>`_ * STMicro documentation for STM32F103RB microcontroller: - * `All documents <stm32-all>`_ - * `Datasheet <datasheet>`_ (pdf) - * `Reference Manual <full-manual>`_ (pdf) - * `Programming Manual <stm32-programming>`_ (assembly language and - register reference) + * `All documents <http://www.st.com/mcu/devicedocs-STM32F103RB-110.html>`_ + * `Datasheet <http://www.st.com/stonline/products/literature/ds/13587.pdf>`_ (pdf) + * `Reference Manual <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_ (pdf) + * `Programming Manual <http://www.st.com/stonline/products/literature/pm/15491.pdf>`_ (assembly language and register reference) diff --git a/docs/source/maple-ide-install.rst b/docs/source/maple-ide-install.rst index 3c3fffe..ce50c49 100644 --- a/docs/source/maple-ide-install.rst +++ b/docs/source/maple-ide-install.rst @@ -9,7 +9,7 @@ If you still can't get the IDE installed after reading this page, check the :ref:`troubleshooting page <troubleshooting>` for help with some common problems. If all else fails, try our `forum`_, or `contact -us directly <http://leaflabs.com/contact>`_! +us directly`_\ ! .. contents:: Contents :local: diff --git a/docs/source/maple-quickstart.rst b/docs/source/maple-quickstart.rst index 4d646d7..6d99a4a 100644 --- a/docs/source/maple-quickstart.rst +++ b/docs/source/maple-quickstart.rst @@ -13,7 +13,7 @@ that computer. If you have trouble along the way, try the :ref:`troubleshooting page <troubleshooting>` for help with some common problems. If all else -fails, try our `forum`_, or `contact us directly <contact>`_! +fails, try our `forum`_, or `contact`_ us directly! .. contents:: Contents :local: diff --git a/docs/source/pwm.rst b/docs/source/pwm.rst index 0f77781..178d103 100644 --- a/docs/source/pwm.rst +++ b/docs/source/pwm.rst @@ -159,6 +159,6 @@ Recommended Reading * `So You Want To Use PWM, Eh? <http://www.arcfn.com/2009/07/secrets-of-arduino-pwm.html>`_ at Non-Lexical Vocables * STMicro documentation for STM32F103RB microcontroller: - * `All <stm32-all>`_ - * `Datasheet <datasheet>`_ (pdf) - * `Reference Manual <full-manual>`_ (pdf) + * `All <http://www.st.com/mcu/devicedocs-STM32F103RB-110.html>`_ + * `Datasheet <http://www.st.com/stonline/products/literature/ds/13587.pdf>`_ (pdf) + * `Reference Manual <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_ (pdf) diff --git a/docs/source/spi.rst b/docs/source/spi.rst index 91c165a..4cfd7e7 100644 --- a/docs/source/spi.rst +++ b/docs/source/spi.rst @@ -63,7 +63,7 @@ Recommended Reading * `Hardcore SPI on Arduino <http://klk64.com/arduino-spi/>`_ by kik64 * STMicro documentation for STM32F103RB microcontroller: - * `All <stm32-all>`_ - * `Datasheet <datasheet>`_ (pdf) - * `Reference Manual <full-manual>`_ (pdf) + * `All <http://www.st.com/mcu/devicedocs-STM32F103RB-110.html>`_ + * `Datasheet <http://www.st.com/stonline/products/literature/ds/13587.pdf>`_ (pdf) + * `Reference Manual <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_ (pdf) diff --git a/docs/source/unix-toolchain.rst b/docs/source/unix-toolchain.rst index 295090e..b595f70 100644 --- a/docs/source/unix-toolchain.rst +++ b/docs/source/unix-toolchain.rst @@ -19,7 +19,7 @@ editing your shell startup script (.bashrc, .tcshrc, etc.) and using generic installation/setup issues, the `IDE install <http://leaflabs.com/docs/libmaple/install/>`_ and :ref:`troubleshooting` pages may be helpful. If all else fails, try -our `forum`_, or `contact us directly <contact>`_! +our `forum`_, or `contact us directly`_\ ! We currently have instructions for 32- and 64-bit Linux and OS X Snow Leopard. If you're on another Unix platform, Windows, or an earlier diff --git a/docs/source/usart.rst b/docs/source/usart.rst index d6343e6..19b054f 100644 --- a/docs/source/usart.rst +++ b/docs/source/usart.rst @@ -94,6 +94,6 @@ Recommended Reading * `Arduino reference on Serial <http://arduino.cc/en/Reference/Serial>`_ * STMicro documentation for STM32F103RB microcontroller: - * `All <stm32-all>`_ - * `Datasheet <datasheet>`_ (pdf) - * `Reference Manual <full-manual>`_ (pdf) + * `All <http://www.st.com/mcu/devicedocs-STM32F103RB-110.html>`_ + * `Datasheet <http://www.st.com/stonline/products/literature/ds/13587.pdf>`_ (pdf) + * `Reference Manual <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_ (pdf) diff --git a/docs/source/usb.rst b/docs/source/usb.rst index 93d476e..baabde5 100644 --- a/docs/source/usb.rst +++ b/docs/source/usb.rst @@ -185,8 +185,8 @@ Recommended Reading * Linux Kernel documentation for `USB ACM <http://www.kernel.org/doc/Documentation/usb/acm.txt>`_ and `USB Serial <http://www.kernel.org/doc/Documentation/usb/usb-serial.txt>`_ * STMicro documentation for STM32F103RB microcontroller: - * `All documents <stm32-all>`_ - * `Datasheet <datasheet>`_ (pdf) - * `Reference Manual <full-manual>`_ (pdf) - * `Programming Manual <stm32-programming>`_ (pdf; assembly + * `All documents <http://www.st.com/mcu/devicedocs-STM32F103RB-110.html>`_ + * `Datasheet <http://www.st.com/stonline/products/literature/ds/13587.pdf>`_ (pdf) + * `Reference Manual <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_ (pdf) + * `Programming Manual <http://www.st.com/stonline/products/literature/pm/15491.pdf>`_ (pdf; assembly language and register reference) |