MIL_ID MilSystemId, | //in |
MIL_INT DeviceNumber, | //in |
MIL_INT FunctionId, | //in |
MIL_INT SubFunctionId, | //in |
MIL_INT64 FunctionNumber, | //in |
MIL_INT HookType, | //in |
MIL_FPGA_HOOK_FUNCTION_PTR HookHandlerPtr, | //in |
void *UserDataPtr | //in |
This function allows you to attach or detach a user-defined function to an event generated by a specified PU in the FPGA configuration loaded in a Processing FPGA on a target system. Once a hook-handler function is defined and hooked to an event, it is automatically called when the event occurs. You can only hook one function to an event; additional hooks that are attached to the same event will not be handled.
Specifies the Processing FPGA on the system which has the required PU. This parameter must be set to the following value:
Specifies the function identifier of the PU. The function identifier is specified in the header of the target PU's FPGA register file. For the function identifiers of Matrox PUs, see the Matrox FPGA Component Reference. Note that the range of custom PU function identifiers is between 0xFC00 and 0xFDFF, inclusive. This parameter can be set to one of the following values:
Specifies the subfunction identifier of the PU. Several different Matrox PUs can exist, each with slightly different optimizations, functionalities, or restrictions. Each variation is given a number called a subfunction identifier that uniquely identifies the variation. The subfunction identifier is specified in the header of the target PU's FPGA register file. You can set this parameter to one of the following:
Specifies the specific PU instance on which to hook a function if two or more instances are present in the FPGA configuration, loaded on the Processing FPGA. This parameter can be set to the following value:
For specifying the rank of a
PU
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
MIL system-specific tooltip (†) |
|||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default instance of a PU on which to hook a function. (more details...) |
† | j | k | l | m | p | q | r | ||||||||||||||||||||||||||||||
M_DEVn |
Specifies the rank of the PU in the FPGA configuration loaded on the Processing FPGA, where n represents the specific PU instance and starts at 0. (more details...) |
† | j | k | l | m | p | q | r |
Specifies the Processing FPGA event type. Note that the event type count starts at 0x1, whereas interrupts are numbered starting at 0.
This parameter can be set to one of the following:
For specifying the Processing FPGA event
type
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
MIL system-specific tooltip (†) |
|||||||||||||||||||||||||||||||||||||
M_END_OF_PROCESSING + |
Calls the hook-handler function whenever the specified PU generates an end-of-processing interrupt (or an interrupt on interrupt 0). |
† | j | k | l | m | p | q | r | ||||||||||||||||||||||||||||||
M_INTERRUPT_OVERRUN + |
Calls the hook-handler function if the end-of-processing interrupt is signaled before the previous one is serviced by the driver. |
† | j | k | l | m | p | q | r | ||||||||||||||||||||||||||||||
0x01 + |
Calls the hook-handler function if the PU's interrupt 0 is raised. (more details...) |
† | j | k | l | m | p | q | r | ||||||||||||||||||||||||||||||
0x02 + |
Calls the hook-handler function if the PU's interrupt 1 is raised. |
† | j | k | l | m | p | q | r | ||||||||||||||||||||||||||||||
0x04 + |
Calls the hook-handler function if the PU's interrupt 2 is raised. |
† | j | k | l | m | p | q | r | ||||||||||||||||||||||||||||||
0x08 + |
Calls the hook-handler function if the PU's interrupt 3 is raised. |
† | j | k | l | m | p | q | r | ||||||||||||||||||||||||||||||
0x10 + |
Calls the hook-handler function if the PU's interrupt 4 is raised. |
† | j | k | l | m | p | q | r | ||||||||||||||||||||||||||||||
0x20 + |
Calls the hook-handler function if the PU's interrupt 5 is raised. |
† | j | k | l | m | p | q | r | ||||||||||||||||||||||||||||||
0x40 + |
Calls the hook-handler function if the PU's interrupt 6 is raised. |
† | j | k | l | m | p | q | r |
You can add the following value to the above-mentioned values to specify to unhook a function.
For unhooking a function
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
MIL system-specific tooltip (†) |
|||||||||||||||||||||||||||||||||||||
M_UNHOOK |
Unhooks a hooked function from the specified event. |
† | j | k | l | m | p | q | r |
Specifies the address of the function that should be called when an event occurs.
The hook-handler function, pointed to by HookHandlerPtr, must be declared as follows:
Type of event hooked.
Event identifier to pass to MfpgaGetHookInfo() when inquiring about the hooked event.
Data pointer that was passed to MfpgaHookFunction().
Note that the HookHandlerPtr function can have any name.
Upon successful completion, the hook-handler function should return M_NULL. Note, MFTYPE and MFPGAHOOKFCTPTR are reserved MIL predefined types for functions and data pointers, respectively.
Specifies the address of the user data that you want to make available to the hook-handler function. This address is passed to the hook-handler function, through its UserDataPtr parameter, when the specified event occurs. Set this parameter to M_NULL if not used.
Header | Include mil.h; milfpga.h. |
Library | Use mil.lib; milfpga.lib. |
DLL | Requires mil.dll; milfpga.dll. |