diff options
author | Damien George <damien.p.george@gmail.com> | 2019-07-09 15:08:52 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-08-20 16:49:18 +1000 |
commit | 05eb897d06cc4da04dd96f3b661b617b98cb6800 (patch) | |
tree | fb3e51710a43de3537cc1823fc4d4f554d0f149d /docs/library/esp32.rst | |
parent | 0cc8910bc58c1a1f69a696f5efe4ccf0ffcf2984 (diff) | |
download | micropython-05eb897d06cc4da04dd96f3b661b617b98cb6800.tar.gz micropython-05eb897d06cc4da04dd96f3b661b617b98cb6800.zip |
esp32: Add esp32.Partition class to expose partition and OTA funcs.
Partitions are exposed as a standard MicroPython block device.
Diffstat (limited to 'docs/library/esp32.rst')
-rw-r--r-- | docs/library/esp32.rst | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/docs/library/esp32.rst b/docs/library/esp32.rst index c934ef0954..a593965ae2 100644 --- a/docs/library/esp32.rst +++ b/docs/library/esp32.rst @@ -36,6 +36,51 @@ Functions Read the raw value of the internal Hall sensor, returning an integer. +Flash partitions +---------------- + +This class gives access to the partitions in the device's flash memory. + +.. class:: Partition(id) + + Create an object representing a partition. *id* can be a string which is the label + of the partition to retrieve, or one of the constants: ``BOOT`` or ``RUNNING``. + +.. classmethod:: Partition.find(type=TYPE_APP, subtype=0xff, label=None) + + Find a partition specified by *type*, *subtype* and *label*. Returns a + (possibly empty) list of Partition objects. + +.. method:: Partition.info() + + Returns a 6-tuple ``(type, subtype, addr, size, label, encrypted)``. + +.. method:: Partition.readblocks(block_num, buf) +.. method:: Partition.writeblocks(block_num, buf) +.. method:: Partition.ioctl(cmd, arg) + + These methods implement the block protocol defined by :class:`uos.AbstractBlockDev`. + +.. method:: Partition.set_boot() + + Sets the partition as the boot partition. + +.. method:: Partition.get_next_update() + + Gets the next update partition after this one, and returns a new Partition object. + +Constants +~~~~~~~~~ + +.. data:: Partition.BOOT + Partition.RUNNING + + Used in the `Partition` constructor to fetch various partitions. + +.. data:: Partition.TYPE_APP + Partition.TYPE_DATA + + Used in `Partition.find` to specify the partition type. The Ultra-Low-Power co-processor -------------------------------- |