xPCI-3001 API
xPCI-3001 timer functions

Functions

_INT_ i_PCI3001_InitAndStartTimer (HANDLE h_DeviceHandle, DWORD dw_DelayValue, BYTE b_InterruptFlag)
 
_INT_ i_PCI3001_StopTimer (HANDLE h_DeviceHandle)
 
_INT_ i_PCI3001_ReadTimerValue (HANDLE h_DeviceHandle, PDWORD pdw_ReadValue)
 
_INT_ i_PCI3001_WriteTimerValue (HANDLE h_DeviceHandle, DWORD dw_WriteValue)
 

Detailed Description

Function Documentation

_INT_ i_PCI3001_InitAndStartTimer ( HANDLE  h_DeviceHandle,
DWORD  dw_DelayValue,
BYTE  b_InterruptFlag 
)

Initializes and starts the timer component

Parameters
[in]h_DeviceHandleHandle of the board
[in]dw_DelayValueTime interval of the timer
N.B. : The time value has to be a multiple of 50, 100us to 838860850us (~838.86s)
[in]b_InterruptFlagEnable or disable the interrupt at the end of a timer count
  • APCI3001_ENABLE : An interrupt is generated at the end of each time interval
  • APCI3001_DISABLE: No interrupt is generated
Returns
0 : No error
-1 : The device handle parameter is wrong
-2 : The timer is already running
-3 : b_TimerMode is invalid
-4 : dw_DelayValue is too low
-5 : dw_DelayValue is too high
-8 : dw_DelayValue must be a multiple of 50
-9 : b_InterruptFlag is APCI3001_ENABLE but no interrupt handler is installed. Please call i_PCI3001_SetBoardIntRoutine before calling this function
-10 : Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3001_StopTimer ( HANDLE  h_DeviceHandle)

Stops the timer

Parameters
[in]h_DeviceHandleHandle of the board
Returns
0 : No error
-1 : The device handle parameter is wrong
-2 : The timer is not running
-3 : Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3001_ReadTimerValue ( HANDLE  h_DeviceHandle,
PDWORD  pdw_ReadValue 
)

Reads the current value of the timer

Parameters
[in]h_DeviceHandleHandle of the board
[out]pdw_ReadValueCurrent timer value
Returns
0 : No error
-1 : The device handle parameter is wrong
-2 : The timer is not running as a timer at the moment
-3 : Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3001_WriteTimerValue ( HANDLE  h_DeviceHandle,
DWORD  dw_WriteValue 
)

Writes a value to the timer

Parameters
[in]h_DeviceHandleHandle of the board
[out]dw_WriteValueValue to write
Returns
0 : No error
-1 : The device handle parameter is wrong
-2 : The timer is not running as a timer at the moment
-3 : Error while calling IOCTL function (wrong handle ?)