debounce - filter noisy digital inputs
loadrt debounce cfg=size[,size,...]
Creates debounce groups with the number of filters specified by (size). Every filter in the same group has the same sample rate and delay. For example cfg=2,3 creates two filter groups with 2 filters in the first group and 3 filters in the second group.
An alternate component named dbounce implements similar functionality using conventional count= and names= parameters. Delay settings are implemented by a delay pin for each instance instead of using filter groups.
The debounce filter works by incrementing a counter whenever the input is true, and decrementing the counter when it is false. If the counter decrements to zero, the output is set false and the counter ignores further decrements. If the counter increments up to a threshold, the output is set true and the counter ignores further increments. If the counter is between zero and the threshold, the output retains its previous state. The threshold determines the amount of filtering: a threshold of 1 does no filtering at all, and a threshold of N requires a signal to be present for N samples before the output changes state.
Sample all the input pins in group G and update the output pins.
debounce.G.F.in bit in
The F’th input pin in group G.
debounce.G.F.out bit out
The F’th output pin in group G. Reflects the last "stable" input seen on the corresponding input pin.
debounce.G.delay signed rw
Sets the amount of filtering for all pins in group G.