public static ushort ReadWordUsingByteBigEndian(this IBytePeripheral peripheral, long address) { unchecked { return((ushort)(peripheral.ReadByte(address + 1) | peripheral.ReadByte(address) << 8)); } }
public static void WriteWordUsingByteBigEndian(this IBytePeripheral peripheral, long address, ushort value) { unchecked { peripheral.WriteByte(address, (byte)(value >> 8)); peripheral.WriteByte(address + 1, (byte)value); } }
public static uint ReadDoubleWordUsingByteBigEndian(this IBytePeripheral peripheral, long address) { unchecked { return((uint) (peripheral.ReadByte(address + 3) | peripheral.ReadByte(address + 2) << 8 | peripheral.ReadByte(address + 1) << 16 | peripheral.ReadByte(address) << 24)); } }
public static void WriteDoubleWordUsingByte(this IBytePeripheral peripheral, long address, uint value) { unchecked { peripheral.WriteByte(address + 3, (byte)(value >> 24)); peripheral.WriteByte(address + 2, (byte)(value >> 16)); peripheral.WriteByte(address + 1, (byte)(value >> 8)); peripheral.WriteByte(address, (byte)value); } }
public virtual void Register(IBytePeripheral peripheral, NumberRegistrationPoint <int> registrationPoint) { if (children.ContainsKey(registrationPoint.Address)) { throw new RegistrationException("The specified registration point is already in use."); } if (!(peripheral is OpenCoresI2C)) { throw new RegistrationException("The FFE Wishbone interface supports the OpenCoresI2C controller only"); } children.Add(registrationPoint.Address, peripheral); machine.RegisterAsAChildOf(this, peripheral, registrationPoint); }
public virtual void Unregister(IBytePeripheral peripheral) { var toRemove = children.Where(x => x.Value.Equals(peripheral)).Select(x => x.Key).ToList(); if (toRemove.Count == 0) { throw new RegistrationException("The specified peripheral was never registered."); } foreach (var key in toRemove) { children.Remove(key); } machine.UnregisterAsAChildOf(this, peripheral); }
public void Unregister(IBytePeripheral peripheral) { }
public void Register(IBytePeripheral peripheral, DoublePointRegistration registrationPoint) { }
public IEnumerable <NumberRegistrationPoint <int> > GetRegistrationPoints(IBytePeripheral peripheral) { return(children.Keys.Select(x => new NumberRegistrationPoint <int>(x))); }