diff options
author | Nick Brassel <[email protected]> | 2024-07-02 10:16:41 +1000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-07-02 10:16:41 +1000 |
commit | 7bc3eef8cc262e12b0f823ba4c92cf97ca3dc1fa (patch) | |
tree | fecf3ea721b91676501b579fc637fab8d4f56f23 /drivers/flash/flash_spi.h | |
parent | 641a1ce568c896a3beea80649f33a71dfeaf44af (diff) | |
download | qmk_firmware-7bc3eef8cc262e12b0f823ba4c92cf97ca3dc1fa.tar.gz qmk_firmware-7bc3eef8cc262e12b0f823ba4c92cf97ca3dc1fa.zip |
SPI flash API cleanup, add async erase capability. (#23894)
Diffstat (limited to 'drivers/flash/flash_spi.h')
-rw-r--r-- | drivers/flash/flash_spi.h | 31 |
1 files changed, 2 insertions, 29 deletions
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 <http://www.gnu.org/licenses/>. #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 <http://www.gnu.org/licenses/>. 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 <stdint.h> - -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 |