xPCI-1500 API

Functions

_INT_ i_PCI1500_InitTimerCounter1 (HANDLE h_DeviceHandle, BYTE b_ComponentMode, WORD w_ReloadValue, BYTE b_EnableContinuousCycle, BYTE b_EnableInterrupt)
 
_INT_ i_PCI1500_StartTimerCounter1 (HANDLE h_DeviceHandle)
 
_INT_ i_PCI1500_StopTimerCounter1 (HANDLE h_DeviceHandle)
 
_INT_ i_PCI1500_TriggerTimerCounter1 (HANDLE h_DeviceHandle)
 
_INT_ i_PCI1500_ReadTimerCounter1 (HANDLE h_DeviceHandle, PWORD pw_TimerValue)
 

Detailed Description

Function Documentation

_INT_ i_PCI1500_InitTimerCounter1 ( HANDLE  h_DeviceHandle,
BYTE  b_ComponentMode,
WORD  w_ReloadValue,
BYTE  b_EnableContinuousCycle,
BYTE  b_EnableInterrupt 
)

Initializes the component 1 as a timer or a counter
Important! The timer component internally operates with half of the input frequency
If the timer is set as a timer, the time period is defined by (2*w_ReloadValue)/InputClock, where InputClock is the value of the input clock in Hz

If the counter is used, input 14 acts as the counter input

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ComponentModeSelects the component mode ( PCI1500_TIMER or PCI1500_COUNTER )
[in]w_ReloadValueDefines the starting value of the timer, and maximum value of the counter
[in]b_EnableContinuousCycleReset the timer to us_ReloadValue after each interrupt, and continue counting (0,1)
[in]b_EnableInterruptAn interrupt is generated each time the timer or counter expires (0,1)
Returns
0 : No Error
-1 : Invalid mode
-2 : Wrong device handle
-3 : Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI1500_StartTimerCounter1 ( HANDLE  h_DeviceHandle)

Starts the counter timer 1 as a timer or a counter (depending on how you initialized it)

Parameters
[in]h_DeviceHandleHandle of the board
Returns
0 : No Error
-1 : Wrong device handle
-2 : The component is still started, stop it before trying to restart it
-3 : The component is not initialized
-4 : Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI1500_StopTimerCounter1 ( HANDLE  h_DeviceHandle)

Stops the counter timer 1

Parameters
[in]h_DeviceHandleHandle of the board
Returns
0 : No Error
-1 : Wrong device handle
-2 : Nothing is started on the component (so nothing to stop)
-3 : Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI1500_TriggerTimerCounter1 ( HANDLE  h_DeviceHandle)

Triggers the counter timer 1, resetting its value

Parameters
[in]h_DeviceHandleHandle of the board
Returns
0 : No Error
-1 : Wrong device handle
-2 : Nothing is started on the component (so nothing to trigger)
-3 : Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI1500_ReadTimerCounter1 ( HANDLE  h_DeviceHandle,
PWORD  pw_TimerValue 
)

Reads the timer 1 current value

Parameters
[in]h_DeviceHandleHandle of the board
[out]pw_TimerValueCurrent value of the counter timer
Returns
0 : No Error
-1 : Wrong device handle
-2 : Nothing is started on the component (so nothing to read)
-3 : Error while calling IOCTL function (wrong handle ?)