![]() |
NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
SPI flash driver. More...
#include <stdint.h>
Go to the source code of this file.
Functions | |
int | spi_flash_check (void) |
int | spi_flash_read_word (uint32_t addr, uint32_t *rdata) |
int | spi_flash_write_word (uint32_t addr, uint32_t wdata) |
int | spi_flash_erase_sector (uint32_t addr) |
SPI flash driver.
int spi_flash_check | ( | void | ) |
Check if SPI and flash are available/working by making sure the WEL flag of the flash status register can be set and cleared again.
int spi_flash_erase_sector | ( | uint32_t | addr | ) |
Erase sector (64kB) at base address.
[in] | addr | Base address of sector to erase. |
int spi_flash_read_word | ( | uint32_t | addr, |
uint32_t * | rdata ) |
Read byte from SPI flash.
[in] | addr | Word-aligned address. |
[in,out] | rdata | Pointer for returned data (uint32_t). |
int spi_flash_write_word | ( | uint32_t | addr, |
uint32_t | wdata ) |
Write word to SPI flash.
addr | SPI flash write address. |
wdata | SPI flash write data. |