MfpgaHookFunction
| Board | Supported |
|---|---|
| Host System | No |
| V4L2 | No |
| Clarity UHD | No |
| Concord PoE | No |
| GenTL | No |
| GevIQ | No |
| GigE Vision | No |
| Indio | No |
| Iris GTX | No |
| Radient eV-CL | No |
| Rapixo CL | Yes |
| Rapixo CoF | Yes |
| Rapixo CXP | Yes |
| USB3 Vision | No |
Hook a function to an event generated by a PU on a target system.
Syntax
void MfpgaHookFunction(
AIL_ID AilSystemId, //in
AIL_INT DeviceNumber, //in
AIL_INT FunctionId, //in
AIL_INT SubFunctionId, //in
AIL_INT64 FunctionNumber, //in
AIL_INT HookType, //in
AIL_FPGA_HOOK_FUNCTION_PTR HookHandlerPtr, //in
void * UserDataPtr //in-out
)
Description
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.
Note: Note that the FPGA module is not supported with Distributed Aurora Imaging Library.
Note: Note that the FPGA module is only supported on boards that support FPGA processing (Pro boards).
Parameters
AilSystemId (in, AIL_ID)
Specifies the identifier of the system that has the required Processing FPGA.
DeviceNumber (in, AIL_INT)
Specifies the Processing FPGA on the system which has the required PU. This parameter must be set to the following value:
For specifying the rank of the Processing FPGA
| Value | Description |
|---|---|
M_DEVn | Specifies the rank of the Processing FPGA on the board, where n can be a value between 0 and the total number of Processing FPGAs-1. |
FunctionId (in, AIL_INT)
Specifies the function identifier of the PU. The function identifier is specified in the header of the target PU's FPGA register file. For more information about the function identifiers of Zebra PUs, refer to the FDK documentation. 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:
For specifying the function identifier
| Value | Description |
|---|---|
M_DEFAULT | Specifies the default function identifier. You can specify M_DEFAULT if the HookType parameter is set to M_INTERRUPT_OVERRUN. |
Value > 0 | Specifies the function identifier of the required PU. |
SubFunctionId (in, AIL_INT)
Specifies the subfunction identifier of the PU. Several different Zebra 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:
For specifying the subfunction identifier
| Value | Description |
|---|---|
M_DEFAULT | Specifies the default subfunction identifier. Use this setting if the instances of the PU with the specified function identifier in your FPGA configuration all have the same subfunction identifier. You should also use this setting if you are using a custom PU. |
Value > 0 | Specifies the subfunction identifier of the required PU. For more information, refer to the FDK documentation. |
FunctionNumber (in, AIL_INT64)
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 |
|---|---|
M_DEFAULT | Specifies the default instance of a PU on which to hook a function. You can specify M_DEFAULT if you have selected M_INTERRUPT_OVERRUN as your HookType. |
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. The higher the instance's base address, the higher the index. |
HookType (in, AIL_INT)
Specifies the Processing FPGA event type. Note that the event type count starts at 0x1, whereas interrupts are numbered starting at 0.
For specifying the Processing FPGA event type
| Value | Description |
|---|---|
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. |
0x01 | Calls the hook-handler function if the PU's interrupt 0 is raised. |
0x02 | Calls the hook-handler function if the PU's interrupt 1 is raised. |
0x04 | Calls the hook-handler function if the PU's interrupt 2 is raised. |
0x08 | Calls the hook-handler function if the PU's interrupt 3 is raised. |
0x10 | Calls the hook-handler function if the PU's interrupt 4 is raised. |
0x20 | Calls the hook-handler function if the PU's interrupt 5 is raised. |
0x40 | Calls the hook-handler function if the PU's interrupt 6 is raised. |
For unhooking a function
| Value | Description |
|---|---|
M_UNHOOK | Unhooks the specified function if hooked to the specified event. When you use M_UNHOOK, you must provide the same values for all the parameters as when you originally hooked the function. |
HookHandlerPtr (in, AIL_FPGA_HOOK_FUNCTION_PTR)
Specifies the address of the function that should be called when an event occurs.
UserDataPtr *(in-out, void)
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.