-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp32: add support for uart pin inversions #5202
Conversation
Thanks for the contribution. This adds a lot of new arguments and it might be better to simplify it by combining them all together into a single u = UART(1, 9600, invert=UART.INV_TX | UART.INV_RX) |
Ok, I will do that this evening. |
I’ve been thinking about this, if the bitmask approach is used, should the str printout show the individual bits? Or show the calculated mask (ie 0x3)? Or nothing? |
Usually (well, sometimes) the output of str would be some text that can be reevaluated to produce the same object. Printing the calculated mask would work for this. So would the individual bits like |
Ok, you can now invert all four lines via a mask. Here is how it looks:
Only issue is that you can't use it as-is to construct a new object as the mask bits are under the UART class, ie "UART.INVERSE_TX" rather than just "INVERSE_TX". |
Using an integer for invert=xx should work. You just have to pick the right values. |
It does work :) I just added that as an example of the error, 7 is not a valid mask. If you were to put in a correct integer mask it would go through fine |
Thanks for updating, merged in 7a7ee16 |
…back-critical-section nrf: remove critical section around sd_app_evt_wait()
The ESP32 supports inversion of UART TX/RX/RTS/CTS. This adds support for inversions as optional kwargs: