Provides the functionality to interact with a PRU on the Beaglebone Black.
public class PRUDriver
public PRUDriver (PRUEnum pruIDIn)
public void ClearEvent(PRUEventEnum pruEventIn)
public void CloseAllEvents()
public void CloseEvent(PRUEventEnum pruEventIn)
public void Dispose()
public void EnablePRUHostEvent(PRUEventEnum pruEventIn)
NOTE: host interrupts 0 and 1 are left by the UIO subsystem for signalling between the two PRUs because the functionality to support this is hard coded into the PRU INTC system. Host Interrupts 2 to 9 appear in userspace via the uio device files /dev/uio0 to /dev/uio7.
This means that if you trigger PRU systemInterrupt16 you will see it appear on /dev/uio0. Similarly triggering PRU systemInterrupt17 will cause it to appear on /dev/uio1 The UIO file number which receives the event is always the low four bits of the system interrupt. The only reason this works like that is because the standard setup routes sysInt16 through channel2 through host2 and host2 is tied to uio0 by the UIO subsystem.
public void ExecutePRUProgram(string binaryToRun)
public void ExecutePRUProgram(string binaryToRun, byte[] dataBytes)
public void InitInterruptsForAllPRUs()
public void PRUEventMonitorOff(PRUEventEnum pruEventIn)
public void PRUEventMonitorOn(PRUEventEnum pruEventIn, PRUInterruptEventHandlerUIO pruEventHander)
public void PRUStop()
public byte ReadPRUDataByte(uint offset)
public byte[] ReadPRUDataByteArray(uint offset, uint length)
public Int16 ReadPRUDataInt16(uint offset)
public Int32 ReadPRUDataInt32(uint offset)
public Int64 ReadPRUDataInt64(uint offset)
public UInt16 ReadPRUDataUInt16(uint offset)
public UInt32 ReadPRUDataUInt32(uint offset)
public UInt64 ReadPRUDataUInt64(uint offset)
public void ResetInterruptsForAllPRUs()
The PRU's share a interrupt controller subsystem so calling this function resets the interrupts and events for both PRUs
public void SetupStandardHostAndChannelMappingForAllPRUs()
In order to keep things simple a standard, documented, arrangement is configured and the user can then enable specific interrupts to perform the desired actions. This does mean that many of the PRU system interrupts are left unconnected. This setup is intended primarily to let the PRU trigger a host interrupt which will propagate down to user space and be visible on one of the uio* files
The PRU's share a interrupt controller subsystem so calling this function sets the standard configuration for both PRUs
NOTE: a call to ResetInterruptsForAllPRUs() should be made to reset things before calling this function
public UInt32 WaitForEvent(PRUEventEnum pruEventIn)
public void WritePRUDataByte(byte byteVal, uint offset)
public void WritePRUDataByteArray(byte[] byteArray, uint offset)
public void WritePRUDataInt16(Int16 dataVal, uint offset)
public void WritePRUDataInt32(Int32 dataVal, uint offset)
public void WritePRUDataInt64(Int64 dataVal, uint offset)
public void WritePRUDataUInt16(UInt16 dataVal, uint offset)
public void WritePRUDataUInt32(UInt32 dataVal, uint offset)
public void WritePRUDataUInt64(UInt64 dataVal, uint offset)
public PRUEnum PRUID { get }