ni_tio_reset_count_and_disarm(counter);
/* initialize counter registers */
- counter_dev->regs[NITIO_Gi_Autoincrement_Reg(counter->counter_index)] =
+ counter_dev->regs[NITIO_AUTO_INC_REG(counter->counter_index)] =
0x0;
write_register(counter,
counter_dev->
- regs[NITIO_Gi_Autoincrement_Reg(counter->counter_index)],
- NITIO_Gi_Autoincrement_Reg(counter->counter_index));
+ regs[NITIO_AUTO_INC_REG(counter->counter_index)],
+ NITIO_AUTO_INC_REG(counter->counter_index));
ni_tio_set_bits(counter, NITIO_Gi_Command_Reg(counter->counter_index),
~0, Gi_Synchronize_Gate_Bit);
ni_tio_set_bits(counter, NITIO_Gi_Mode_Reg(counter->counter_index), ~0,
#include "ni_tio.h"
-static inline enum ni_gpct_register NITIO_Gi_Autoincrement_Reg(unsigned idx)
-{
- switch (idx) {
- case 0:
- return NITIO_G0_AUTO_INC;
- case 1:
- return NITIO_G1_AUTO_INC;
- case 2:
- return NITIO_G2_AUTO_INC;
- case 3:
- return NITIO_G3_AUTO_INC;
- }
- return 0;
-}
+#define NITIO_AUTO_INC_REG(x) (NITIO_G0_AUTO_INC + (x))
static inline enum ni_gpct_register NITIO_Gi_Command_Reg(unsigned idx)
{