Interface.InterfaceType| Modifier and Type | Field and Description |
|---|---|
private static byte |
m_allocated |
protected java.nio.ByteBuffer |
m_interrupt |
protected int |
m_interruptIndex |
protected boolean |
m_isSyncInterrupt |
m_ifaceType, MAX_ANALOG_IN_CHANNELS, MAX_ANALOG_OUT_CHANNELS, MAX_DIGITAL_CHANNELS, MAX_PWM_CHANNELS, MAX_RELAY_CHANNELS| Modifier | Constructor and Description |
|---|---|
protected |
InterruptBase(Interface.InterfaceType iType)
Construct a new interrupt
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
allocateInterrupt(boolean watcher)
Allocate the interrupt
|
void |
cancelInterrupt()
Cancel interrupts on this device.
|
void |
disableInterrupts()
Disable Interrupts without without deallocating structures.
|
void |
enableInterrupts()
Enable interrupts to occur on this input.
|
(package private) abstract int |
getChannelNumber()
Get the channel number for this interrupt.
|
(package private) abstract byte |
getModuleNumber()
Get the module number for this interrupt.
|
(package private) abstract boolean |
isAnalogTrigger()
Get whether this interrupt is an analog trigger or not
|
double |
readFallingTimestamp()
Return the timestamp for the falling interrupt that occurred most
recently.
|
double |
readRisingTimestamp()
Return the timestamp for the rising interrupt that occurred most
recently.
|
void |
requestInterrupt()
Request one of the 8 interrupts synchronously on this digital input.
|
void |
requestInterrupt(InterruptHandlerFunction<?> handler)
Request one of the 8 interrupts asynchronously on this digital input.
|
void |
setUpSourceEdge(boolean risingEdge,
boolean fallingEdge)
Set which edge to trigger interrupts on
|
protected void |
validateInterrupt()
Make sure that the interrupt is not null.
|
void |
waitForInterrupt(double timeout)
In synchronous mode, wait for the defined interrupt to occur.
|
void |
waitForInterrupt(double timeout,
boolean ignorePrevious)
In synchronous mode, wait for the defined interrupt to occur.
|
allocateMXPPin, checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPWMChannel, checkRelayChannel, freeMXPPin, getInterfaceTypeprotected java.nio.ByteBuffer m_interrupt
protected boolean m_isSyncInterrupt
protected int m_interruptIndex
private static byte m_allocated
protected InterruptBase(Interface.InterfaceType iType)
iType - the InterfaceType of this Interruptabstract boolean isAnalogTrigger()
AnalogInput.initTrigger(),
AnalogInput.createTriggerOutput(AnalogTriggerType),
AnalogTriggerOutput,
AnalogInput.AnalogTriggerTypeabstract int getChannelNumber()
abstract byte getModuleNumber()
public final void requestInterrupt(InterruptHandlerFunction<?> handler)
handler - The InterruptHandlerFunction that contains the method
InterruptHandlerFunction.interruptFired(int, Object) that
will be called whenever there is an interrupt on this device.
Request interrupts in synchronous mode where the user program
interrupt handler will be called when an interrupt occurs. The
default is interrupt on rising edges only.public final void requestInterrupt()
waitForInterrupt(double).
The default is interrupt on rising edges only.protected final void allocateInterrupt(boolean watcher)
watcher - true if the interrupt should be in synchronous mode where the user
program will have to explicitly wait for the interrupt to occur.public final void cancelInterrupt()
public final void waitForInterrupt(double timeout)
timeout - Timeout in secondspublic final void waitForInterrupt(double timeout,
boolean ignorePrevious)
timeout - Timeout in secondsignorePrevious - If true, ignore interrupts that happened
before waitForInterrupt was called.public final void enableInterrupts()
public final void disableInterrupts()
public final double readRisingTimestamp()
setUpSourceEdge(boolean, boolean)public final double readFallingTimestamp()
setUpSourceEdge(boolean, boolean)public final void setUpSourceEdge(boolean risingEdge,
boolean fallingEdge)
risingEdge - true to interrupt on rising edgefallingEdge - true to interrupt on falling edgeprotected final void validateInterrupt()