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

Code Refactor & QA #56

Merged
merged 9 commits into from
Mar 5, 2019
Merged

Code Refactor & QA #56

merged 9 commits into from
Mar 5, 2019

Conversation

Gadgetoid
Copy link
Member

This is a - hopefully - non-breaking change that removes all Scroll pHAT HD specific methods from the IS31FL3731 class and moves them into __init__.py, making the underlying driver class a cleaner representation of the device, and __init__.py a cleaner representation of Scroll pHAT HDs features.

This is a pre-requisite to supporting alternate i2c bus addresses and underlying transports and aims to lay the groundwork for #54 and also #55.

Under normal circumstances the device will be setup() on demand when a show() call is issued, but a manual call to setup() should allow the specification of an alternate i2c address and transport class, providing it implements a set of required methods:

  • write_byte_data(address, register, value)
  • read_byte_data(address, register) returns value
  • write_i2c_block_data(address, register, values)

This could, for example, be an smbus.SMBus() object or an smbus2.SMBus() object depending upon preference and platform availability, or it could be a wrapper around pigpio allowing for remote control of a Scroll pHAT HD.

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.

1 participant