BBBCSIO

The PRUEventHandler Class

 

The PRUEventHandler Class

Provides the storage and handling of the various items associated with a PRU Event

 

Source Code

The source code for this class is available online for download and also in browseable form.

 

Example Code

Sample code which demonstrates the use of this class can be found on the PRU Interrupts Host example page.

 

Syntax

public class PRUEventHandler

Provides the storage and handling of the various items associated with a PRU Event.

 

Public Constructors

public PRUEventHandler(PRUEventEnum pruEventIn, PRUDriver pruDriverIn)

Constructor.

Parameters
pruEventIn - The event we represent.
pruDriverIn - The PRUDriver object which created this event data object.

 

Public Methods

public void StartPRUEventMonitor()

Starts the interrupt event thread for a PRU event. There is one thread per interrupt event.

Basically what is happening here is that we are starting a separate thread which will immediately try to read the UIO file and will block on it until an event happens. Once the event happens, a user specified handler is called to process the interrupt data and clear the interrupt.

 

public void StopPRUEventMonitor()

Stops the pru event monitor thread. Since the worker thread immediately enters into a blocking read we just hard kill the thread.

 

public UInt32 WaitForEvent()

Waits for the specified event. Will stall with a blocking read until the event is triggered.

Returns
the total number of events processed by the uio file (from any source) since boot up.

 

Public Properties

public int EventFD { get;set }

Gets/sets the PRU event file descriptor. THis is the file descriptor of the open UIO file.

value
The PRU event file descriptor.

  public int InterruptEventsReceived { get;set }

Gets/Sets the count of events received.

value
count of events received.

  public int InterruptEventsSent { get;set }

Gets/Sets the count of events sent.

value
count of events sent.

  public PRUEventEnum PRUEvent { get }

Gets the PRU event. There is no set accessor - this value is fixed when this object is created.

value
The PRU event.

  public PRUDriver PRUEventDriver { get }

gets the PRUDriver that created this PRU event. There is no set accessor - this value is fixed when this object is created.

value
The PRUDriver object.