Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nrf fromtree] drivers: flash: nrf: Add possibility to add custom con… #2675

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions drivers/flash/Kconfig.nrf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ config FLASH_NRF_FORCE_ALT
This option can be enabled to force an alternative implementation
of the flash driver.

config SOC_FLASH_NRF_CUSTOM_CONTEXT
bool "Nordic nRFx flash driver operation custom context"
depends on SOC_COMPATIBLE_NRF
help
Enable pointer to custom context, for drivers that need to store additional data,
not covered by the structure.

menuconfig SOC_FLASH_NRF
bool "Nordic Semiconductor nRF flash driver"
default y
Expand Down
3 changes: 3 additions & 0 deletions drivers/flash/soc_flash_nrf.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ struct flash_context {
#if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE)
uint32_t flash_addr_next;
#endif /* CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE */
#if defined(CONFIG_SOC_FLASH_NRF_CUSTOM_CONTEXT)
void *custom_context;
#endif
}; /*< Context type for f. @ref write_op @ref erase_op */

#ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE
Expand Down