Skip to content

Commit 57de9da

Browse files
AmirHmZzdpgeorge
authored andcommitted
docs/library/machine.RTC: Add docs for RTC.memory() method.
Co-Authored-By: glenn20 <[email protected]> Signed-off-by: Amirreza Hamzavi <[email protected]>
1 parent a0d31e5 commit 57de9da

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/library/machine.RTC.rst

+15
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,21 @@ Methods
7575
- ``wake`` specifies the sleep mode from where this interrupt can wake
7676
up the system.
7777

78+
.. method:: RTC.memory([data])
79+
80+
``RTC.memory(data)`` will write *data* to the RTC memory, where *data* is any
81+
object which supports the buffer protocol (including `bytes`, `bytearray`,
82+
`memoryview` and `array.array`). ``RTC.memory()`` reads RTC memory and returns
83+
a `bytes` object.
84+
85+
Data written to RTC user memory is persistent across restarts, including
86+
`machine.soft_reset()` and `machine.deepsleep()`.
87+
88+
The maximum length of RTC user memory is 2048 bytes by default on esp32,
89+
and 492 bytes on esp8266.
90+
91+
Availability: esp32, esp8266 ports.
92+
7893
Constants
7994
---------
8095

0 commit comments

Comments
 (0)