drivers/flash/nrf_rram: Add get_size implementation.

Commit adds flash_get_size callback to the driver.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
Dominik Ermel 2024-10-23 21:19:23 +02:00 committed by Benjamin Cabé
parent 383bcc790c
commit eb4f2fb44a
1 changed files with 10 additions and 0 deletions

View File

@ -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);
@ -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,