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

Implement I2C #19

Merged
merged 1 commit into from
Apr 6, 2021
Merged

Implement I2C #19

merged 1 commit into from
Apr 6, 2021

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Apr 5, 2021

This implements I2C functionality.

  • implements Read and Write traits since I don't see how / if the BL602 i2c peripheral can support the contract of Transactional
  • supports 7 bit addressing

I tested this with an SSD1306 (just set all pixels on and the display on / off in a loop) and communicating with an BMP180 sensor. Worked for me and looks fine when inspecting the communication with a logic analyzer.

@9names
Copy link
Collaborator

9names commented Apr 5, 2021

Code looks nice.
I gave this a trivial test, looks like it's working correctly for writing at least. I should set up a simple slave for this to poll...

It would be useful to have a way to disable internal pull-ups on the pins. It's pretty common to want external pull-ups with i2c, and you don't want the internal ones enabled in that case.
We can make that change later - feel free to resolve this by opening an issue

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Apr 5, 2021

Great that you already had a first look

I created #20 to track the issue about always enabled internal pull-ups so I can tackle that afterwards

@9names
Copy link
Collaborator

9names commented Apr 5, 2021

LGTM

1 similar comment
@luojia65
Copy link
Member

luojia65 commented Apr 6, 2021

LGTM

@9names 9names merged commit a619f4a into sipeed:main Apr 6, 2021
@bjoernQ bjoernQ deleted the implement-i2c branch July 21, 2021 17:24
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

Successfully merging this pull request may close these issues.

3 participants