From 7bc3eef8cc262e12b0f823ba4c92cf97ca3dc1fa Mon Sep 17 00:00:00 2001
From: Nick Brassel
Date: Tue, 2 Jul 2024 10:16:41 +1000
Subject: SPI flash API cleanup, add async erase capability. (#23894)
---
drivers/flash/flash_spi.h | 31 ++-----------------------------
1 file changed, 2 insertions(+), 29 deletions(-)
(limited to 'drivers/flash/flash_spi.h')
diff --git a/drivers/flash/flash_spi.h b/drivers/flash/flash_spi.h
index 87460fc210..7a979daf0f 100644
--- a/drivers/flash/flash_spi.h
+++ b/drivers/flash/flash_spi.h
@@ -17,6 +17,8 @@ along with this program. If not, see .
#pragma once
+#include "flash.h"
+
/* All the following default configurations are based on MX25L4006E Nor FLASH. */
/*
@@ -105,32 +107,3 @@ along with this program. If not, see .
The page count of the FLASH, calculated by total FLASH size and page size.
*/
#define EXTERNAL_FLASH_PAGE_COUNT ((EXTERNAL_FLASH_SIZE) / (EXTERNAL_FLASH_PAGE_SIZE))
-
-typedef int16_t flash_status_t;
-
-#define FLASH_STATUS_SUCCESS (0)
-#define FLASH_STATUS_ERROR (-1)
-#define FLASH_STATUS_TIMEOUT (-2)
-#define FLASH_STATUS_BAD_ADDRESS (-3)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include
-
-void flash_init(void);
-
-flash_status_t flash_erase_chip(void);
-
-flash_status_t flash_erase_block(uint32_t addr);
-
-flash_status_t flash_erase_sector(uint32_t addr);
-
-flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len);
-
-flash_status_t flash_write_block(uint32_t addr, const void *buf, size_t len);
-
-#ifdef __cplusplus
-}
-#endif
--
cgit v1.2.3