:mod:`esp` --- ESP32-related functions ========================================================= .. module:: esp :synopsis: ESP32-related functions This ``esp`` module contains specific functions related to the ESP32 module. Functions --------- .. function:: flash_size() Return the size of the flash. .. function:: flash_user_start() Read the memory offset where the user flash space starts. .. function:: flash_read(byte_offset, length_or_buffer) Read buf.len() bytes of data from the flash starting at address byte_offset and place them into buf. - ``byte_offset``: the flash offset address - ``buf``: the receive data buffer; the buffer length is len :: import esp buf = bytearray(100) esp.flash_read(2097152, buf) .. function:: flash_write(byte_offset, bytes) Write all the data in buf to the flash region at address byte_offset. - ``byte_offset``: the flash offset address - ``buf``: the data buffer; the buffer length is len :: buf = bytearray(100) esp.flash_write(2097152, buf) .. function:: flash_erase(sector_no) Erase a flash sector. - ``ector_no``: the sector to erase :: esp.flash_erase(512) .. function:: osdebug()