Skip to content

Commit 2e41242

Browse files
committed
Add additional documentation
1 parent e8875f5 commit 2e41242

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

Diff for: docs/workflows.md

+23-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,30 @@ The workflow APIs are documented here.
1919
These USB interfaces are enabled by default on boards with USB support. They are usable once the
2020
device has been plugged into a host.
2121

22-
### CIRCUITPY drive
22+
### Mass Storage
2323
CircuitPython exposes a standard mass storage (MSC) interface to enable file manipulation over a
24-
standard interface. This interface works underneath the file system at the block level so using it
25-
excludes other types of workflows from manipulating the file system at the same time.
24+
standard interface. (This is how USB drives work.) This interface works underneath the file system at
25+
the block level so using it excludes other types of workflows from manipulating the file system at
26+
the same time.
27+
28+
CircuitPython 10.x adds multiple Logical Units (LUNs) to the mass storage interface. This allows for
29+
multiple drives to be accessed and ejected independently.
30+
31+
#### CIRCUITPY drive
32+
The CIRCUITPY drive is the main drive that CircuitPython uses. It is writable by the host by default
33+
and read-only to CircuitPython. `storage.remount()` can be used to remount the drive to
34+
CircuitPython as read-write.
35+
36+
#### CPSAVES drive
37+
The board may also expose a CPSAVES drive. (This is based on the ``CIRCUITPY_SAVES_PARTITION_SIZE``
38+
setting in ``mpconfigboard.h``.) It is a portion of the main flash that is writable by CircuitPython
39+
by default. It is read-only to the host. `storage.remount()` can be used to remount the drive to the
40+
host as read-write.
41+
42+
#### SD card drive
43+
A few boards have SD card automounting. (This is based on the ``DEFAULT_SD`` settings in
44+
``mpconfigboard.h``.) The card is writable from CircuitPython by default and read-only to the host.
45+
`storage.remount()` can be used to remount the drive to the host as read-write.
2646

2747
### CDC serial
2848
CircuitPython exposes one CDC USB interface for CircuitPython serial. This is a standard serial

Diff for: locale/circuitpython.pot

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ msgstr ""
8282
msgid "%q and %q contain duplicate pins"
8383
msgstr ""
8484

85-
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
85+
#: shared-bindings/audioio/AudioOut.c
8686
msgid "%q and %q must be different"
8787
msgstr ""
8888

@@ -154,7 +154,7 @@ msgstr ""
154154
msgid "%q length must be >= %d"
155155
msgstr ""
156156

157-
#: py/modsys.c py/objmodule.c py/runtime.c
157+
#: py/modsys.c py/runtime.c
158158
msgid "%q moved from %q to %q"
159159
msgstr ""
160160

Diff for: shared-bindings/storage/__init__.c

+8
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ MP_DEFINE_CONST_FUN_OBJ_1(storage_umount_obj, storage_umount);
9797
//| ) -> None:
9898
//| """Remounts the given path with new parameters.
9999
//|
100+
//| This can always be done from boot.py. After boot, it can only be done when the host computer
101+
//| doesn't have write access and CircuitPython isn't currently writing to the filesystem. An
102+
//| exception will be raised if this is the case. Some host OSes allow you to eject a drive which
103+
//| will allow for remounting.
104+
//|
105+
//| Remounting after USB is active may take a little time because it "ejects" the drive for one
106+
//| query from the host. These queries happen every second or so.
107+
//|
100108
//| :param str mount_path: The path to remount.
101109
//| :param bool readonly: True when the filesystem should be readonly to CircuitPython.
102110
//| :param bool disable_concurrent_write_protection: When True, the check that makes sure the

0 commit comments

Comments
 (0)