xPCI-1500 API

Functions

_INT_ i_APCI1500_InitTimerCounter1 (BYTE_ b_BoardHandle, BYTE b_CounterOrTimerSelect, LONG_ l_ReloadValue, BYTE_ b_ContinuousOrSingleCycleSelect, BYTE_ b_InterruptHandling)
 
_INT_ i_APCI1500_StartTimerCounter1 (BYTE_ b_BoardHandle)
 
_INT_ i_APCI1500_StopTimerCounter1 (BYTE_ b_BoardHandle)
 
_INT_ i_APCI1500_TriggerTimerCounter1 (BYTE_ b_BoardHandle)
 
_INT_ i_APCI1500_ReadTimerCounter1 (BYTE_ b_BoardHandle, PLONG_ pl_ReadValue)
 

Detailed Description

Function Documentation

_INT_ i_APCI1500_InitTimerCounter1 ( BYTE_  b_BoardHandle,
BYTE  b_CounterOrTimerSelect,
LONG_  l_ReloadValue,
BYTE_  b_ContinuousOrSingleCycleSelect,
BYTE_  b_InterruptHandling 
)

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]b_BoardHandleHandle of the board
[in]b_CounterOrTimerSelectSelects the component mode ( APCI1500_TIMER or APCI1500_ZAHLER)
[in]l_ReloadValueDefines the starting value of the timer, and maximum value of the counter
[in]b_ContinuousOrSingleCycleSelectAPCI1500_CONTINUOUS -> Reset the timer to us_ReloadValue after each interrupt, and continue counting APCI1500_SINGLE -> Everytime the counter or timer value is set on 1, the counter or timer stops.
[in]b_InterruptHandlingAn interrupt is generated each time the timer or counter expires (APCI1500_DISABLE, APCI1500_ENABLE)
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: The parameter for selecting the counter or the timer is wrong
-103: Error while calling IOCTL function (wrong handle ?)
_INT_ i_APCI1500_StartTimerCounter1 ( BYTE_  b_BoardHandle)

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

Parameters
[in]b_BoardHandleHandle of the board
Return values
0: No Error
-1: The handle parameter of the board is wrong
-102: The component is still started, stop it before trying to restart it
-103: The component is not initialized
-104: Error while calling IOCTL function (wrong handle ?)
_INT_ i_APCI1500_StopTimerCounter1 ( BYTE_  b_BoardHandle)

Stops the counter timer 1

Parameters
[in]b_BoardHandleHandle of the board
Return values
0: No Error
-1: The handle parameter of the board is wrong
-102: Nothing is started on the component (so nothing to stop)
-103: Error while calling IOCTL function (wrong handle ?)
_INT_ i_APCI1500_TriggerTimerCounter1 ( BYTE_  b_BoardHandle)

Triggers the counter timer 1, resetting its value

Parameters
[in]b_BoardHandleHandle of the board
Return values
0: No Error
-1: The handle parameter of the board is wrong
-102: Nothing is started on the component (so nothing to trigger)
-103: Error while calling IOCTL function (wrong handle ?)
_INT_ i_APCI1500_ReadTimerCounter1 ( BYTE_  b_BoardHandle,
PLONG_  pl_ReadValue 
)

Reads the timer 1 current value

Parameters
[in]b_BoardHandleHandle of the board
[out]pl_ReadValueCurrent value of the counter timer
Return values
0: No Error
-1: The handle parameter of the board is wrong
-102: Nothing is started on the component (so nothing to read)
-103: Error while calling IOCTL function (wrong handle ?)