You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: nvmc.rs
    path of file: ./repos/embassy/embassy-nrf/src
    
    the code of the file until where you have to start completion: //! Non-Volatile Memory Controller (NVMC, AKA internal flash) driver.

use core::{ptr, slice};

use embassy_hal_internal::{into_ref, PeripheralRef};
use embedded_storage::nor_flash::{
    ErrorType, MultiwriteNorFlash, NorFlash, NorFlashError, NorFlashErrorKind, ReadNorFlash,
};

use crate::peripherals::NVMC;
use crate::{pac, Peripheral};

#[cfg(not(feature = "_nrf5340-net"))]
/// Erase size of NVMC flash in bytes.
pub const PAGE_SIZE: usize = 4096;
#[cfg(f
    
    fn erase(&mut self, from: u32, to: u32) -> Result<(), Self::Error> {
        if to < from || to as usize > FLASH_SIZE {
            return Err(Error::OutOfBounds);
        }
        if from as usize % PAGE_SIZE != 0 || to as usize % PAGE_SIZE != 0 {
            return Err(Error::Unaligned);
        }

        self.enable_erase();
        self.wait_ready();

        for page_addr in (from..to).step_by(PAGE_SIZE) {
            self.erase_page(page_addr);
            self.wait_ready();
        }

        self.enable_read();
        self.wait_ready();

        Ok(())
    }