41#define ICE_FLASH_PAGE_SIZE 256
42#define ICE_FLASH_SECTOR_SIZE 4096
43#define ICE_FLASH_BLOCK_SIZE 65536
void ice_flash_read(uint32_t addr, uint8_t *buf, size_t sz)
Communicate to the chip over SPI and read multiple bytes at chosen address onto onto a buffer.
void ice_flash_program_page(uint32_t addr, uint8_t const page[ICE_FLASH_PAGE_SIZE])
Program a page of the flash chip at the given address.
#define ICE_FLASH_PAGE_SIZE
The size of the flash.
Definition ice_flash.h:41
void ice_flash_erase_sector(uint32_t addr)
Erase a sector of the flash chip at the given address.
void ice_flash_erase_block(uint32_t addr)
Send a command to erase a whole block.
void ice_flash_init(void)
Initialise the SPI1 peripheral, dedicated to flashing the FPGA.
void ice_flash_wakeup(void)
Send a command to wakeup the chip.
void ice_flash_sleep(void)
Send a command to put the chip to sleep.
void ice_flash_erase_chip(void)
Send a command to erase the whole chip.