spi_flash: refactor spi_flash.h to esp_rom_spiflash.h but keep the content in spi_flash.h

This commit is contained in:
Cao Sen Miao
2021-11-26 16:04:49 +08:00
parent 8e220f7bbe
commit d397464fc4
39 changed files with 2171 additions and 152 deletions

View File

@@ -30,7 +30,6 @@
const static char *TAG = "Octal Flash";
// default value is rom_default_spiflash_legacy_flash_func
extern const spiflash_legacy_funcs_t *rom_spiflash_legacy_funcs;
extern int SPI_write_enable(void *spi);
static uint32_t s_chip_id;
@@ -78,7 +77,7 @@ static void s_set_flash_dtr_str_opi_mode(int spi_num, uint8_t val)
int dummy = 0;
int data_bit_len = 8;
SPI_write_enable(&g_rom_flashchip);
esp_rom_spiflash_write_enable(&g_rom_flashchip);
//SPI command, WRCR2
esp_rom_opiflash_exec_cmd(spi_num, ESP_ROM_SPIFLASH_FASTRD_MODE,
SPI_FLASH_SPI_CMD_WRCR2, cmd_len,
@@ -129,7 +128,7 @@ static void s_set_flash_ouput_driver_strength(int spi_num, uint8_t strength)
//Write
//SPI command, WRSR/WRCR
data_bit_len = 16;
SPI_write_enable(&g_rom_flashchip);
esp_rom_spiflash_write_enable(&g_rom_flashchip);
esp_rom_opiflash_exec_cmd(spi_num, ESP_ROM_SPIFLASH_FASTRD_MODE,
SPI_FLASH_SPI_CMD_WRSRCR, cmd_len,
addr, addr_bit_len,