CntSetCountMatchCallBackProc


Function

Specifies the callback function for count-match interrupt event.

Format

Ret = CntSetCountMatchCallBackProc ( Id , CallBack , Param )

Parameters

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

CallBack [ C: PCNT_MATCH_CALLBACK ] [ Python: PCNT_MATCH_CALLBACK ]
Specifies the address of callback function

Param [ C: void * ] [ Python: ctypes.c_void_p ]
Specifies the parameter passed to the callback function.

Return Value

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

Definition

Value

Description

CNT_ERR_SUCCESS

0

Normal Complete

CNT_ERR_DLL_INVALID_ID

10001

Invalid ID is specified.

CNT_ERR_DLL_CALLBACK

10400

Invalid address of callback function.

The other errors: (See also: Details of Error Code)

Remarks

It is the function which accept the interrupt by using the count-match interrupt function of hardware. After setting the interrupt callback setting, sets the interrupt event, the callback function is called when the interrupt occurs.

Example

C, C++

Ret = CntSetCountMatchCallBackProc(Id, CallBack, Param);
 

Python

Ret = ccnt.CntSetCountMatchCallBackProc(Id, CallBack, Param)
 

 

See Also

CntSetCountMatchEvent PCNT_MATCH_CALLBACK Count-match