File: rp2.Flash.rst

package info (click to toggle)
micropython 1.25.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 48,944 kB
  • sloc: ansic: 317,850; python: 59,539; xml: 4,241; makefile: 3,530; sh: 1,421; javascript: 744; asm: 681; cpp: 45; exp: 11; pascal: 6
file content (36 lines) | stat: -rw-r--r-- 1,016 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.. currentmodule:: rp2
.. _rp2.Flash:

class Flash -- access to built-in flash storage
===============================================

This class gives access to the SPI flash memory.

In most cases, to store persistent data on the device, you'll want to use a
higher-level abstraction, for example the filesystem via Python's standard file
API, but this interface is useful to :ref:`customise the filesystem
configuration <filesystem>` or implement a low-level storage system for your
application.


Constructors
------------

.. class:: Flash()

   Gets the singleton object for accessing the SPI flash memory.


Methods
-------

.. method:: Flash.readblocks(block_num, buf)
            Flash.readblocks(block_num, buf, offset)
.. method:: Flash.writeblocks(block_num, buf)
            Flash.writeblocks(block_num, buf, offset)
.. method:: Flash.ioctl(cmd, arg)

    These methods implement the simple and extended
    :ref:`block protocol <block-device-interface>` defined by
    :class:`vfs.AbstractBlockDev`.