Zephyr API Documentation
2.7.0-rc2
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. More... | |
typedef int(* | flash_api_erase) (const struct device *dev, off_t offset, size_t size) |
Flash erase implementation handler type. More... | |
typedef int(* | flash_api_write_protection) (const struct device *dev, bool enable) |
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. More... | |
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) |
FLASH internal Interface.
typedef int(* flash_api_erase) (const struct device *dev, off_t offset, size_t size) |
#include <include/drivers/flash.h>
Flash erase implementation handler type.
typedef const struct flash_parameters *(* flash_api_get_parameters) (const struct device *dev) |
#include <include/drivers/flash.h>
typedef void(* flash_api_pages_layout) (const struct device *dev, const struct flash_pages_layout **layout, size_t *layout_size) |
#include <include/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 <include/drivers/flash.h>
#include <include/drivers/flash.h>
#include <include/drivers/flash.h>
typedef int(* flash_api_write) (const struct device *dev, off_t offset, const void *data, size_t len) |
#include <include/drivers/flash.h>
Flash write implementation handler type.
#include <include/drivers/flash.h>