WINC Flash Interface. More...
Go to the source code of this file.
Classes | |
struct | tstrBackup |
struct | tstrDataAccessInitParams |
This structure contains parameters for initializing a local data access (read, erase or write). More... | |
struct | tstrDataAccessParams |
This structure contains data for local data access (read, erase or write). More... | |
struct | tstrFlashAccess |
struct | tstrFlashAccessPersistent |
Enumerations | |
enum | tenuBackupStatus { BACKUP_STATUS_EMPTY = 0xFFFFFFFF, BACKUP_STATUS_NOT_ACTIVE = BACKUP_SIGNATURE | 0xFFFFFF00, BACKUP_STATUS_ACTIVE = BACKUP_SIGNATURE, BACKUP_STATUS_DONE = 0x00000000 } |
enum | tenuCSOp { CS_INITIALIZE, CS_INVALIDATE_RB, CS_VALIDATE_RB, CS_SWITCH, CS_VALIDATE_SWITCH, CS_GET_ACTIVE, CS_GET_INACTIVE, CS_DEINITIALIZE } |
enum | tenuFlashAccessItemMode { FLASH_ITEM_ADD, FLASH_ITEM_REMOVE, FLASH_ITEM_READ, FLASH_ITEM_READIDX } |
Transfer modes available for accessing items in WINC flash stores such as TLS root certificate store. More... | |
enum | tenuFlashAccessStatus { FLASH_STATUS_EMPTY = 0xFFFFFFFF, FLASH_STATUS_NOT_ACTIVE = 0xFFFFFF00, FLASH_STATUS_ACTIVE = 0xFFFF0000, FLASH_STATUS_DONE = 0xFF000000 } |
enum | tenuMemId { MEM_ID_WINC_FLASH = 0x80000000, MEM_ID_WINC_ACTIVE, MEM_ID_WINC_INACTIVE, MEM_ID_NONE = 0xFFFFFFFF } |
Functions | |
sint8 | image_get_target (uint8 *pu8Target) |
uint8 | is_internal_info (tpfDataAccessFn pfFn) |
sint8 | prepare_backup (uint32 u32Target) |
sint8 | recover_backup (void) |
sint8 | rootcert_access (tenuFlashAccessItemMode enuMode, tstrRootCertEntryHeader *pstrReferenceHdr, uint16 *pu16EntrySize, uint8 *pu8Buff, uint32 *pu32Offset) |
sint8 | rootcert_get_size (tstrRootCertEntryHeader *pstrHdr, uint16 *pu16Size) |
void | set_internal_info (tpfDataAccessFn *ppfFn, uint32 u32LocationId) |
void | set_internal_info_ptr (tpfDataAccessFn *ppfFn, uint8 *pu8Ptr) |
sint8 | transfer_run (tstrFlashAccess *pstrFlashAccess) |
sint8 | winc_flash_write_verify (uint8 *pu8Buf, uint32 u32Offset, uint32 u32Size) |
Variables | |
uint16 | gu16LastAccessId |
uint8 | gu8Changed |
uint8 | gu8Init |
uint8 | gu8Reset |
uint8 | gu8Success |
WINC Flash Interface.
Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
Definition in file nmflash.h.
#define FLASH_ACCESS_OPTION_COMPARE_AFTER NBIT4 |
Bit 4 of u8AccessOptions parameter of various function APIs.
Request for byte-wise verification of write.
Applies to data transfer in either direction.
If set, FLASH_FN_FLAGS_COMPARE_AFTER will be set in subsequent call to function of type tpfDataAccessFn.
#define FLASH_ACCESS_OPTION_COMPARE_BEFORE NBIT3 |
Bit 3 of u8AccessOptions parameter of various function APIs.
Request to compare new data against existing data before erasing/writing, to avoid unnecessary operations.
Applies to data transfer in either direction.
If set, FLASH_FN_FLAGS_COMPARE_BEFORE will be set in subsequent call to function of type tpfDataAccessFn.
#define FLASH_ACCESS_OPTION_ERASE_FIRST NBIT0 |
Bit 0 of u8AccessOptions parameter of various function APIs.
Request to erase existing data before writing.
Only applies when module is providing data to the MCU application.
If set, FLASH_FN_FLAGS_ERASE will be set in subsequent call to function of type tpfDataAccessFn.
#define FLASH_ACCESS_OPTION_KEEP_SURROUNDING NBIT1 |
Bit 1 of u8AccessOptions parameter of various function APIs.
When set with FLASH_ACCESS_OPTION_ERASE_FIRST, this is a request to do read-modify-erase-write (eg if MCU application is storing received data in flash).
Only applies when module is providing data to the MCU application.
If set, FLASH_FN_FLAGS_READ_SURROUNDING may be set in subsequent call to function of type tpfDataAccessFn.
#define FLASH_ACCESS_OPTION_USE_BACKUP NBIT2 |
Bit 2 of u8AccessOptions parameter of various function APIs.
When set with FLASH_ACCESS_OPTION_ERASE_FIRST and FLASH_ACCESS_OPTION_KEEP_SURROUNDING, this is a request to keep a persistent backup of modified contents during read-modify-erase-write.
Only applies when module is providing data to the MCU application.
If set, FLASH_FN_FLAGS_BACKUP may be set in subsequent call to function of type tpfDataAccessFn.
#define FLASH_ACCESS_WINC_MASK (FLASH_ACCESS_OPTION_COMPARE_BEFORE | FLASH_ACCESS_OPTION_COMPARE_AFTER) |
#define FLASH_BACKUP_STA_SZ sizeof(tenuBackupStatus) |
#define FLASH_BACKUP_STORE_OFFSET (HOST_CONTROL_FLASH_OFFSET + HOST_CONTROL_FLASH_SZ - FLASH_BACKUP_STORE_SZ) |
#define FLASH_BACKUP_STORE_SZ (2*sizeof(tstrBackup)) |
#define FLASH_FN_FLAGS_BACKUP NBIT2 |
Bit 2 of u8Flags parameter of tpfDataAccessFn.
Save buffer to a backup persistent location in case of power loss after subsequent erase. A (persistent) record of the backup status must also be kept. Typically not set unless FLASH_FN_FLAGS_READ_SURROUNDING and FLASH_FN_FLAGS_ERASE are both set.
#define FLASH_FN_FLAGS_COMPARE_AFTER NBIT5 |
Bit 5 of u8Flags parameter of tpfDataAccessFn.
Compare buffer against written data, to provide verification. Typically not set unless FLASH_FN_FLAGS_WRITE is set.
#define FLASH_FN_FLAGS_COMPARE_BEFORE NBIT0 |
Bit 0 of u8Flags parameter of tpfDataAccessFn.
Compare buffer against existing data, to avoid unnecessary operation.
#define FLASH_FN_FLAGS_ERASE NBIT3 |
Bit 3 of u8Flags parameter of tpfDataAccessFn.
Erase existing data before writing.
#define FLASH_FN_FLAGS_READ NBIT6 |
Bit 6 of u8Flags parameter of tpfDataAccessFn.
Read data to buffer. Typically this would be the only flag set, meaning read the existing data. However, if other flags are set, the read should be performed at the end.
#define FLASH_FN_FLAGS_READ_SURROUNDING NBIT1 |
Bit 1 of u8Flags parameter of tpfDataAccessFn.
Fill uninitialized portion of buffer with existing data to avoid losing it in subsequent erase. Typically not set unless FLASH_FN_FLAGS_ERASE is set.
#define FLASH_FN_FLAGS_WRITE NBIT4 |
Bit 4 of u8Flags parameter of tpfDataAccessFn.
Write buffer.
#define FLASH_SECTOR_SIZE FLASH_SECTOR_SZ |
#define FLASH_SIG_STA_SZ (FLASH_SIG_SZ+FLASH_STA_SZ) |
#define FLASH_SIGNATURE HOST_CONTROL_FLASH_SIG |
#define FLASH_STA_SZ (sizeof(tenuFlashAccessStatus)) |
enum tenuBackupStatus |
enum tenuCSOp |
Transfer modes available for accessing items in WINC flash stores such as TLS root certificate store.
enum tenuMemId |
uint8 is_internal_info | ( | tpfDataAccessFn | pfFn | ) |
sint8 rootcert_access | ( | tenuFlashAccessItemMode | enuMode, |
tstrRootCertEntryHeader * | pstrReferenceHdr, | ||
uint16 * | pu16EntrySize, | ||
uint8 * | pu8Buff, | ||
uint32 * | pu32Offset | ||
) |
sint8 rootcert_get_size | ( | tstrRootCertEntryHeader * | pstrHdr, |
uint16 * | pu16Size | ||
) |
void set_internal_info | ( | tpfDataAccessFn * | ppfFn, |
uint32 | u32LocationId | ||
) |
void set_internal_info_ptr | ( | tpfDataAccessFn * | ppfFn, |
uint8 * | pu8Ptr | ||
) |
sint8 transfer_run | ( | tstrFlashAccess * | pstrFlashAccess | ) |