10 #include "Driver_Flash.h"
22 uint32_t block_id,
size_t offset)
32 err = ((ARM_DRIVER_FLASH *)info->
flash_dev)->Initialize(NULL);
33 if (err != ARM_DRIVER_OK) {
41 uint32_t block_id, uint8_t *buff,
size_t offset,
45 uint32_t addr = get_phys_address(info, block_id, offset);
47 err = ((ARM_DRIVER_FLASH *)info->
flash_dev)->ReadData(addr, buff, size);
48 if (err != ARM_DRIVER_OK) {
56 uint32_t block_id,
const uint8_t *buff,
57 size_t offset,
size_t size)
60 uint32_t addr = get_phys_address(info, block_id, offset);
62 err = ((ARM_DRIVER_FLASH *)info->
flash_dev)->ProgramData(addr, buff, size);
63 if (err != ARM_DRIVER_OK) {
87 addr = get_phys_address(info, block_id, offset);
89 err = ((ARM_DRIVER_FLASH *)info->
flash_dev)->EraseSector(addr);
90 if (err != ARM_DRIVER_OK) {
psa_status_t its_flash_nor_erase(const struct its_flash_info_t *info, uint32_t block_id)
Erases block ID data.
psa_status_t its_flash_nor_write(const struct its_flash_info_t *info, uint32_t block_id, const uint8_t *buff, size_t offset, size_t size)
Writes block data to the position specified by block ID and offset.
#define PSA_ERROR_STORAGE_FAILURE
Implementations of the flash interface functions for a NOR flash device. See its_flash.h for full documentation of functions.
psa_status_t its_flash_nor_flush(const struct its_flash_info_t *info)
Flushes modifications to a block to flash.
psa_status_t its_flash_nor_read(const struct its_flash_info_t *info, uint32_t block_id, uint8_t *buff, size_t offset, size_t size)
Reads block data from the position specified by block ID and offset.
psa_status_t its_flash_nor_init(const struct its_flash_info_t *info)
Initialize the Flash Interface.
struct flash_fs_info_t fs_info
Structure containing the required information about a flash device to be used by the ITS Flash FS...
int32_t psa_status_t
Function return status.