use crate::domain::chip::*;
use crate::domain::types::*;
pub fn get_all_microwire_eeprom() -> Vec<ChipSpec> {
vec![
mw_eeprom("93C06", 32), mw_eeprom("93C46", 128), mw_eeprom("93C56", 256), mw_eeprom("93C66", 512), mw_eeprom("93C76", 1024), mw_eeprom("93C86", 2048), ]
}
fn mw_eeprom(name: &str, capacity_bytes: u32) -> ChipSpec {
let capacity_code = match capacity_bytes {
32 => 0x01,
128 => 0x02,
256 => 0x03,
512 => 0x04,
1024 => 0x05,
2048 => 0x06,
_ => 0x00,
};
ChipSpec {
name: name.to_string(),
manufacturer: "Generic Microwire EEPROM".to_string(),
jedec_id: JedecId::new([0xFC, capacity_code, 0x00]),
flash_type: FlashType::MicrowireEeprom,
capacity: Capacity::bytes(capacity_bytes),
layout: ChipLayout {
page_size: 1, block_size: 1,
oob_size: None,
is_dataflash: false,
},
capabilities: ChipCapabilities::default(),
otp: None,
}
}