docs: added UART examples into Python docs.
[contrib/mraa.git] / src / python / docs / example.rst
index f1b1e04..4daf98c 100644 (file)
@@ -20,7 +20,10 @@ GPIO Interupt (isr)
 ===================
 
 The GPIO module allows you to set an interupt on a GPIO. This interupt is
-controlled by the mode that the 'edge' is in.
+controlled by the mode that the 'edge' is in. Before setting another isr please
+remove the first one, multiple isrs on one pin are not supported. Some
+platforms will not support interupts on all pins so please check your return
+values.
 
 **Note:** Galileo Gen1 only supports EDGE_BOTH
 
@@ -31,6 +34,9 @@ controlled by the mode that the 'edge' is in.
 **Note:** If the python script is ended the destructors will run meaning that
 the ISR will not run. The sleep call is there for that function.
 
+**Note:** The python isr module treats only objects. This means that int
+counters will not work inside your isr. Please use the different edge modes.
+
 I2c
 ===
 
@@ -38,9 +44,9 @@ The I2c module module has a number of different ways of interacting with the
 i2c bus, including a number of overloaded read() calls and the writeReg()
 helper function.
 
-.. literalinclude:: ../../../examples/python/i2c_HMC5883.py
-  :prepend: x = mraa.I2c(0)
-  :start-after: x = mraa.I2c(0)
+.. literalinclude:: ../../../examples/python/bmp85.py
+  :prepend: x = m.I2c(0)
+  :start-after: x = m.I2c(0)
 
 .. literalinclude:: ../../../docs/i2c.txt
 
@@ -65,3 +71,23 @@ fairly simple in use.
   :prepend: import mraa
   :start-after: import mraa
 
+Uart
+====
+
+Uart is the Universal asynchronous receiver/transmitter interface in mraa.
+It allows the exposure of UART pins on supported boards, with basic
+configuration operations supported.
+
+Here's a simple pair of programs comprising a sender and receiver pair.
+
+Sender:
+
+.. literalinclude:: ../../../examples/python/uart_sender.py
+  :prepend: import mraa
+  :start-after: import mraa
+
+Receiver:
+
+.. literalinclude:: ../../../examples/python/uart_receiver.py
+  :prepend: import mraa
+  :start-after: import mraa