Skip to content

Commit

Permalink
drivers/flash/nrf_rram: Add get_size implementation.
Browse files Browse the repository at this point in the history
Commit adds flash_get_size callback to the driver.

Signed-off-by: Dominik Ermel <[email protected]>
  • Loading branch information
de-nordic authored and kartben committed Nov 23, 2024
1 parent 383bcc7 commit eb4f2fb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/flash/soc_flash_nrf_rram.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,15 @@ static int nrf_rram_erase(const struct device *dev, off_t addr, size_t len)
return nrf_write(addr, NULL, len);
}

int nrf_rram_get_size(const struct device *dev, uint64_t *size)
{
ARG_UNUSED(dev);

*size = RRAM_SIZE;

return 0;
}

static const struct flash_parameters *nrf_rram_get_parameters(const struct device *dev)
{
ARG_UNUSED(dev);
Expand Down Expand Up @@ -337,6 +346,7 @@ static const struct flash_driver_api nrf_rram_api = {
.read = nrf_rram_read,
.write = nrf_rram_write,
.erase = nrf_rram_erase,
.get_size = nrf_rram_get_size,
.get_parameters = nrf_rram_get_parameters,
#if defined(CONFIG_FLASH_PAGE_LAYOUT)
.page_layout = nrf_rram_page_layout,
Expand Down

0 comments on commit eb4f2fb

Please sign in to comment.