Is there support for standard bitwise operators (|=, &=, etc)?
I have reviewed the source/forum examples I could fine, as well as documentation from Section 4 of the Micropython guide, but it appears to be targeted specifically at inline assembly functions for Thumb2.
4.2. Logical instructions¶
- and_(Rd, Rn)
Rd &= Rn
- orr(Rd, Rn)
Rd |= Rn
- eor(Rd, Rn)
Rd ^= Rn
- mvn(Rd, Rn)
Rd = Rn ^ 0xffffffff
i.e. Rd = 1’s complement of Rn - bic(Rd, Rn)
Rd &= ~Rn
bit clear Rd using mask in Rn
Note the use of “and_” instead of “and”, because “and” is a reserved keyword in Python.
I have values that I read from a off-module SPI GPIO expander, and I need to mask some of the values before updating them which I would typically use a bitwise operation for.
Typically I would expect to do something like: value |= 0x1C which looks to be a valid operator in Python, but is there an equivalent implementation that I am missing for MicroPython/OpenMV?