use log::debug;
use crate::constants::constants_system::SIZE_32KB;
use crate::periph::at28c256::At28C256;
use crate::traits::bus_device::BusDevice;
use crate::traits::memory_chip::MemoryChip;
use crate::traits::rom_chip::RomChip;

impl RomChip for At28C256 {
    /// program
    ///
    /// Writes new data to the memory chip
    fn program(new_data: &[u8]) -> Box<At28C256> {
        println!("Writing new chip.");
        let mut working = At28C256::default();
        working.data = new_data.to_vec().into_boxed_slice();
        Box::new(working)
    }
}