I2C "Mask Writing" to a Register (using bitmasks)? #15402
Unanswered
AL-M0ND
asked this question in
RP2040 / Pico
Replies: 1 comment
-
The normal approach is to keep a copy of the byte last written to the address. When a bit needs changing, modify that bit in the copy, then re-write it out via I2C. The approach discussed in the link is to read the data back from the device, modify the bit and re-write it. This is rather inefficient and reading back may not be supported by the target hardware, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
I am using a Raspberry Pi Pico H (RP2040) to control a target MC over I2C. I'm trying to write to specific bits in the target's registers. Using I2C.writeto_mem() writes to the whole register/memory address.
I saw this thread and am wondering if MicroPython has any similar functionality to a mask write over I2C using bitmasks?
Let me know if any clarification is needed.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions