public void GetPIOReference(ref PIOReferenceVariable pio, IntExpression port)
        {
            //ugh.. fix this type system disaster
            var f = FuncBuilder.Instance;

            using (f.OpenScope("GetPIORef")) {
                var temp = f.Declare.Int("temp");
                InvokeResult(19, temp, port);
                Assignment.AssignAny(pio, temp); //escape from the type system
            }
        }
예제 #2
0
 public FastOutputPort(PIOReferenceVariable pio, IntVariable bitmask)
 {
     this.pio     = pio;
     this.bitmask = bitmask;
 }
예제 #3
0
 public static void GetPIOAndBitmask(this MethodDispatchTablePointer md, IntExpression pin, ref PIOReferenceVariable pio, ref IntVariable bitmask)
 {
     md.GetPIOReference(ref pio, pin.ShiftRight(5));           // pin/32
     bitmask.Value = ((IntExpression)1).ShiftLeft(pin & 0x1f); // 1<<(pin%32)
 }