summaryrefslogtreecommitdiff
path: root/docs/library/machine.SD.rst
diff options
context:
space:
mode:
authordanicampora <daniel@wipy.io>2015-10-14 12:32:01 +0200
committerdanicampora <daniel@wipy.io>2015-10-17 23:29:04 +0200
commit4542643025c77a7272bde348b89d5039aea28d23 (patch)
treebf9fb006f46b96d2ea9ecf4aa190c4e4cc2abfc8 /docs/library/machine.SD.rst
parentfca3308cc376f2c1c66fa3cef82e30c55c9acca2 (diff)
docs: Update all WiPy docs to reflect the new API.
Diffstat (limited to 'docs/library/machine.SD.rst')
-rw-r--r--docs/library/machine.SD.rst42
1 files changed, 42 insertions, 0 deletions
diff --git a/docs/library/machine.SD.rst b/docs/library/machine.SD.rst
new file mode 100644
index 000000000..19d8d655b
--- /dev/null
+++ b/docs/library/machine.SD.rst
@@ -0,0 +1,42 @@
+.. _machine.SD:
+
+class SD -- secure digital memory card
+======================================
+
+The SD card class allows to configure and enable the memory card
+module of the WiPy and automatically mount it as ``/sd`` as part
+of the file system. There are several pin combinations that can be
+used to wire the SD card socket to the WiPy and the pins used can
+be specified in the constructor. Please check the `pinout and alternate functions
+table. <https://raw.githubusercontent.com/wipy/wipy/master/docs/PinOUT.png>`_ for
+more info regarding the pins which can be remapped to be used with a SD card.
+
+Example usage::
+
+ from machine import SD
+ import os
+ # clk cmd and dat0 pins must be passed along with
+ # their respective alternate functions
+ sd = machine.SD(pins=('GP10', 'GP11', 'GP15'))
+ os.mount(sd, '/sd')
+ # do normal file operations
+
+Constructors
+------------
+
+.. class:: machine.SD(id,... )
+
+ Create a SD card object. See init for parameters if initialization.
+
+Methods
+-------
+
+.. method:: sd.init(id, pins=('GP10', 'GP11', 'GP15'))
+
+ Enable the SD card.
+ In order to initalize the card, give it a 3-tuple ``(clk_pin, cmd_pin, dat0_pin)``
+ ID defaults to zero.
+
+.. method:: sd.deinit()
+
+ Disable the SD card.