36#define FLASH_REGION_MAX 4
130int16_t
flash_read(uint32_t addr, uint8_t *data, uint16_t len);
uint16_t flash_program(uint32_t addr, const uint8_t *data, uint16_t len)
Programs (writes) a data buffer to the specified flash address.
int16_t flash_init(void)
Initialise flash chip. Call this function only once, before any other function in the module.
uint32_t flash_sector_erase(uint32_t addr)
Erases a flash sector. Erased sectors will be read as 0xFF.
const struct flash_chip * flash_metadata_get(void)
Get chip metadata.
void flash_deinit(void)
Deinitialise flash chip.
int16_t flash_sector_limits(uint32_t addr, uint32_t *start, uint32_t *next)
Obtains the sector limits (start of sector, start of next sector) corresponding to the specified addr...
int16_t flash_read(uint32_t addr, uint8_t *data, uint16_t len)
Reads data from the specified flash address.
int16_t flash_copy(uint32_t dst, uint32_t src, uint16_t len)
Copy data from a flash region to other region also in flash.
Metadata of a flash chip, describing memory layout.
Definition flash.h:53
Metadata of a flash region, consisting of several sectors. /.
Definition flash.h:42