8000 Add .RaspberryPi4 as valid enum case for I2C interfaces by rolandhordos · Pull Request #116 · uraimo/SwiftyGPIO · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add .RaspberryPi4 as valid enum case for I2C interfaces #116

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 2 commits into from
Jan 7, 2021

Conversation

rolandhordos
Copy link
Contributor
@rolandhordos rolandhordos commented Jan 7, 2021

What's in this pull request?

Small change to add .RaspberryPi4 as a valid enum case for the same I2C interfaces as Pi3. Without it, calls to SwiftyGPIO.hardwareI2Cs(for:.RaspberryPi4) will return nil, though the I2C implementation is valid for Pi4 and Pi4B.

There is also one small comment typo fix for what looks to be a copy/paste of Pi3 to Pi4 in the global enums.

Lastly a minor README add to mention Pi 4B support, which I have been using for general GPIO and I2C integration with PCA 9685 and GY-521 (MPU 6050) modules.

Is there something you want to discuss?

Tested with MPU-6050.swift on default address (0x68)

Tested with PCA9685 on default address (0x40)


     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 
70: 70 -- -- -- -- -- -- --

Built On

Swift 5.3.2 on macOS 11.1

Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
Target: x86_64-apple-darwin20.2.0

Swift 5.1.5 on Raspbian 10 (buster) 32 bit

Swift version 5.1.5 (swift-5.1.5-RELEASE)
Target: armv6-unknown-linux-gnueabihf

Pull Request Checklist

  • I've added the default copyright header to every new file.
  • Every new file has been correctly indented, no tabs, 4 spaces (you can use swiftlint).
  • Verify that you only import what's necessary, this reduces compilation time.
  • Try to declare the type of every variable and constant, not using type inference greatly reduces compilation time.
  • Verify that your code compiles with the currently supported Swift version (currently 4.1.3)
  • You've read the contribution guidelines.

@rolandhordos
Copy link
Contributor Author

Tested on Machine model: Raspberry Pi 4 Model B Rev 1.2

@uraimo uraimo merged commit d439e58 into uraimo:master Jan 7, 2021
@uraimo
Copy link
Owner
uraimo commented Jan 7, 2021

Thanks for taking the time to test this properly!

rolandhordos added a commit to rolandhordos/SwiftyGPIO that referenced this pull request Jan 13, 2021
* add .RaspberryPi4 as valid enum case for the same I2C interfaces as Pi3

* addition of Pi 4B to supported boards on README
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.

2 participants
0