xPCI-3016 API
|
Functions | |
_INT_ | i_PCI3016_InitAndStartCounterTimerWatchdog (HANDLE h_DeviceHandle, BYTE b_Function, BYTE b_Index, BYTE b_InterruptEnabled, WORD w_ReloadValue, BYTE b_TimerWatchdogTimeBase, BYTE b_CounterTimerOutputMode, BYTE b_TimerMode, BYTE b_CounterDirection, BYTE b_CounterLevel) |
_INT_ | i_PCI3016_StopCounterTimerWatchdog (HANDLE h_DeviceHandle, BYTE b_Index) |
_INT_ | i_PCI3016_TriggerCounterTimerWatchdog (HANDLE h_DeviceHandle, BYTE b_Index) |
_INT_ | i_PCI3016_ReadCounterStatus (HANDLE h_DeviceHandle, BYTE b_Index, PBYTE pb_CounterStatus, PBYTE pb_Clear, PBYTE pb_SoftwareTriggerStatus, PWORD pw_CounterValue) |
_INT_ | i_PCI3016_ReadCounterValue (HANDLE h_DeviceHandle, BYTE b_Index, PWORD pw_CounterValue) |
_INT_ | i_PCI3016_ClearCounter (HANDLE h_DeviceHandle, BYTE b_Index) |
_INT_ | i_PCI3016_ReadTimerStatus (HANDLE h_DeviceHandle, BYTE b_Index, PBYTE pb_TimerStatus, PBYTE pb_SoftwareTriggerStatus, PWORD pw_TimerValue) |
_INT_ | i_PCI3016_ReadTimerValue (HANDLE h_DeviceHandle, BYTE b_Index, PWORD pw_TimerValue) |
_INT_ | i_PCI3016_ReadWatchdogStatus (HANDLE h_DeviceHandle, PBYTE pb_WatchdogStatus, PBYTE pb_SoftwareTriggerStatus, PWORD pw_WatchdogValue) |
_INT_ | i_PCI3016_ReadWatchdogValue (HANDLE h_DeviceHandle, PWORD pw_WatchdogValue) |
_INT_ i_PCI3016_InitAndStartCounterTimerWatchdog | ( | HANDLE | h_DeviceHandle, |
BYTE | b_Function, | ||
BYTE | b_Index, | ||
BYTE | b_InterruptEnabled, | ||
WORD | w_ReloadValue, | ||
BYTE | b_TimerWatchdogTimeBase, | ||
BYTE | b_CounterTimerOutputMode, | ||
BYTE | b_TimerMode, | ||
BYTE | b_CounterDirection, | ||
BYTE | b_CounterLevel | ||
) |
Enables to start a counter, timer or watchdog.
Three hardware components are available. A hardware component may only implement one function at a time.
The first component (index 0) can ony be used as counter and timer.
The two last components (index 1 and index 2) can be used as counter, timer and watchdog.
[in] | h_DeviceHandle | Handle of the board |
[in] | b_Function | Function choosed for the component. (PCI3016_COUNTER_FUNCTION, PCI3016_TIMER_FUNCTION, PCI3016_WATCHDOG_FUNCTION ) |
[in] | b_Index | Index of the component (0, 1, or 2). (Note: index 0 and 1 cannot work if b_Function is PCI3016_WATCHDOG_FUNCTION and index 2) |
[in] | b_InterruptEnabled | Enable to use or not use an interrupt (0,1). |
[in] | w_ReloadValue | For the counter: its maximum value. For timer and watchdog: the time to count (depend on b_TimerWatchdogTimeBase) |
[in] | b_TimerWatchdogTimeBase | Only use if b_Function is PCI3016_TIMER_FUNCTION or PCI3016_WATCHDOG_FUNCTION. Select the time base (PCI3016_TIME_BASE_MICROSECONDS, PCI3016_TIME_BASE_MILLISECONDS, PCI3016_TIME_BASE_SECONDS) |
[in] | b_CounterTimerOutputMode | Ony use if b_Function is PCI3016_COUNTER_FUNCTION or PCI3016_TIMER_FUNCTION. Set the way the output will change (PCI3016_OUTPUT_ENABLED, PCI3016_OUTPUT_DISABLED, PCI3016_OUTPUT_INVERTED) |
[in] | b_TimerMode | Only use if b_Function is PCI3016_TIMER_FUNCTION. Specifiy the mode of the timer. (PCI3016_TIMER_MODE_2, PCI3016_TIMER_MODE_3). PCI3016_TIMER_MODE_2: It functions like a divide-by-w_ReloadValue counter. It is used to generate a real time clock interrupt. OUT is initially high after the initialization. When the initial count has decremented to 1, OUT goes low for one CLK pulse. OUT then goes high again, the counter reloads the initial count (w_ReloadValue) and the process is repeated. This action can generate an interrupt. PCI3016_TIMER_MODE_3: This mode is similar to mode 2 except for the duty cycle of OUT. OUT will initially be high after the initialisation. When the initial count (ul_ReloadValue) has expired, OUT goes low for the next sequence. When the initial count (ul_ReloadValue) of that sequence has expired, OUT goes high again for the following sequence. The mode is periodic; the sequence above is repeated indefinitely. |
[in] | b_CounterDirection | Only use if b_Function is PCI3016_COUNTER_FUNCTION. (PCI3016_COUNTER_DIRECTION_UP, PCI3016_COUNTER_DIRECTION_DOWN). Selects the counter for up-counting or down-counting |
[in] | b_CounterLevel | Only use if b_Function is PCI3016_COUNTER_FUNCTION. (PCI3016_COUNTER_LOW_LEVEL, PCI3016_COUNTER_HIGH_LEVEL, PCI3016_COUNTER_BOTH_LEVEL). Counter counts low levels, or high levels or both. |
0 | : success |
-1 | : b_Function is invalid |
-2 | : index 0 or 1 cannot be used as watchdog |
-3 | : b_InterruptEnabled is invalid |
-4 | : b_Index is invalid |
-5 | : b_TimerWatchdogTimeBase is invalid |
-11 | : b_CounterDirection is invalid |
-12 | : b_CounterLevel is invalid |
-13 | : b_CounterTimerOutputMode is invalid |
-14 | : Error while calling IOCTL function (wrong handle ?) |
-21 | : b_CounterTimerOutputMode is invalid |
-22 | : b_TimerMode is invalid |
-23 | : Error while calling IOCTL function (wrong handle ?) |
-31 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_PCI3016_StopCounterTimerWatchdog | ( | HANDLE | h_DeviceHandle, |
BYTE | b_Index | ||
) |
Stops the timer/counter/watchdog
[in] | h_DeviceHandle | Handle of the board |
[in] | b_Index | Counter/timer/watchdog to stop (0,1 or 2) |
0 | : No Error |
-1 | : b_Index is invalid |
-2 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_PCI3016_TriggerCounterTimerWatchdog | ( | HANDLE | h_DeviceHandle, |
BYTE | b_Index | ||
) |
Triggers the timer/counter/watchdog
[in] | h_DeviceHandle | Handle of the board |
[in] | b_Index | Counter/timer/watchdog to trigger (0,1 or 2) |
0 | : No Error |
-1 | : b_Index is invalid |
-2 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_PCI3016_ReadCounterStatus | ( | HANDLE | h_DeviceHandle, |
BYTE | b_Index, | ||
PBYTE | pb_CounterStatus, | ||
PBYTE | pb_Clear, | ||
PBYTE | pb_SoftwareTriggerStatus, | ||
PWORD | pw_CounterValue | ||
) |
Reads the counter status
[in] | h_DeviceHandle | Handle of the board |
[in] | b_Index | Counter to use (PCI3016_TIMER_0, PCI3016_TIMER_1 or PCI3016_TIMER_2) |
[out] | pb_CounterStatus | Timer status (0 = disabled, 1 = enabled) |
[out] | pb_Clear | Status of the CLEAR bit (0 = counter has not been cleared, 1 = counter has been cleared) |
[out] | pb_SoftwareTriggerStatus | Status of the software trigger (0 = no software trigger occured, 1 = software trigger occured) |
[out] | pw_CounterValue | Current value of the counter |
0 | : No Error |
-1 | : b_CounterSelect is invalid |
-2 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_PCI3016_ReadCounterValue | ( | HANDLE | h_DeviceHandle, |
BYTE | b_Index, | ||
PWORD | pw_CounterValue | ||
) |
Read the value of the counter
[in] | h_DeviceHandle | Handle of the board |
[in] | b_Index | Counter to use (PCI3016_TIMER_0, PCI3016_TIMER_1 or PCI3016_TIMER_2) |
[out] | pw_CounterValue | Current value of the counter |
0 | : No error |
-1 | : b_Index is invalid |
-2 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_PCI3016_ClearCounter | ( | HANDLE | h_DeviceHandle, |
BYTE | b_Index | ||
) |
Clear the counter
[in] | h_DeviceHandle | Handle of the board |
[in] | b_Index | Counter to use (PCI3016_TIMER_0, PCI3016_TIMER_1 or PCI3016_TIMER_2) |
0 | : No Error |
-1 | : b_Index is invalid |
-2 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_PCI3016_ReadTimerStatus | ( | HANDLE | h_DeviceHandle, |
BYTE | b_Index, | ||
PBYTE | pb_TimerStatus, | ||
PBYTE | pb_SoftwareTriggerStatus, | ||
PWORD | pw_TimerValue | ||
) |
Reads the timer status
[in] | h_DeviceHandle | Handle of the board |
[in] | b_Index | Timer to use (PCI3016_TIMER_0, PCI3016_TIMER_1 or PCI3016_TIMER_2) |
[out] | pb_TimerStatus | Timer status (0 = disabled, 1 = enabled) |
[out] | pb_SoftwareTriggerStatus | Status of the software trigger (0 = no software trigger occured, 1 = software trigger occured) |
[out] | pw_TimerValue | Current value of the timer |
0 | : No Error |
-1 | : b_Index is invalid |
-2 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_PCI3016_ReadTimerValue | ( | HANDLE | h_DeviceHandle, |
BYTE | b_Index, | ||
PWORD | pw_TimerValue | ||
) |
Read the value of the timer
[in] | h_DeviceHandle | Handle of the board |
[in] | b_Index | Timer to use (PCI3016_TIMER_0, PCI3016_TIMER_1 or PCI3016_TIMER_2) |
[out] | pw_TimerValue | Current value of the timer |
0 | : No error |
-1 | : b_Index is invalid |
-2 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_PCI3016_ReadWatchdogStatus | ( | HANDLE | h_DeviceHandle, |
PBYTE | pb_WatchdogStatus, | ||
PBYTE | pb_SoftwareTriggerStatus, | ||
PWORD | pw_WatchdogValue | ||
) |
Reads the watchdog status
[in] | h_DeviceHandle | Handle of the board |
[out] | pb_WatchdogStatus | Watchdog status (0 = disabled, 1 = enabled) |
[out] | pb_SoftwareTriggerStatus | Status of the software trigger (0 = no software trigger occured, 1 = software trigger occured) |
[out] | pw_WatchdogValue | Current value of the watchdog |
0 | : No Error |
-1 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_PCI3016_ReadWatchdogValue | ( | HANDLE | h_DeviceHandle, |
PWORD | pw_WatchdogValue | ||
) |
Read the value of the watchdog
[in] | h_DeviceHandle | Handle of the board |
[out] | pw_WatchdogValue | Current value of the watchdog |
0 | : No error |
-1 | : Error while calling IOCTL function (wrong handle ?) |