Beispiel #1
0
 public static InterruptInput Create(Socket socket, Socket.Pin pin, GlitchFilterMode glitchFilterMode, Gadgeteer.SocketInterfaces.ResistorMode resistorMode, Gadgeteer.SocketInterfaces.InterruptMode interruptMode, Module module)
 {
     Cpu.Pin cpuPin = socket.ReservePin(pin, module);
     if ((cpuPin == Cpu.Pin.GPIO_NONE) && (socket.InterruptIndirector != null))
     {
         return(socket.InterruptIndirector(socket, pin, glitchFilterMode, resistorMode, interruptMode, module));
     }
     return(new NativeInterruptInput(socket, pin, glitchFilterMode, resistorMode, interruptMode, module, cpuPin));
 }
Beispiel #2
0
 public NativeInterruptInput(Socket socket, Socket.Pin pin, GlitchFilterMode glitchFilterMode, Gadgeteer.SocketInterfaces.ResistorMode resistorMode, Gadgeteer.SocketInterfaces.InterruptMode interruptMode, Module module, Cpu.Pin cpuPin)
 {
     if (cpuPin == Cpu.Pin.GPIO_NONE)
     {
         throw Socket.InvalidSocketException.FunctionalityException(socket, "InterruptInput");
     }
     this._port = new InterruptPort(cpuPin, glitchFilterMode == GlitchFilterMode.On, (Port.ResistorMode)resistorMode, (Port.InterruptMode)interruptMode);
 }