DioSetInterruptCallBackProc


Function

Specifies the interrupt event call back function.

Format

Ret = DioSetInterruptCallBackProc ( Id , CallBack , Param )

Parameters

Id [C:short] [Python: ctypes.c_short]
Specifies the device ID retrieved from DioInit.

CallBack [C:PDIO_INT_CALLBACK] [Python: PDIO_INT_CALLBACK]
Specifies address of call back function.
Please pay attention, call back function is specified by function pointer, but the specification method varies with the language.

Param [C:void *] [Python: ctypes.c_void_p]
Specifies the optional parameter to be passed to the call back function.

Return Value

Ret[C:long] [Python: ctypes.c_long]

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal complete

DIO_ERR_DLL_INVALID_ID

10001

Invalid ID is specified.

DIO_ERR_DLL_CALLBACK

10400

Address of call back function is invalid.

The other errors: (See also: Error code details)

Remarks

Interrupt function is a function that uses the hardware function to monitor the change of the specified bit's input value.
When the input value of the bit changes from 0 to 1 or from 1 to 0, the system notifies the change of bit to application through the call back.
After the setting of interrupt call back was executed, the interrupt event setting is executed, when interrupt occurs, the set call back function is called.

Example

C

Ret = DioSetInterruptCallBackProc ( Id , CallBack , Param );
 

Python

Ret = cdio.DioSetInterruptCallBackProc ( Id , CallBack , Param )
 

See Also

DioSetInterruptEvent
Interrupt
PDIO_INT_CALLBACK