FLASH Interface
FLASH Platform interface
FLASH Overview
Flash memory is a non-volatile storage technology commonly used in embedded systems, microcontrollers, and electronic devices to store code, configuration data, and other information. It retains data even when the power is turned off, making it ideal for long-term storage needs.
Supported Communication Modes
The following modes of FLASH:
Blocking - The operation (e.g., read, write, or erase) is performed synchronously, meaning the function call waits until the operation is complete before returning control to the caller.
Non-Blocking - The function returns immediately after initiating the operation. A callback or interrupt is used to notify the completion of the operation, allowing other tasks to execute concurrently.
FLASH BUS Interface
The Flash bus interface defines how the flash memory is connected to the system:
FLASH Internal Type : The flash memory is located within the internal device memory.
FLASH External Type : The flash memory is an external device connected to the system.
FLASH Interface SPI : The flash memory is an external device connected via the SPI (Serial Peripheral Interface) bus.
Application Interface
Users can directly call the API’s though most of them will be called by device drivers.
The below table captures the functions that are to be called from the application layer.
Function |
Description |
|---|---|
rs_flash_open |
To open the FLASH interface. |
rs_flash_set_config |
To configure the FLASH interface. |
rs_flash_enable_write |
To enables write access for the FLASH |
rs_flash_disable_write |
To disables write access in the FLASH |
rs_flash_erase |
To erases the given page in the FLASH |
rs_flash_write |
To writes the given data in the FLASH |
rs_flash_read |
To reads the data from the FLASH |
rs_flash_register_completion_callback |
Registers the given callback function for completion of FLASH operation |
rs_flash_read_uuid |
To reads UUID from the FLASH. |
rs_flash_close |
To close the FLASH |
Error Code
Every API’s for the FLASH returns some success or failure values. Please refer below section,
Implementation Guide
This section explains how to implement the FLASH interface using the RAPIDSEA stack, the steps to be followed are
Configure the FLASH interface(flash type, interface handle, page count, page size,write protect port and pin).
Open the FLASH depends on the FLASH type.
Register the FLASH completion callback.
Perform the read and write FLASH functions as required and handle the error codes.
Close the FLASH interface.
Documentation from the relevant header as follows:
Warning
doxygenfile: Cannot find file “rs_flash.h