int eth32_set_counter_threshold(eth32 handle, int counter, int threshold);
This function defines a counter event threshold that will cause an event to fire as the counter value passes the threshold. On the ETH32 device, only Counter 0 supports this (although both counters support rollover thresholds). An event is fired as a result of the counter surpassing the threshold, not meeting it. For example, with a threshold of 9, the counter's value would increment from 8 to 9 without firing the event, but it would fire as the counter incremented from 9 to 10. The valid range for a counter event threshold is from 0 to the maximum possible counter value (65535 for 16-bit counter 0). The powerup default threshold is 0. The threshold has no other side-effects on the counter - it does not reset the counter to 0 like the rollover threshold.
handle - The value returned by the eth32_open function.
counter - Specifies the counter number. This must be 0.
threshold - Specifies the event threshold for the counter (0-65535).
This function returns zero on success and a negative error code on failure. Please see the Error Codes section for possible error codes.
Please note that defining a threshold with this function does not enable the current connection to actually receive the event notifications when they occur. These must be enabled separately using the eth32_enable_event function. Also note that event thresholds are common to all connections. Changing the thresholds will affect other connections if they are utilizing that particular counter event.