k8055m_get_counter, k8055m_set_counter, k8055m_set_debounce_time, k8055m_get_debounce_time -- Get and set the counter values and debounce time configuration
k8055-pic18f access library
#include "k8055m.h" int k8055m_get_counter(int cardNumbe, int counter); int k8055m_set_counter(int cardNumbe, int counter, int value); int k8055m_set_debounce_time(int cardNumbe, int counter, int us100); int k8055m_get_debounce_time(int cardNumbe, int counter);
The k8055-pic18f card maintains an unsigned 16 bit counter for each of the 5 digital inputs.
Every time the input is pulled low (logical 1), the counter is incremented by one.
The counter functionality uses a "debounce" feature, designed to eliminate multiple
counts caused by bouncing contact plates of physical switches.
The debounce time is set in 100 microsecond (0.1 milliseconds) increments. After a digital input
has been seen pulled to logical 1, it needs to stay in that state for the next n
100 microsecond intervals to actually be considered as a "button press". Likewise, after being
seen to transition to logical 0, it needs to stay in that state for the same duration to be
recognized as a "button release".
The debounce time can be adjusted from 0 to 50000, representing 0.1 .. 5000 milliseconds.
k8055m_set_counter() and k8055m_set_debounce_time() return 0 on success, -1 on error. k8055m_get_counter() returns the current counter value 0 .. 65535 or -1 on error. k8055m_get_debounce_time() returns the current debounce configuration for counter.