spi_flash: Add spi_flash_cache_enabled() test function

This commit is contained in:
Angus Gratton
2017-03-02 15:21:03 +11:00
parent 6ee5a1e492
commit 3442d4d463
4 changed files with 66 additions and 0 deletions

View File

@@ -275,3 +275,9 @@ static void IRAM_ATTR spi_flash_restore_cache(uint32_t cpuid, uint32_t saved_sta
}
}
IRAM_ATTR bool spi_flash_cache_enabled()
{
return REG_GET_BIT(DPORT_PRO_CACHE_CTRL_REG, DPORT_PRO_CACHE_ENABLE)
&& REG_GET_BIT(DPORT_APP_CACHE_CTRL_REG, DPORT_APP_CACHE_ENABLE);
}