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

Not stable for regular i2c (master) Controller buffer carousel #3

Open
MarcinKlima opened this issue Aug 31, 2022 · 0 comments
Open

Comments

@MarcinKlima
Copy link

Hi, success to run your example on python <-> python, but on regular i2c "master" Controller had a problem to be buffer has running, on the Controller in received bytes got 1 or 2 or 8 from 8 bytes array buffer is an like carousel.

Ultra light version to respond 8 bytes array and try to use in infinity loop as 50ms:

i2c_responder = I2CResponder(
RESPONDER_I2C_DEVICE_ID, sda_gpio=GPIO_RESPONDER_SDA, scl_gpio=GPIO_RESPONDER_SCL, responder_address=RESPONDER_ADDRESS
)

    buffer_out = bytearray([1, 2, 3, 4, 5, 6, 7, 8])

    for value in buffer_out:
        
        while not i2c_responder.read_is_pending():
            pass
        i2c_responder.put_read_data(value)

The You are possible to mod the class to put_read_data(be possible to ArrayOfBytes[?]) and all i2c slave operations move to thread ?
Thank`s for class!

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

No branches or pull requests

1 participant