xpci3xxx: Counter

xpci3xxx 1.00.00

Macros
Counter

## Macros
#define | CMD_xpci3xxx_InitCounter _IOR(xpci3xxx_MAGIC, 100,long)
| Initialize the counter.
#define | CMD_xpci3xxx_ReleaseCounter _IOR(xpci3xxx_MAGIC, 101,long)
| Stops and frees the counter.
#define | CMD_xpci3xxx_StartCounter _IOR(xpci3xxx_MAGIC, 102,long)
| Start the selected counter.
#define | CMD_xpci3xxx_StartAllCounters _IOR(xpci3xxx_MAGIC, 103,long)
| Start all initialized counters.
#define | CMD_xpci3xxx_TriggerCounter _IOR(xpci3xxx_MAGIC, 104,long)
| Triggers the selected counter.
#define | CMD_xpci3xxx_TriggerAllCounters _IOR(xpci3xxx_MAGIC, 105,long)
| Trigger all counters.
#define | CMD_xpci3xxx_StopCounter _IOR(xpci3xxx_MAGIC, 106,long)
| Stop the selected counter.
#define | CMD_xpci3xxx_StopAllCounters _IOR(xpci3xxx_MAGIC, 107,long)
| Stop all running counters.
#define | CMD_xpci3xxx_ClearCounter _IOR(xpci3xxx_MAGIC, 108,long)
| Clear the selected counter.
#define | CMD_xpci3xxx_ReadCounterValue _IOR(xpci3xxx_MAGIC, 109,long)
| Read the counters value.
#define | CMD_xpci3xxx_ReadCounterStatus _IOR(xpci3xxx_MAGIC, 110,long)
| Returns counter status.
#define | CMD_xpci3xxx_EnableDisableCounterInterrupt _IOR(xpci3xxx_MAGIC, 111,long)
| Enable/disable the counter interrupt.
#define | CMD_xpci3xxx_EnableDisableCounterHardwareOutput _IOR(xpci3xxx_MAGIC, 112,long)
| Enable/disable the hardware counter output.
#define | CMD_xpci3xxx_GetCounterHardwareOutputStatus _IOR(xpci3xxx_MAGIC, 113,long)
| Return the status of the hardware counter output.

## Detailed Description

## Macro Definition Documentation

## ◆ CMD_xpci3xxx_ClearCounter

#define CMD_xpci3xxx_ClearCounter _IOR(xpci3xxx_MAGIC, 108,long)

Clear the selected counter.

Parameters

  [in] | uint8_t | *arg Selected counter number

Return values

  0 | : Success
  1 | : Internal error
  2 | : Counter not intialised
  3 | : Wrong counter number
  4 | : Counter as timer already used
  5 | : Counter as Watchdog already used

Definition at line 1476 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_EnableDisableCounterHardwareOutput

#define CMD_xpci3xxx_EnableDisableCounterHardwareOutput _IOR(xpci3xxx_MAGIC, 112,long)

Enable/disable the hardware counter output.

Parameters

  [in] | uint8_t | arg[3] Parameters

- arg[0] Counter number
- arg[1] Control flag = ADDIDATA_DISABLE | ADDIDATA_ENABLE
- arg[2] Output Level
  - ADDIDATA_HIGH : If the counter counter overflows, the output is set to high

ADDIDATA_LOW : If the counter counter overflows, the output is set to low

Return values

  0 | : Success
  1 | : Internal error
  2 | : Counter not intialised
  3 | : Wrong Counter number
  4 | : Counter as timer already used
  5 | : Counter as watchdog already used
  6 | : Wrong output flag
  7 | : Wrong output level

Definition at line 1551 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_EnableDisableCounterInterrupt

#define CMD_xpci3xxx_EnableDisableCounterInterrupt _IOR(xpci3xxx_MAGIC, 111,long)

Enable/disable the counter interrupt.

Parameters

  [in] | uint8_t | arg[2] Parameters

- arg[0] Selected counter number
- arg[1] Interrupt flag = ADDIDATA_DISABLE | ADDIDATA_ENABLE

Return values

  0 | : Success
  1 | : Internal error
  2 | : Counter not initialized
  3 | : Wrong counter number
  4 | : Counter as timer already used
  5 | : Counter as Watchdog already used
  6 | : Wrong interrupt flag
  7 | : Interrupt call-back not installed

Definition at line 1530 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_GetCounterHardwareOutputStatus

#define CMD_xpci3xxx_GetCounterHardwareOutputStatus _IOR(xpci3xxx_MAGIC, 113,long)

Return the status of the hardware counter output.

Parameters

  [in,out] | uint8_t | arg[2] Parameter and result

- arg[0] Selected counter number
- arg[1] Status = 0 : not active | 1 : active

Return values

  0 | : Success
  1 | : Internal error
  2 | : Counter not intialised
  3 | : Wrong Counter number
  4 | : Counter as timer already used
  5 | : Counter as watchdog already used

Definition at line 1567 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_InitCounter

#define CMD_xpci3xxx_InitCounter _IOR(xpci3xxx_MAGIC, 100,long)

Initialize the counter.

Parameters

  [in] | uint32_t | arg[4] Parameters

- arg[0] Selected counter number
- arg[1] Direction Selection = ADDIDATA_UP | ADDIDATA_DOWN
- arg[2] Level Selection :
  - ADDIDATA_LOW : Counter counts each low level
  - ADDIDATA_HIGH : Counter count each high level
  - ADDIDATA_LOW_HIGH Counter count each high and low level
- arg[3] Reload value

Return values

  0 | : Success
  1 | : Internal error
  2 | : Wrong Counter number
  3 | : Counter as timer already used
  4 | : Counter as watchdog already used
  5 | : Wrong direction selection
  6 | : Wrong level selection
  7 | : Wrong reload value

Definition at line 1377 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_ReadCounterStatus

#define CMD_xpci3xxx_ReadCounterStatus _IOR(xpci3xxx_MAGIC, 110,long)

Returns counter status.

Parameters

  [in,out] | uint8_t | arg[5] Parameter and result

- arg[0] Selected counter number
- arg[1] Overflow status = 0 : none | 1 : overflow occurred
- arg[2] Software Trigger Status = 0 : none, 1 : sw trigger occurred
- arg[3] Hardware Trigger Status = 0 : none, 1 : hw trigger occurred
- arg[4] Software clear status = 0 : none, 1 : sw clear occurred

Return values

  0 | : Success
  1 | : Internal error
  2 | : Counter not intialised
  3 | : Wrong counter number
  4 | : Counter as timer already used
  5 | : Counter as Watchdog already used

Definition at line 1512 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_ReadCounterValue

#define CMD_xpci3xxx_ReadCounterValue _IOR(xpci3xxx_MAGIC, 109,long)

Read the counters value.

Parameters

  [in,out] | uint32_t | arg[2] Parameter and result

- arg[0] (in) Selected counter number
- arg[1] (out) Current counter value

Return values

  0 | : Success
  1 | : Internal error
  2 | : Counter not intialised
  3 | : Wrong counter number
  4 | : Counter as timer already used
  5 | : Counter as Watchdog already used

Definition at line 1492 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_ReleaseCounter

#define CMD_xpci3xxx_ReleaseCounter _IOR(xpci3xxx_MAGIC, 101,long)

Stops and frees the counter.

If a counter has been initialized, it can be reinitialized again only if this command is called before.

Parameters

  [in] | uint8_t | *b_CounterNumber Selected counter number

Return values

  0 | : Success
  1 | : Internal error
  2 | : Counter not intialised
  3 | : Wrong counter number
  4 | : Counter as timer already used
  5 | : Counter as Watchdog already used

Definition at line 1395 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_StartAllCounters

#define CMD_xpci3xxx_StartAllCounters _IOR(xpci3xxx_MAGIC, 103,long)

Start all initialized counters.

Parameters

  NULL | (ignored)

Return values

  0 | : Success
  1 | : Internal error

Definition at line 1417 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_StartCounter

#define CMD_xpci3xxx_StartCounter _IOR(xpci3xxx_MAGIC, 102,long)

Start the selected counter.

Parameters

  [in] | uint8_t | *arg Selected counter number

Return values

  0 | : Success
  1 | : Internal error
  2 | : Counter not intialised
  3 | : Wrong counter number
  4 | : Counter as timer already used
  5 | : Counter as Watchdog already used

Definition at line 1408 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_StopAllCounters

#define CMD_xpci3xxx_StopAllCounters _IOR(xpci3xxx_MAGIC, 107,long)

Stop all running counters.

Parameters

  NULL | (ignored)

Return values

  0 | : Success
  1 | : Internal error

Definition at line 1462 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_StopCounter

#define CMD_xpci3xxx_StopCounter _IOR(xpci3xxx_MAGIC, 106,long)

Stop the selected counter.

Parameters

  [in] | uint8_t | *arg Selected counter number

Return values

  0 | : Success
  1 | : Internal error
  2 | : Counter not intialised
  3 | : Wrong counter number
  4 | : Counter as timer already used
  5 | : Counter as Watchdog already used

Definition at line 1453 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_TriggerAllCounters

#define CMD_xpci3xxx_TriggerAllCounters _IOR(xpci3xxx_MAGIC, 105,long)

Trigger all counters.

Parameters

  NULL | (ignored)

Return values

  0 | : Success
  1 | : Internal error

Definition at line 1440 of file xpci3xxx.h.

## ◆ CMD_xpci3xxx_TriggerCounter

#define CMD_xpci3xxx_TriggerCounter _IOR(xpci3xxx_MAGIC, 104,long)

Triggers the selected counter.

Parameters

  [in] | uint8_t | *arg : Selected counter number

Return values

  0 | : Success
  1 | : Internal error
  2 | : Counter not intialised
  3 | : Wrong counter number
  4 | : Counter as timer already used
  5 | : Counter as Watchdog already used

Definition at line 1431 of file xpci3xxx.h.