Function esp_idf_svc::hal::sys::esp_flash_set_chip_write_protect

source ·
pub unsafe extern "C" fn esp_flash_set_chip_write_protect(
    chip: *mut esp_flash_t,
    write_protect: bool,
) -> i32
Expand description

@brief Set write protection for the SPI flash chip

@param chip Pointer to identify flash chip. If NULL, esp_flash_default_chip is substituted. Must have been successfully initialised via esp_flash_init() @param write_protect Boolean value for the write protect flag

@note Correct behaviour of this function depends on the SPI flash chip model and chip_drv in use (via the ‘chip->drv’ field).

Some SPI flash chips may require a power cycle before write protect status can be cleared. Otherwise, write protection can be removed via a follow-up call to this function.

@return ESP_OK on success, or a flash error code if operation failed.