esp-hal icon indicating copy to clipboard operation
esp-hal copied to clipboard

Glitch filter is not supported yet

Open bjoernQ opened this issue 1 year ago • 3 comments

bjoernQ avatar Dec 02 '24 13:12 bjoernQ

image

bjoernQ avatar Jan 15 '25 13:01 bjoernQ

The TRM screenshot seems to imply that configuring the glitch filter needs the corresponding filter (#2647) to be enabled, too.

selects one signal from the [...] output signals from the GPIO Filter hardware

Apart from that, we can add support for this feature by:

  • Creating peripheral singletons for the glitch filter channels
  • Adding a with_glitch_filter function to Input that works similar to how we assign pins to peripherals - it would take a impl Peripheral<P=CH>+'d and use it as the glith filter for the lifetime of the pin. I'd probably pass the glitch filter's configuration here, too.

Because there seems to be a way to implement this after 1.0, I'm changing the blocker label to reflect this.

bugadani avatar Jan 17 '25 14:01 bugadani

+1 on this - i'm using the esp32c6 to read an anemometer (among other sensors), but the 'glitching' on the input pins is causing interrupts to trigger multiple times - usually on both posedge and negedge.

Being able to use the built-in peripheral for dealing with this would be greatly preferred - i've already added hardware de-bouncing via an RC filter, but despite cleaning up the signal the interrupt is still triggering multiple times.

Thanks!

0xjmux avatar Nov 17 '25 18:11 0xjmux