Quantcast
Channel: PXI topics
Viewing all articles
Browse latest Browse all 3402

NI-VISA Driver Wizard, Interrupt detection, advanced options

$
0
0

Hello,

 

I have a fairly complicated interrupt controller to support that can throw 16 different interrupts, mapped to the lower 16 bits of an Interrupt Status Register and an Interrupt Enable Register. To detect if an interrupt is coming from the card, I have to do the following:

 

bool isMine = ( *(BAR1+INT_STATUS) & *(BAR1+INT_ENABLE) ) != 0;        // casts omitted for clarity

 

The interrupt is the card's if any of the 16 interrupts is both fired and enabled.

 

The only way I found which replicates the required functionality within the constraints of the .inf driver wizard is to check bit by bit:

 

InterruptDetect0 = "C32 BAR1 0x00000040 0x00000001 0x00000001;C32 BAR1 0x00000050 0x00000001 0x00000001;"
InterruptDetect1 = "C32 BAR1 0x00000040 0x00000002 0x00000002;C32 BAR1 0x00000050 0x00000002 0x00000002;"

...

InterruptDetect15 = "C32 BAR1 0x00000040 0x00008000 0x00008000;C32 BAR1 0x00000050 0x00008000 0x00008000;"

 

Unfortunately that's 32 register reads where 2 would suffice. Is there some advanced vocabulary that can express the logical formula above more efficiently? Have I overlooked something?

 

regards,
Edgar

 


Viewing all articles
Browse latest Browse all 3402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>