File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,25 @@ 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+ Stores ``data `` (byte literal) into RTC memory, which is kept stored in deep sleep mode of the ESP8266 or ESP32.
81+ The data is stored together with a magic word to detect that the RTC memory is valid.
82+ An uninitialized or cleared RTC memory has no magic word and will deliver ``b'' ``.
83+ Without ``data `` the method delivers the RTC memory content.
84+ In the ESP8266 are max. 492 bytes and in the ESP32 are max. 2048 Bytes storeable by this method.
85+
86+ Example::
87+
88+ import machine
89+ rtc = machine.RTC()
90+ writedata = b'test'
91+ rtc.memory(writedata) # this command writes writedata into the RTC memory
92+ readdata = rtc.memory() # this command puts the RTC memory into readdata
93+ print(readdata)
94+
95+ Availability: ESP8266, ESP32
96+
7897Constants
7998---------
8099
You can’t perform that action at this time.
0 commit comments