1 // 2 // Copyright (c) 2010-2018 Antmicro 3 // Copyright (c) 2011-2015 Realtime Embedded 4 // 5 // This file is licensed under the MIT License. 6 // Full license text is available in 'licenses/MIT.txt'. 7 // 8 using System; 9 10 namespace Antmicro.Renode.Peripherals.MTD 11 { 12 public interface ISPIFlash : IPeripheral 13 { WriteEnable()14 void WriteEnable(); WriteDisable()15 void WriteDisable(); WriteStatusRegister(uint registerNumber, uint value)16 void WriteStatusRegister(uint registerNumber, uint value); ReadStatusRegister(uint registerNumber)17 uint ReadStatusRegister(uint registerNumber); ReadID()18 uint ReadID(); 19 } 20 21 public enum SPIFlashCommand 22 { 23 WriteEnable = 0x06, 24 WriteDisable = 0x04, 25 WriteToStatusRegister = 0x01, 26 ReadStatusRegister = 0x05, 27 Read = 0x03, 28 FastRead = 0x0B, 29 BulkErase = 0x60, 30 ReadID = 0x9F, 31 SectorErase = 0xD8, 32 ChipErase = 0xC7, 33 PageProgram = 0x02 34 } 35 } 36 37