Beispiel #1
0
        private void DefineRegisters()
        {
            Registers.ServicesCR.Define(this)
            .WithFlag(0, out controlRequest)
            .WithTag("CONTROL_BUSY", 1, 1)
            .WithTag("CONTROL_ABORT", 2, 1)
            .WithTag("CONTROL_NOTIFY", 3, 1)
            .WithReservedBits(4, 12)
            .WithValueField(16, 7, out command)
            .WithValueField(23, 9, out commandOffset)
            .WithWriteCallback((_, __) =>
            {
                if (!controlRequest.Value)
                {
                    return;
                }
                HandleRequest((Commands)command.Value, commandOffset.Value);
                IRQ.Blink();
            })
            ;

            Registers.ServicesSR.Define(this)
            .WithTag("STATUS_REQUEST", 0, 1)
            .WithTag("STATUS_BUSY", 1, 1)
            .WithTag("STATUS_ABORT", 2, 1)
            .WithTag("STATUS_NOTIFY", 3, 1)
            .WithReservedBits(4, 12)
            .WithEnumField <DoubleWordRegister, RequestResult>(16, 16, FieldMode.Read, valueProviderCallback: (_) => status)
            ;
        }
 public void MoveTo(int x, int y)
 {
     if (!isRotated)
     {
         touchedPoints[0].X = (ushort)x;
         touchedPoints[0].Y = (ushort)y;
     }
     else
     {
         touchedPoints[0].X = (ushort)y;
         touchedPoints[0].Y = (ushort)x;
     }
     if (touchedPoints[0].Type == PointType.Down || touchedPoints[0].Type == PointType.Contact)
     {
         this.NoisyLog("Moving the pointer at {0}x{1}", touchedPoints[0].X, touchedPoints[0].Y);
         touchedPoints[0].Type = PointType.Contact;
     }
     if (touchedPoints.Any(b => b.Type == PointType.Down || b.Type == PointType.Contact))
     {
         IRQ.Blink();
     }
 }
 public void Release(MouseButton button = MouseButton.Left)
 {
     this.NoisyLog("Releasing the pointer at {0}x{1}", touchedPoints[0].X, touchedPoints[0].Y);
     touchedPoints[0].Type = PointType.Up;
     IRQ.Blink();
 }
 public void Press(MouseButton button = MouseButton.Left)
 {
     this.NoisyLog("Pressing the pointer at {0}x{1}", touchedPoints[0].X, touchedPoints[0].Y);
     touchedPoints[0].Type = PointType.Contact;
     IRQ.Blink();
 }