Page 1 of 1

TWAI Acceptance Filter

Posted: Thu Mar 23, 2023 11:01 am
by Martin Schultz
Hello, can anyone help me with a code example that shows how to use the acceptance mask in TWAI communication?

https://docs.espressif.com/projects/esp ... ance_maskE

According to this link it is possible to use it, but it does not show any code on how to apply this in practice.

I would like to filter CAN messages and only receive from two specific addresses.

Re: TWAI Acceptance Filter

Posted: Fri Mar 24, 2023 5:12 am
by lbernstone
See the technical reference manual sec 21.5.6 about the acceptance filter. There's two masks- one an xnor and one an or, that will be applied to the message to determine if it qualifies for acceptance.
https://www.espressif.com/en/support/do ... %5B%5D=492