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 namespace Antmicro.Renode.Peripherals.Bus.Wrappers
9 {
10     internal class BytePeripheralWrapper : IBytePeripheral
11     {
BytePeripheralWrapper(BusAccess.ByteReadMethod read, BusAccess.ByteWriteMethod write)12         public BytePeripheralWrapper(BusAccess.ByteReadMethod read, BusAccess.ByteWriteMethod write)
13         {
14             this.read = read;
15             this.write = write;
16         }
17 
ReadByte(long offset)18         public byte ReadByte(long offset)
19         {
20             return read(offset);
21         }
22 
WriteByte(long offset, byte value)23         public void WriteByte(long offset, byte value)
24         {
25             write(offset, value);
26         }
27 
Reset()28         public void Reset()
29         {
30         }
31 
32         private readonly BusAccess.ByteReadMethod read;
33         private readonly BusAccess.ByteWriteMethod write;
34     }
35 }
36 
37