From be15be3ab56641b532f111fd1ce4389d9bd0a539 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Mon, 24 Nov 2025 14:50:46 +1100 Subject: [PATCH] docs/mimxrt: Add docs for mimxrt.Flash. This adds docs for the `mimxrt` module and the `mimxrt.Flash` class, the implementation for which was first added in dfd4324eb1b758e37cfc77da8467e7f5d72f519c The docs are simple, following the conventions used for similar classes in the rp2 and stm32 ports. Signed-off-by: Andrew Leech --- docs/library/index.rst | 10 +++++++++ docs/library/mimxrt.Flash.rst | 39 +++++++++++++++++++++++++++++++++++ docs/library/mimxrt.rst | 19 +++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 docs/library/mimxrt.Flash.rst create mode 100644 docs/library/mimxrt.rst diff --git a/docs/library/index.rst b/docs/library/index.rst index 2919378ce1..e64809bfa8 100644 --- a/docs/library/index.rst +++ b/docs/library/index.rst @@ -172,6 +172,16 @@ The following libraries are specific to the ESP8266 and ESP32. espnow.rst +Libraries specific to NXP i.MXRT +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The following libraries are specific to the NXP i.MXRT family of microcontrollers. + +.. toctree:: + :maxdepth: 2 + + mimxrt.rst + Libraries specific to the RP2040 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/library/mimxrt.Flash.rst b/docs/library/mimxrt.Flash.rst new file mode 100644 index 0000000000..161ef4ff2a --- /dev/null +++ b/docs/library/mimxrt.Flash.rst @@ -0,0 +1,39 @@ +.. currentmodule:: mimxrt +.. _mimxrt.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 ` 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 ` defined by + :class:`vfs.AbstractBlockDev`. + + The block size can be queried by calling ``ioctl(5, 0)``. Block numbers + are relative to the start of the user flash storage area, not the physical + start of flash memory. diff --git a/docs/library/mimxrt.rst b/docs/library/mimxrt.rst new file mode 100644 index 0000000000..fdb4c1a1da --- /dev/null +++ b/docs/library/mimxrt.rst @@ -0,0 +1,19 @@ +.. currentmodule:: mimxrt + +:mod:`mimxrt` --- functionality specific to NXP i.MXRT +====================================================== + +.. module:: mimxrt + :synopsis: functionality specific to NXP i.MXRT + +The ``mimxrt`` module contains functions and classes specific to the NXP i.MXRT +family of microcontrollers. + + +Classes +------- + +.. toctree:: + :maxdepth: 1 + + mimxrt.Flash.rst