Skip to content

Commit b0584b7

Browse files
de-nordickartben
authored andcommitted
drivers/flash/nrf: Add flash_get_size API call
The commit adds implementation of flash_get_size. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 6298fed commit b0584b7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/flash/soc_flash_nrf.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,15 @@ static int flash_nrf_erase(const struct device *dev, off_t addr, size_t size)
261261
return ret;
262262
}
263263

264+
static int flash_nrf_get_size(const struct device *dev, uint64_t *size)
265+
{
266+
ARG_UNUSED(dev);
267+
268+
*size = (uint64_t)nrfx_nvmc_flash_size_get();
269+
270+
return 0;
271+
}
272+
264273
#if defined(CONFIG_FLASH_PAGE_LAYOUT)
265274
static struct flash_pages_layout dev_layout;
266275

@@ -286,6 +295,7 @@ static const struct flash_driver_api flash_nrf_api = {
286295
.write = flash_nrf_write,
287296
.erase = flash_nrf_erase,
288297
.get_parameters = flash_nrf_get_parameters,
298+
.get_size = flash_nrf_get_size,
289299
#if defined(CONFIG_FLASH_PAGE_LAYOUT)
290300
.page_layout = flash_nrf_pages_layout,
291301
#endif

0 commit comments

Comments
 (0)