27#define FLASH_MEMORY_ALIGNMENT 4U
30#define FLASH_BASE_ADDR (0x08000000U)
32#ifndef FLASH_PAGE_SIZE
34#define FLASH_PAGE_SIZE 0x800U
38#define FLASH_PAGE_TO_ADDR(page) (FLASH_BASE_ADDR + ((page)*FLASH_PAGE_SIZE))
41#define FLASH_ADDR_TO_PAGE(addr) (((addr)-FLASH_BASE_ADDR) / FLASH_PAGE_SIZE)
44#define FLASH_TIMEOUT_MS 100U
47#define NUM_FLASH_PAGES 128U
StatusCode flash_read(uintptr_t address, uint8_t *buffer, size_t buffer_len)
Read from the flash memory and store data into a buffer.
Definition: flash.c:55
StatusCode flash_write(uintptr_t address, uint8_t *buffer, size_t buffer_len)
Write a buffer of data into the flash memory.
Definition: flash.c:73
StatusCode flash_init()
Initialize flash API.
Definition: flash.c:50
StatusCode flash_erase(uint8_t start_page, uint8_t num_pages)
Erase pages of flash memory.
Definition: flash.c:104
StatusCode
StatusCodes for various errors.
Definition: status.h:27