Interrupt Functions

FPGA Interface C API Help

Edition Date: August 2014

Part Number: 372928H-01

»View Product Info
Download Help (Windows Only)

The FPGA Interface C API includes the following interrupt functions.

NiFpga_ReserveIrqContext

NiFpga_Status NiFpga_ReserveIrqContext(NiFpga_Session session, NiFpga_IrqContext* context)

Reserves an IRQ context. IRQ contexts are single-threaded; only one thread can wait with a particular context at any given time. To minimize jitter when first waiting on IRQs, reserve as many contexts as the application requires.

If a context is successfully reserved (the returned status is not an error), it must be unreserved later. Otherwise a memory leak will occur.

Parameters

Name Type Description
session NiFpga_Session handle to a currently open session
context NiFpga_IrqContext* outputs the IRQ context

Return Value

result of the call

NiFpga_UnreserveIrqContext

NiFpga_Status NiFpga_UnreserveIrqContext(NiFpga_Session session, NiFpga_IrqContext context)

Unreserves an IRQ context obtained from NiFpga_ReserveIrqContext.

Parameters

Name Type Description
session NiFpga_Session handle to a currently open session
context NiFpga_IrqContext IRQ context to unreserve

Return Value

result of the call

NiFpga_WaitOnIrqs

NiFpga_Status NiFpga_WaitOnIrqs(NiFpga_Session session, NiFpga_IrqContext context, uint32_t irqs, uint32_t timeout, uint32_t* irqsAsserted, NiFpga_Bool* timedOut)

This is a blocking function that stops the calling thread until the FPGA asserts any IRQ in the irqs parameter, or until the function call times out. Before calling this function, use NiFpga_ReserveIrqContext to reserve an IRQ context. No other threads can use the same context when this function is called. You can use the irqsAsserted parameter to determine which IRQs were asserted for each function call.

Parameters

Name Type Description
session NiFpga_Session handle to a currently open session
context NiFpga_IrqContext IRQ context with which to wait
irqs uint32_t bitwise OR of NiFpga_Irq values
timeout uint32_t timeout in milliseconds, or NiFpga_InfiniteTimeout
irqsAsserted uint32_t* if non-NULL, outputs bitwise OR of IRQs that were asserted
timedOut NiFpga_Bool* if non-NULL, outputs whether the timeout expired

Return Value

result of the call

NiFpga_AcknowledgeIrqs

NiFpga_Status NiFpga_AcknowledgeIrqs(NiFpga_Session session, uint32_t irqs)

Acknowledges an IRQ or set of IRQs.

Parameters

Name Type Description
session NiFpga_Session handle to a currently open session
irqs uint32_t bitwise OR of NiFpga_Irqs

Return Value

result of the call

WAS THIS ARTICLE HELPFUL?

Not Helpful