User`s guide
Adding Interrupt Support
4 Copy the file sample_int.m toauniquefilenameinthefollowingdirectory:
matlabroot\toolbox\rtw\targets\xpc\target\build\
xpcblocks\thirdpartydrivers
For example:
your_company_name_int.m
The xPC Target software s earches in this directory for file names that end
with
_int.m and looks for board interrupt descriptions.
5 Open and edit the following file:
matlabroot\toolbox\rtw\targets\xpc\target\build\
xpcblocks\thirdpartydrivers\
your_company_name_int.m
Addtothisfileaboard structure for each xPC Target supported board for
which interrupt functions have been written. See “Filling in the Driver
board Structure” on page 5-10 for a description o f how to fill in a board
structure.
6 Save and close the file.
7 At the MATLAB Command Window, type:
rehash toolbox
8 Restart the MATLAB interface to update the Async IRQ Source block and
Configuration Parameters dialogs.
Guidelines for Creating Interrupt Functions
xPC Target interrupt functions have predefined purposes and typically follow
a particular order. This section describes the guidelines on creating interrupt
functions. See “Hook Function Prototypes — Alphabetical List” on page 5-15
for the prototypes for these functions.
To prepare for the creatio n of the hook file, examine the existing xPC Target
hook files (
matlabroot\toolbox\rtw\targets\xpc\target\build\src) and
copy and modify one that is the same board type, PCI or ISA, as the board for
which you are creating a custom driver. For ex ample,
xpc6804hooks.c is for
an ISA board. Place your new file in
5-9