25 lines
543 B
C
25 lines
543 B
C
|
#ifndef SPI_FLASH_DRI_H
|
||
|
#define SPI_FLASH_DRI_H
|
||
|
|
||
|
#define SPI_FLASH_SECTOR_SIZE (4096)
|
||
|
#define SPI_FLASH_PAGE_SIZE (256)
|
||
|
|
||
|
#include <stdint.h>
|
||
|
|
||
|
|
||
|
uint32_t spi_flash_probe(void);
|
||
|
void spi_flash_sector_erase(uint32_t address);
|
||
|
int spi_flash_read(uint32_t address, void *data, int len);
|
||
|
int spi_flash_write(uint32_t address, const void *data, int len);
|
||
|
uint32_t get_flash_size(void);
|
||
|
uint8_t get_flash_manuf(void);
|
||
|
uint8_t get_flash_type(void);
|
||
|
uint8_t get_flash_capacity(void);
|
||
|
|
||
|
#else
|
||
|
|
||
|
#define spi_flash_probe() do{}while(0)
|
||
|
|
||
|
|
||
|
#endif /* GUARD */
|