| // Copyright 2023 Google LLC. | |
| #ifndef SW_DEVICE_LIB_SPI_FLASH_H_ | |
| #define SW_DEVICE_LIB_SPI_FLASH_H_ | |
| #include <stdint.h> | |
| #include "sw/device/lib/dif/dif_base.h" | |
| #define SPI_PAGE_SIZE (512) | |
| #if defined(__cplusplus) | |
| extern "C" { | |
| #endif | |
| /* General SPI flash related methods */ | |
| dif_result_t spi_flash_init(void); | |
| dif_result_t spi_flash_read_page(uint32_t page, uint8_t* buf); | |
| /* Tar filesystem related methods */ | |
| dif_result_t load_file_from_tar(const char* filename, void* addr); | |
| #if defined(__cplusplus) | |
| } | |
| #endif | |
| #endif // SW_DEVICE_LIB_SPI_FLASH_H_ |