Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
|
FLASH internal Interface . More...
Data Structures | |
struct | flash_pages_layout |
struct | flash_driver_api |
Typedefs | |
typedef int(* | flash_api_read) (const struct device *dev, off_t offset, void *data, size_t len) |
typedef int(* | flash_api_write) (const struct device *dev, off_t offset, const void *data, size_t len) |
Flash write implementation handler type. | |
typedef int(* | flash_api_erase) (const struct device *dev, off_t offset, size_t size) |
Flash erase implementation handler type. | |
typedef int(* | flash_api_get_size) (const struct device *dev, uint64_t *size) |
Get device size in bytes. | |
typedef const struct flash_parameters *(* | flash_api_get_parameters) (const struct device *dev) |
typedef void(* | flash_api_pages_layout) (const struct device *dev, const struct flash_pages_layout **layout, size_t *layout_size) |
Retrieve a flash device's layout. | |
typedef int(* | flash_api_sfdp_read) (const struct device *dev, off_t offset, void *data, size_t len) |
typedef int(* | flash_api_read_jedec_id) (const struct device *dev, uint8_t *id) |
typedef int(* | flash_api_ex_op) (const struct device *dev, uint16_t code, const uintptr_t in, void *out) |
FLASH internal Interface .
#include <zephyr/drivers/flash.h>
Flash erase implementation handler type.
The callback is optional for RAM non-volatile devices, which do not require erase by design, but may be provided if it allows device to work more effectively, or if device has a support for internal fill operation the erase in driver uses.
typedef int(* flash_api_ex_op) (const struct device *dev, uint16_t code, const uintptr_t in, void *out) |
#include <zephyr/drivers/flash.h>
typedef const struct flash_parameters *(* flash_api_get_parameters) (const struct device *dev) |
#include <zephyr/drivers/flash.h>
#include <zephyr/drivers/flash.h>
Get device size in bytes.
Returns total logical device size in bytes.
[in] | dev | flash device. |
[out] | size | device size in bytes. |
typedef void(* flash_api_pages_layout) (const struct device *dev, const struct flash_pages_layout **layout, size_t *layout_size) |
#include <zephyr/drivers/flash.h>
Retrieve a flash device's layout.
A flash device layout is a run-length encoded description of the pages on the device. (Here, "page" means the smallest erasable area on the flash device.)
For flash memories which have uniform page sizes, this routine returns an array of length 1, which specifies the page size and number of pages in the memory.
Layouts for flash memories with nonuniform page sizes will be returned as an array with multiple elements, each of which describes a group of pages that all have the same size. In this case, the sequence of array elements specifies the order in which these groups occur on the device.
dev | Flash device whose layout to retrieve. |
layout | The flash layout will be returned in this argument. |
layout_size | The number of elements in the returned layout. |
#include <zephyr/drivers/flash.h>
#include <zephyr/drivers/flash.h>
#include <zephyr/drivers/flash.h>
typedef int(* flash_api_write) (const struct device *dev, off_t offset, const void *data, size_t len) |
#include <zephyr/drivers/flash.h>
Flash write implementation handler type.