Skip to content

board/teensy40: Add I2C support #1471

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

Merged
merged 4 commits into from
Jun 22, 2022

Conversation

ardnew
Copy link
Contributor

@ardnew ardnew commented Oct 31, 2020

This PR is baselined on top of the Teensy 4.0 UART support PR (#1454)

This PR adds support for 3 (three!) I2C interfaces on the Teensy 4.0.

The public I2C API is the same as most other TinyGo devices with no substantial deviations I'm aware of.

Testing this implementation has been done entirely through 2 new drivers I'm actively developing and are not yet available.

The following table (from src/machine/board_teensy40.go) succinctly describes all of the important properties of each of the 3 supported I2C interfaces available in TinyGo:

// #====================================================#
// |                         I2C                        |
// #===========#==========#=============#===============#
// | Interface | Hardware | Clock(Freq) | SDA/SCL : Alt |
// #===========#==========#=============#=========-=====#
// |   I2C1    |  LPI2C1  | OSC(24 MHz) | D18/D19 : 3/3 |
// |   I2C2    |  LPI2C3  | OSC(24 MHz) | D17/D16 : 1/1 |
// |   I2C3    |  LPI2C4  | OSC(24 MHz) | D25/D24 : 0/0 |
// #===========#==========#=============#=========-=====#

@ardnew ardnew force-pushed the feature/teensy40-i2c branch 3 times, most recently from db7c6cf to 8f75d04 Compare November 6, 2020 16:09
@ardnew ardnew changed the title teensy40: Add I2C support board/teensy40: Add I2C support Nov 6, 2020
@ardnew ardnew force-pushed the feature/teensy40-i2c branch from bad12d2 to 6e663e9 Compare November 11, 2020 05:54
@deadprogram
Copy link
Member

Please rebase this branch against dev to resolve merge conflicts. Thanks.

@ardnew ardnew force-pushed the feature/teensy40-i2c branch from 6e663e9 to 30531f4 Compare November 11, 2020 20:26
@ardnew
Copy link
Contributor Author

ardnew commented Nov 11, 2020

rebased against dev

@ardnew ardnew force-pushed the feature/teensy40-i2c branch from 30531f4 to 30221e4 Compare November 12, 2020 20:38
@ardnew ardnew force-pushed the feature/teensy40-i2c branch from f21f112 to 0b29887 Compare December 12, 2020 17:17
@ardnew
Copy link
Contributor Author

ardnew commented Dec 12, 2020

rebased against dev

@deadprogram
Copy link
Member

Sorry I have not looked at this PR sooner. I will get out my Teensy 4.0 and try it out in a bit.

@deadprogram
Copy link
Member

Was trying this PR but #1454 (comment)

General comment: should define a I2C0 to point to I2C1 in this PR?

@ardnew
Copy link
Contributor Author

ardnew commented Sep 11, 2021

rebased against dev (3eb9dca)

Copy link
Member

@sago35 sago35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ardnew
Both i2c0 and i2c2 worked, but i2c4 did not.
I think it needs a few fixes, but for the most part it is very good.

@deadprogram
Copy link
Member

@ardnew if you get a chance to respond to @sago35 feedback on this board it would be great. Thank you!

@ardnew ardnew force-pushed the feature/teensy40-i2c branch from 5539664 to f171d9e Compare June 21, 2022 20:44
@ardnew
Copy link
Contributor Author

ardnew commented Jun 21, 2022

Addressed remaining comments and rebased against dev (b5c5d95)

@deadprogram
Copy link
Member

Since #2924 passed CI I will squash/merge this PR now. Thank you very much @ardnew

@deadprogram deadprogram merged commit afae6b3 into tinygo-org:dev Jun 22, 2022
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.

4 participants