|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
Flash simulator specific API. More...
#include <zephyr/device.h>#include <zephyr/types.h>#include <sys/types.h>#include <zephyr/syscalls/flash_simulator.h>Go to the source code of this file.
Data Structures | |
| struct | flash_simulator_params |
| Flash simulator parameters structure. More... | |
| struct | flash_simulator_cb |
| Flash simulator callbacks structure. More... | |
Typedefs | |
| typedef int(* | flash_simulator_write_byte_cb_t) (const struct device *dev, off_t offset, uint8_t data) |
| Flash simulator write byte callback type. | |
| typedef int(* | flash_simulator_erase_unit_cb_t) (const struct device *dev, off_t unit_offset) |
| Flash simulator erase unit callback type. | |
Functions | |
| const struct flash_simulator_params * | flash_simulator_get_params (const struct device *dev) |
| Get flash simulator parameters. | |
| void | flash_simulator_set_callbacks (const struct device *dev, const struct flash_simulator_cb *cb) |
| Set flash simulator callbacks. | |
| void * | flash_simulator_get_memory (const struct device *dev, size_t *mock_size) |
| Obtain a pointer to the RAM buffer used but by the simulator. | |
Flash simulator specific API.
Extension for flash simulator.
Flash simulator erase unit callback type.
Callback used to overwrite unit erase operation. The callback gets the unit offset as the parameter. The offset is the same offset passed to the flash erase. The callback must return 0 in case of success or negative value in case of error.
| dev | Flash simulator device pointer. |
| unit_offset | Offset within the flash simulator memory. |
| typedef int(* flash_simulator_write_byte_cb_t) (const struct device *dev, off_t offset, uint8_t data) |
Flash simulator write byte callback type.
Callback used to overwrite single byte write. The callback gets the requested data and offset as the parameter. The offset is the same offset passed to the flash write. The callback must return a value to be written at the specified offset or negative value in case of error.
| dev | Flash simulator device pointer. |
| offset | Offset within the flash simulator memory. |
| data | Data byte to be written. |
Obtain a pointer to the RAM buffer used but by the simulator.
This function allows the caller to get the address and size of the RAM buffer in which the flash simulator emulates its flash memory content.
| [in] | dev | flash simulator device pointer. |
| [out] | mock_size | size of the ram buffer. |
| pointer | to the ram buffer |
| const struct flash_simulator_params * flash_simulator_get_params | ( | const struct device * | dev | ) |
Get flash simulator parameters.
This function allows the caller to get the flash simulator parameters used by the driver.
| [in] | dev | flash simulator device pointer. |
| void flash_simulator_set_callbacks | ( | const struct device * | dev, |
| const struct flash_simulator_cb * | cb ) |
Set flash simulator callbacks.
This function allows the caller to set custom callbacks for byte write and unit erase operations performed by the flash simulator.
| [in] | dev | flash simulator device pointer. |
| [in] | cb | pointer to the structure containing the callbacks. |