eth32_set_counter_state

int eth32_set_counter_state(eth32 handle, int counter, int state);

Summary

This function enables and disables the counters of the ETH32 device and configures which input signal edge (rising or falling) will increment the counter value. This function does not affect the current counter value in any way. In other words, a counter that is disabled and then enabled again will retain its value.

Parameters

  • handle - The value returned by the eth32_open function.

  • counter - Specifies the counter number (0 or 1).

  • state - The new state for the specified counter. This may be:

    • COUNTER_DISABLED - The counter is disabled. The counter value may still be accessed, but the counter will not increment as a result of input signals.

    • COUNTER_FALLING - The counter will increment on the falling edge of the input signal.

    • COUNTER_RISING - The counter will increment on the rising edge of the input signal.

Return Value

This function returns zero on success and a negative error code on failure. Please see the Error Codes section for possible error codes.

See Also

eth32_get_counter_state, eth32_set_counter_rollover, eth32_set_counter_value