diff options
| author | Daniel Campora <daniel@wipy.io> | 2015-08-11 16:06:43 +0200 |
|---|---|---|
| committer | Daniel Campora <daniel@wipy.io> | 2015-08-16 20:17:58 +0200 |
| commit | 11d21081b4321ff4a1078b728911fe15fea94509 (patch) | |
| tree | ec51b860f3736ad1a76698f660f234e771942f32 /docs | |
| parent | 34c290b678f6ba3a903754aad16758a007286b46 (diff) | |
cc3200: Rework SD API. Increase heap to avoid malloc failures.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/library/pyb.SD.rst | 29 | ||||
| -rw-r--r-- | docs/wipy/quickref.rst | 6 |
2 files changed, 22 insertions, 13 deletions
diff --git a/docs/library/pyb.SD.rst b/docs/library/pyb.SD.rst index 0746b435b..9b3d95dac 100644 --- a/docs/library/pyb.SD.rst +++ b/docs/library/pyb.SD.rst @@ -15,25 +15,34 @@ Example usage:: # data, clk and cmd pins must be passed along with # their respective alternate functions - sd = pyb.SD('GP15', 8, 'GP10', 6, 'GP11', 6) - sd.enable() # enable and mount the SD card - sd.disable() # disable and unmount it + sd = pyb.SD(('GP15', 8, 'GP10', 6, 'GP11', 6)) + sd.mount() + # do normal file operations Constructors ------------ -.. class:: pyb.SD(dat_pin, dat_pin_af, clk_pin, clk_pin_af, cmd_pin, cmd_pin_af) +.. class:: pyb.SD([pins_tuple]) - Create a SD card object. Data, clock and cmd pins must be passed along with - their respective alternate functions. + Create a SD card object. In order to initalize the card, give it a 6-tuple + ``(dat_pin, dat_af, clk_pin, clk_af, cmd_pin, cmd_af)`` with the data, clock + and cmd pins together their respective alternate functions. Methods ------- -.. method:: sd.enable() +.. method:: sd.init([pins_tuple]) - Enable the SD card and mount it on the file system. Accesible as ``/sd``. + Enable the SD card. -.. method:: sd.disable() +.. method:: sd.deinit() - Disable the SD card and remove it from the file system. + Disable the SD card (also unmounts it to avoid file system crashes). + +.. method:: sd.mount() + + Mount the SD card on the file system. Accesible as ``/sd``. + +.. method:: sd.unmount() + + Unmount the SD card from the file system. diff --git a/docs/wipy/quickref.rst b/docs/wipy/quickref.rst index 2acbaa541..358020d94 100644 --- a/docs/wipy/quickref.rst +++ b/docs/wipy/quickref.rst @@ -172,10 +172,10 @@ See :ref:`pyb.SD <pyb.SD>`. :: from pyb import SD - # SD card pins need special configuration so we pass 'em to the constructor + # SD card pins need special configuration so we pass them to the constructor # data pin, data af, clock pin, clock af, cmd pin, cmd af - sd = pyb.SD('GP15', 8, 'GP10', 6, 'GP11', 6) - sd.enable() + sd = pyb.SD(('GP15', 8, 'GP10', 6, 'GP11', 6)) + sd.mount() WLAN (WiFi) ----------- |
