drivers: flash: add specific api for access flash_simulator RAM
For getting the address of the RAM region in the application we need to extend the api for the flash_simulator. This path introduce flash_simulator_get_memory() call which allow to do so. Signed-off-by: Sigvart Hovland <sigvart.m@gmail.com> Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
parent
20b710a78e
commit
ad4daa722a
3 changed files with 87 additions and 1 deletions
39
include/drivers/flash/flash_simulator.h
Normal file
39
include/drivers/flash/flash_simulator.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Noric Semiconductor ASA
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef __ZEPHYR_INCLUDE_DRIVERS__FLASH_SIMULATOR_H__
|
||||
#define __ZEPHYR_INCLUDE_DRIVERS__FLASH_SIMULATOR_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Flash simulator specific API.
|
||||
*
|
||||
* Extension for flash simulator.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief 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.
|
||||
*
|
||||
* @param[in] dev flash simulator device pointer.
|
||||
* @param[out] mock_size size of the ram buffer.
|
||||
*
|
||||
* @retval pointer to the ram buffer
|
||||
*/
|
||||
__syscall void *flash_simulator_get_memory(const struct device *dev,
|
||||
size_t *mock_size);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <syscalls/flash_simulator.h>
|
||||
|
||||
#endif /* __ZEPHYR_INCLUDE_DRIVERS__FLASH_SIMULATOR_H__ */
|
Loading…
Add table
Add a link
Reference in a new issue