Function esp_idf_sys::esp_flash_set_protected_region
source · pub unsafe extern "C" fn esp_flash_set_protected_region(
chip: *mut esp_flash_t,
region: *const esp_flash_region_t,
protect: bool,
) -> esp_err_t
Expand description
@brief Update the protected status for a region of the SPI flash chip
@param chip Pointer to identify flash chip. Must have been successfully initialised via esp_flash_init() @param region Pointer to a struct describing a protected region. This must match one of the regions returned from esp_flash_get_protectable_regions(…). @param protect Write protection flag to set.
@note It is possible for the region protection flag to be cleared and write operations to still fail, if protection is enabled for the entire chip.
@note Correct behaviour of this function depends on the SPI flash chip model and chip_drv in use (via the ‘chip->drv’ field).
@return ESP_OK on success, or a flash error code if operation failed.