You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to convert this library to work on an WS12850S that allegedly has the exact same software interface as the MFRC522 but using an I2C interface rather than SPI.
Looks reasonable so far, for writing single bytes. I'm not sure the readback from _wreg is meaningful.
This kind of works, but I'm a little concerned about this:
def _tocard(self, cmd: int, send):
...
for c in send:
self._wreg(0x09, c)
I think the intent there is to write a string of bytes (send) but in I2C I think I would want to do that as a single transaction, similar to what I did with my _wreg but taking an array of values rather than just a single byte. Does this make sense? Do you agree, and do you see other things that would need modification?
Finally ... if this works, is it worth abstracting out the physical interface so that we can re-use your code but select the interface (SPI or I2C) like:
I am trying to convert this library to work on an WS12850S that allegedly has the exact same software interface as the MFRC522 but using an I2C interface rather than SPI.
To do this, I replaced two functions:
Looks reasonable so far, for writing single bytes. I'm not sure the readback from _wreg is meaningful.
This kind of works, but I'm a little concerned about this:
I think the intent there is to write a string of bytes (send) but in I2C I think I would want to do that as a single transaction, similar to what I did with my _wreg but taking an array of values rather than just a single byte. Does this make sense? Do you agree, and do you see other things that would need modification?
Finally ... if this works, is it worth abstracting out the physical interface so that we can re-use your code but select the interface (SPI or I2C) like:
and both those interfaces include _wreg, _rreg, and possibly _tocard (and maybe more?)
The text was updated successfully, but these errors were encountered: