#include <stddef.h>
#include <stdint.h>
#include "flash_layout.h"
#include "psa/error.h"
#include "its_utils.h"
Go to the source code of this file.
#define ITS_BLOCK_INVALID_ID 0xFFFFFFFFU |
#define ITS_FLASH_ALIGNMENT ITS_FLASH_PROGRAM_UNIT |
#define ITS_FLASH_MAX_ALIGNMENT |
Value:
#define ITS_FLASH_ALIGNMENT
#define ITS_UTILS_MAX(x, y)
Evaluates to the maximum of the two parameters.
#define PS_FLASH_ALIGNMENT
Provides a compile-time constant for the maximum program unit required by any flash device that can be accessed through this interface.
Definition at line 43 of file its_flash.h.
#define PS_FLASH_ALIGNMENT PS_FLASH_PROGRAM_UNIT |
Enumerates the available flash devices.
- Note
- The enumeration constants are used as array indexes. They should be sequential starting from zero to minimise the array size.
Enumerator |
---|
ITS_FLASH_ID_INTERNAL |
|
ITS_FLASH_ID_EXTERNAL |
|
Definition at line 52 of file its_flash.h.
psa_status_t its_flash_block_to_block_move |
( |
const struct its_flash_info_t * |
info, |
|
|
uint32_t |
dst_block, |
|
|
size_t |
dst_offset, |
|
|
uint32_t |
src_block, |
|
|
size_t |
src_offset, |
|
|
size_t |
size |
|
) |
| |
Moves data from source block ID to destination block ID.
- Parameters
-
[in] | info | Flash device information |
[in] | dst_block | Destination block ID |
[in] | dst_offset | Destination offset position from the init of the destination block |
[in] | src_block | Source block ID |
[in] | src_offset | Source offset position from the init of the source block |
[in] | size | Number of bytes to moves |
- Note
- This function assumes all input values are valid. That is, the address range, based on blockid, offset and size, is a valid range in flash. It also assumes that the destination block is already erased and ready to be written.
- Returns
- Returns PSA_SUCCESS if the function is executed correctly. Otherwise, it returns PSA_ERROR_STORAGE_FAILURE.
Definition at line 56 of file its_flash.c.
Gets the flash info structure for the provided flash device.
- Parameters
-
[in] | id | Identifier of the flash device. |
- Returns
- Pointer to the flash info struct.
Definition at line 27 of file its_flash.c.