How can I setup interrupts on an BC message?
There are three steps you need to set up BC interrupts.
- In the call to BusTools_BC_Init(), select the events you want to interrupt. In this example, BT1553_INT_END_OF_MESS is selected. This gives an interrupt at the end of the BC Message.
- Select the messages that you want to interrupt. In this example, each BC message is set to interrupt by adding BC_CONTROL_INTERRUPT to the BC message control word.
- Call BusTools_RegisterFunction and pass the name of the user function you want to run when there is an interrupt. Look at the function BusController_Init to see how to set up the Bus Controller and function setupThe_BC_IntFIFO for how you call BusTools_RegisterFunction.
The attached file sets up a Bus Controller and a Remote terminal. You can compile and run this program on your system if you have a multifunction PCCARD-1553. The Bus Controller sets up a single minor frame. Both the Bus Controller and the Remote Terminal use the BusTools_RegisterFunction routine to setup a user callback function. This user function runs when a specified event occurs. In the case of the Bus Controller, there is an interrupt on every message. bc_intFunction is the callback function that runs when there is an interrupt. Look at that routine to see how to read data from the interrupting message.
Click the link on the right to download this example.