Пример #1
0
 public static void SetHookBeforePeripheralWrite(this SystemBus sysbus, IBusPeripheral peripheral, string pythonScript, Range? subrange = null)
 {
     var runner = new BusPeripheralsHooksPythonEngine(sysbus, peripheral, null, pythonScript);
     sysbus.SetHookBeforePeripheralWrite<uint>(peripheral, runner.WriteHook, subrange);
     sysbus.SetHookBeforePeripheralWrite<ushort>(peripheral, (valueToWrite, offset) => (ushort)runner.WriteHook(valueToWrite, offset), subrange);
     sysbus.SetHookBeforePeripheralWrite<byte>(peripheral, (valueToWrite, offset) => (byte)runner.WriteHook(valueToWrite, offset), subrange);
 }
Пример #2
0
 public static void SetHookAfterPeripheralRead(this SystemBus sysbus, IBusPeripheral peripheral, string pythonScript, Range? subrange = null)
 {
     var runner = new BusPeripheralsHooksPythonEngine(sysbus, peripheral, pythonScript);
     sysbus.SetHookAfterPeripheralRead<uint>(peripheral, runner.ReadHook, subrange);
     sysbus.SetHookAfterPeripheralRead<ushort>(peripheral, (readValue, offset) => (ushort)runner.ReadHook(readValue, offset), subrange);
     sysbus.SetHookAfterPeripheralRead<byte>(peripheral, (readValue, offset) => (byte)runner.ReadHook(readValue, offset), subrange);
 }
Пример #3
0
        public static void SetHookBeforePeripheralWrite(this SystemBus sysbus, IBusPeripheral peripheral, string pythonScript, Range?subrange = null)
        {
            var runner = new BusPeripheralsHooksPythonEngine(sysbus, peripheral, null, pythonScript);

            sysbus.SetHookBeforePeripheralWrite <uint>(peripheral, runner.WriteHook, subrange);
            sysbus.SetHookBeforePeripheralWrite <ushort>(peripheral, (valueToWrite, offset) => (ushort)runner.WriteHook(valueToWrite, offset), subrange);
            sysbus.SetHookBeforePeripheralWrite <byte>(peripheral, (valueToWrite, offset) => (byte)runner.WriteHook(valueToWrite, offset), subrange);
        }
Пример #4
0
        public static void SetHookAfterPeripheralRead(this SystemBus sysbus, IBusPeripheral peripheral, string pythonScript, Range?subrange = null)
        {
            var runner = new BusPeripheralsHooksPythonEngine(sysbus, peripheral, pythonScript);

            sysbus.SetHookAfterPeripheralRead <uint>(peripheral, runner.ReadHook, subrange);
            sysbus.SetHookAfterPeripheralRead <ushort>(peripheral, (readValue, offset) => (ushort)runner.ReadHook(readValue, offset), subrange);
            sysbus.SetHookAfterPeripheralRead <byte>(peripheral, (readValue, offset) => (byte)runner.ReadHook(readValue, offset), subrange);
        }