コード例 #1
0
 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 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)
 }
コード例 #3
0
 public FastOutputPort(PIOReferenceVariable pio, IntVariable bitmask)
 {
     this.pio=pio;
       this.bitmask=bitmask;
 }