42#define IOT_FLASH_SUCCESS ( 0 )
43#define IOT_FLASH_INVALID_VALUE ( 1 )
44#define IOT_FLASH_WRITE_FAILED ( 2 )
45#define IOT_FLASH_READ_FAILED ( 3 )
46#define IOT_FLASH_ERASE_FAILED ( 4 )
47#define IOT_FLASH_DEVICE_BUSY ( 5 )
48#define IOT_FLASH_CTRL_OP_FAILED ( 6 )
49#define IOT_FLASH_FUNCTION_NOT_SUPPORTED ( 7 )
86typedef struct IotFlashInfo
103typedef struct IotFlashWriteProtectConfig
113typedef enum IotFlashIoctlRequest
131struct IotFlashDescriptor;
153 void * pvUserContext );
209 void * pvUserContext );
231 void *
const pvBuffer );
295 uint32_t ulStartAddress,
336 uint8_t *
const pvBuffer,
358 uint8_t *
const pvBuffer,
387 uint8_t *
const pvBuffer,
415 uint8_t *
const pvBuffer,
#define IOT_FLASH_ERASE_FAILED
Definition: iot_flash.h:46
#define IOT_FLASH_SUCCESS
Return values used by this driver.
Definition: iot_flash.h:42
int32_t iot_flash_read_sync(IotFlashHandle_t const pxFlashHandle, uint32_t ulAddress, uint8_t *const pvBuffer, size_t xBytes)
iot_flash_read_sync is used to read data from flash. This is a blocking operation and waits until the...
IotFlashIoctlRequest_t
Ioctl request types.
Definition: iot_flash.h:114
int32_t iot_flash_write_sync(IotFlashHandle_t const pxFlashHandle, uint32_t ulAddress, uint8_t *const pvBuffer, size_t xBytes)
iot_flash_write_sync is used to write data to flash starting at the address provided....
int32_t iot_flash_close(IotFlashHandle_t const pxFlashHandle)
iot_flash_close is used to close the flash device. If any operations are in progress when close is ca...
IotFlashHandle_t iot_flash_open(int32_t lFlashInstance)
iot_flash_open is used to initialize the flash device. This must be called before using any other fla...
void(* IotFlashCallback_t)(IotFlashOperationStatus_t xStatus, void *pvUserContext)
Flash notification callback type. This callback can be passed to the driver by using iot_flash_set_ca...
Definition: iot_flash.h:152
int32_t iot_flash_ioctl(IotFlashHandle_t const pxFlashHandle, IotFlashIoctlRequest_t xRequest, void *const pvBuffer)
iot_flash_ioctl is used to configure the flash parameters and setup certain flash operations and also...
#define IOT_FLASH_READ_FAILED
Definition: iot_flash.h:45
IotFlashInfo_t * iot_flash_getinfo(IotFlashHandle_t const pxFlashHandle)
iot_flash_getinfo is used to get the information about the physical flash device.
int32_t iot_flash_erase_sectors(IotFlashHandle_t const pxFlashHandle, uint32_t ulStartAddress, size_t xSize)
iot_flash_erase_sectors is used to erase data in flash from the start of the address specified until ...
int32_t iot_flash_erase_chip(IotFlashHandle_t const pxFlashHandle)
iot_erase_chip is used to erase the entire flash chip. If there is another flash operation is in prog...
#define IOT_FLASH_WRITE_FAILED
Definition: iot_flash.h:44
struct IotFlashDescriptor * IotFlashHandle_t
IotFlashHandle_t type is the flash handle returned by calling iot_flash_open() this is initialized in...
Definition: iot_flash.h:138
IotFlashStatus_t
Flash current status.
Definition: iot_flash.h:55
void iot_flash_set_callback(IotFlashHandle_t const pxFlashHandle, IotFlashCallback_t xCallback, void *pvUserContext)
iot_flash_set_callback is used to set the callback to be called upon completion of erase/program/read...
int32_t iot_flash_write_async(IotFlashHandle_t const pxFlashHandle, uint32_t ulAddress, uint8_t *const pvBuffer, size_t xBytes)
iot_flash_write_async is used to write data to flash starting at the address provided....
int32_t iot_flash_read_async(IotFlashHandle_t const pxFlashHandle, uint32_t ulAddress, uint8_t *const pvBuffer, size_t xBytes)
iot_flash_read_async is used to read data from flash. This is an asynchronous (non-blocking) operatio...
IotFlashOperationStatus_t
Flash driver last operation status.
Definition: iot_flash.h:67
IotFlashWriteProtect_t
Flash sector protection type.
Definition: iot_flash.h:78
@ eSetFlashBlockProtection
Definition: iot_flash.h:115
@ eGetFlashBlockProtection
Definition: iot_flash.h:116
@ eResumeFlashProgramErase
Definition: iot_flash.h:121
@ eGetFlashStatus
Definition: iot_flash.h:123
@ eGetFlashRxNoOfbytes
Definition: iot_flash.h:125
@ eGetFlashTxNoOfbytes
Definition: iot_flash.h:124
@ eSuspendFlashProgramErase
Definition: iot_flash.h:118
@ eFlashCmdInProgress
Definition: iot_flash.h:57
@ eFlashIdle
Definition: iot_flash.h:56
@ eFlashProgramSuspended
Definition: iot_flash.h:59
@ eFlashEraseFailed
Definition: iot_flash.h:58
@ eFlashLastWriteFailed
Definition: iot_flash.h:71
@ eFlashCompleted
Definition: iot_flash.h:68
@ eFlashLastReadFailed
Definition: iot_flash.h:70
@ eFlashLastEraseFailed
Definition: iot_flash.h:69
@ eFlashReadOnly
Definition: iot_flash.h:80
@ eFlashReadWrite
Definition: iot_flash.h:79
flash information
Definition: iot_flash.h:87
uint8_t ucAsyncSupported
Definition: iot_flash.h:95
uint32_t ulLockSupportSize
Definition: iot_flash.h:92
uint32_t ulFlashID
Definition: iot_flash.h:97
uint32_t ulFlashSize
Definition: iot_flash.h:88
uint32_t ulBlockSize
Definition: iot_flash.h:89
uint32_t ulPageSize
Definition: iot_flash.h:91
uint32_t ulSectorSize
Definition: iot_flash.h:90
Flash protection configuration.
Definition: iot_flash.h:104
IotFlashWriteProtect_t xProtectionLevel
Definition: iot_flash.h:107
uint32_t ulAddress
Definition: iot_flash.h:105
uint32_t ulSize
Definition: iot_flash.h:106