Function esp_idf_sys::esp_flash_get_protected_region
source · pub unsafe extern "C" fn esp_flash_get_protected_region(
chip: *mut esp_flash_t,
region: *const esp_flash_region_t,
out_protected: *mut bool,
) -> esp_err_t
Expand description
@brief Detect if a region of the SPI flash chip is protected
@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[out] out_protected Pointer to a flag which is set based on the protected status for this region.
@note It is possible for this result to be false 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.