xPCI-3120 API
APCI-3120 timer/watchdog functions

Functions

_INT_ i_APCI3120_InitTimerWatchdog (BYTE_ b_BoardHandle, BYTE_ b_TimerMode, LONG_ l_DelayValue, BYTE_ b_InterruptFlag)
 
_INT_ i_APCI3120_StartTimerWatchdog (BYTE_ b_BoardHandle)
 
_INT_ i_APCI3120_StopTimerWatchdog (BYTE_ b_BoardHandle)
 
_INT_ i_APCI3120_ReadTimer (BYTE_ b_BoardHandle, PLONG_ pl_ReadValue)
 
_INT_ i_APCI3120_WriteTimer (BYTE_ b_BoardHandle, LONG_ l_WriteValue)
 
_INT_ i_APCI3120_ReadWatchdogStatus (BYTE_ b_BoardHandle, PBYTE pb_WatchdogStatus)
 

Detailed Description

Function Documentation

◆ i_APCI3120_InitTimerWatchdog()

_INT_ i_APCI3120_InitTimerWatchdog ( BYTE_  b_BoardHandle,
BYTE_  b_TimerMode,
LONG_  l_DelayValue,
BYTE_  b_InterruptFlag 
)

Initializes the timer as an edge generator or watchdog

Parameters
[in]b_BoardHandleHandle of the board
[in]b_TimerModeSelects the component mode ( PCI3120_WATCHDOG or PCI3120_COUNTER )
[in]l_DelayValueDefines the starting value of the timer
[in]b_InterruptFlagReset the timer to us_ReloadValue after each interrupt, and continue counting (0,1)
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: Timer mode error
-3: The user interrupt routine is not installed, see function i_APCI3120_SetBoardIntRoutine
-4: The interrupt parameter is wrong
-5: The time interval selected for timer is wrong

◆ i_APCI3120_StartTimerWatchdog()

_INT_ i_APCI3120_StartTimerWatchdog ( BYTE_  b_BoardHandle)

Start timer/watchdog

Parameters
[in]b_BoardHandleHandle of the board
Return values
0: No error
-101: The device handle parameter is wrong
-102: The timer is already running
-103: b_TimerMode is invalid
-104: Timer mode choosen. dw_DelayValue is too low
-105: Timer mode choosen. dw_DelayValue is too high
-106: Watchdog mode choosen. dw_DelayValue is too low
-107: Watchdog mode choosen. dw_DelayValue is too high
-108: dw_DelayValue must be a multiple of 50
-109: b_InterruptFlag is APCI3120_ENABLE but no interrupt handler is installed. Please call i_PCI3120_SetBoardIntRoutine before calling this function
-110: Error while calling IOCTL function (wrong handle ?)

◆ i_APCI3120_StopTimerWatchdog()

_INT_ i_APCI3120_StopTimerWatchdog ( BYTE_  b_BoardHandle)

Stops timer/watchdog

Parameters
[in]b_BoardHandleHandle of the board
Return values
0: No Error
-1: The handle parameter of the board is wrong
-3: Timer/watchdog has not been started
-103: Error while calling IOCTL function (wrong handle ?)

◆ i_APCI3120_ReadTimer()

_INT_ i_APCI3120_ReadTimer ( BYTE_  b_BoardHandle,
PLONG_  pl_ReadValue 
)

Reads the current value of timer 2

Parameters
[in]b_BoardHandleHandle of the board
[out]pl_ReadValueCurrent timer value
Return values
0: No Error
-1: The handle parameter of the board is wrong
-102: The timer / watchdog is not running as a timer at the moment
-103: Error while calling IOCTL function (wrong handle ?)

◆ i_APCI3120_WriteTimer()

_INT_ i_APCI3120_WriteTimer ( BYTE_  b_BoardHandle,
LONG_  l_WriteValue 
)

Writes a new value in the timer

Parameters
[in]b_BoardHandleHandle of the board
[out]l_WriteValueNew timer value
Return values
0: No Error
-1: The handle parameter of the board is wrong
-102: The timer / watchdog is not running as a timer at the moment
-103: Error while calling IOCTL function (wrong handle ?)

◆ i_APCI3120_ReadWatchdogStatus()

_INT_ i_APCI3120_ReadWatchdogStatus ( BYTE_  b_BoardHandle,
PBYTE  pb_WatchdogStatus 
)

Read watchdog status

Parameters
[in]b_BoardHandle: Handle of the board
[out]pb_WatchdogStatus: Watchdog status, 0 -> Watchdog has not run down, 1 -> Watchdog has run down
Return values
0: No Error
-1: The handle parameter of the board is wrong
-102: The timer / watchdog is not running as a watchdog at the moment
,
-103: Error while calling IOCTL function (wrong handle ?)