diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-10-20 06:46:52 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-10-20 06:46:52 -0400 |
commit | 85c1c72db022bba891868afd3375e39dbe245701 (patch) | |
tree | 9d86a3db825667362a8c89a98a205586015aec94 /source/gpio.rst | |
parent | abcfcc62cc62dfc088d30d5a6b6c36d6c89f7b07 (diff) | |
download | librambutan-85c1c72db022bba891868afd3375e39dbe245701.tar.gz librambutan-85c1c72db022bba891868afd3375e39dbe245701.zip |
initial check-in of arduino docs in RST format (converted using wget+pandoc)
Diffstat (limited to 'source/gpio.rst')
-rw-r--r-- | source/gpio.rst | 75 |
1 files changed, 8 insertions, 67 deletions
diff --git a/source/gpio.rst b/source/gpio.rst index 9104fed..bd562a7 100644 --- a/source/gpio.rst +++ b/source/gpio.rst @@ -80,77 +80,18 @@ above). GPIO Modes ---------- -``OUTPUT`` - - Basic digital output: when the pin set high the voltage is held at - +3.3V (|vcc|) and when set low it is pulled down to ground. - -``OUTPUT_OPEN_DRAIN`` - - In open drain mode, the pin indicates "low" by accepting current - flow to ground and "high" by providing increased impedance. An - example use would be to connect a pin to a bus line (which is - pulled up to a positive voltage by a separate supply through a - large resistor). When the pin is high, not much current flows - through to ground and the line stays at positive voltage; when the - pin is low the bus "drains" to ground with a small amount of - current constantly flowing through the large resistor from the - external supply. In this mode no current is ever actually - *sourced* from the pin. - -``INPUT`` (or ``INPUT_FLOATING``) - - Basic digital input. The pin voltage is sampled; when it is closer - to 3.3V (|vcc|) the pin status is high, and when it is closer to - 0V (ground) it is low. If no external circuit is pulling the pin - voltage to high or low, it will tend to randomly oscillate and be - very sensitive to noise (e.g., a breath of air across the pin will - cause the state to flip). - -``INPUT_PULLUP`` - - The state of the pin in this mode is reported the same way as with - INPUT, but the pin voltage is gently "pulled up" towards - +3.3V. This means the state will be high unless an external device - is specifically pulling the pin down to ground, in which case the - "gentle" pull up will not effect the state of the input. - -``INPUT_PULLDOWN`` - - The state of the pin in this mode is reported the same way as with - INPUT, but the pin voltage is gently "pulled down" towards - 0V. This means the state will be low unless an external device is - specifically pulling the pin up to 3.3V, in which case the - "gentle" pull down will not effect the state of the input. - -``INPUT_ANALOG`` - - This is a special mode for when the pin will be used for analog - (not digital) reads. See the :ref:`ADC <adc>` page. - -``PWM`` - - This is a special mode for when the pin will be used for PWM - output (a special case of digital output). See the :ref:`PWM - <pwm>` page. - -.. TODO PWM_OPEN_DRAIN needs documentation +.. doxygenenum:: WiringMode Function Reference ------------------ -``pinMode(pin_number, MODE)`` - - Usually called from within `setup()`_ to configure the pin. MODE - is one of the set listed :ref:`above <gpio-modes>`. - -``digitalRead(pin_number)`` +.. doxygenfunction:: pinMode - Returns ``HIGH`` (|vcc|) or ``LOW`` (0V). +.. doxygenfunction:: digitalRead -``digitalWrite(pin_number, value)`` +.. doxygenfunction:: digitalWrite - Sets the pin to ``HIGH`` or ``LOW``. +.. doxygenfunction:: analogRead .. _gpio-recommended-reading: @@ -159,6 +100,6 @@ 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) + * `All <stm32-all>`_ + * `Datasheet <datasheet>`_ (pdf) + * `Reference Manual <full-manual>`_ (pdf) |