Skip to content
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

pyb.I2C doesn’t implement slave callback #3858

Closed
adritium opened this issue Jun 13, 2018 · 2 comments
Closed

pyb.I2C doesn’t implement slave callback #3858

adritium opened this issue Jun 13, 2018 · 2 comments

Comments

@adritium
Copy link

https://forum.micropython.org/viewtopic.php?t=4885

I am trying to use a STM32F board running MicroPython as a slave device.

There does seem to be some support for it in the pyb.I2C class but it doesn't seem to have a call back for when the master request.

@dpgeorge
Copy link
Member

it doesn't seem to have a call back for when the master request.

That's correct, there is no callback. It's not that easy to implement I2C slave, partly because uPy won't be fast enough to respond at a 400kHz SCL to each request for a byte. It would be better to define a higher-level I2C slave interface (eg it just implements a memory-mapped register device like moste I2C devices out there) and then the callbacks happen much less frequently (eg end of entire transaction) than on a per-byte basis.

@dpgeorge
Copy link
Member

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants