예제 #1
0
 public void Initialize(MethodDispatchTablePointer firmware, IntExpression pinNumber, bool initialValue)
 {
     firmware.GetPIOAndBitmask(pinNumber, ref pio, ref bitmask);
       pio.PER=bitmask; //enable PIO function
       if(initialValue) {
     pio.SODR=bitmask; //output should start high
       } else {
     pio.CODR=bitmask; //output should start low
       }
       pio.OER=bitmask; //enable output
 }
예제 #2
0
 public void Initialize(MethodDispatchTablePointer firmware, IntExpression pinNumber, bool initialValue)
 {
     firmware.GetPIOAndBitmask(pinNumber, ref pio, ref bitmask);
     pio.PER = bitmask; //enable PIO function
     if (initialValue)
     {
         pio.SODR = bitmask; //output should start high
     }
     else
     {
         pio.CODR = bitmask; //output should start low
     }
     pio.OER = bitmask;      //enable output
 }
예제 #3
0
 public void InitializeForISR(MethodDispatchTablePointer firmware, FuncPointer isr)
 {
     firmware.HAL_InitializeForISR(storage, isr, ((IntExpression)0).AsIntPointer());
 }
예제 #4
0
 public void Abort(MethodDispatchTablePointer firmware)
 {
     firmware.HAL_Abort(storage);
 }
예제 #5
0
 public void EnqueueDelta(MethodDispatchTablePointer firmware, IntExpression delayInMicroseconds)
 {
     firmware.HAL_EnqueueDelta(storage, delayInMicroseconds);
 }
예제 #6
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)
 }
예제 #7
0
 public MethodDispatchTableVariable MethodDispatchTable(string name, MethodDispatchTablePointer optionalInitialValue = null)
 {
     return((MethodDispatchTableVariable)DeclareHelper(name, new MethodDispatchTableVariable(), optionalInitialValue));
 }
예제 #8
0
 public void Abort(MethodDispatchTablePointer firmware)
 {
     firmware.HAL_Abort(storage);
 }
예제 #9
0
 public void EnqueueDelta(MethodDispatchTablePointer firmware, IntExpression delayInMicroseconds)
 {
     firmware.HAL_EnqueueDelta(storage, delayInMicroseconds);
 }
예제 #10
0
 public void InitializeForISR(MethodDispatchTablePointer firmware, FuncPointer isr)
 {
     firmware.HAL_InitializeForISR(storage, isr, ((IntExpression)0).AsIntPointer());
 }