adafruit / Adafruit_CircuitPython_Register

Python data descriptor classes to represent hardware registers on I2C devices.
MIT License
47 stars 21 forks source link

Introduce StructArray that can be used for repeated register #10

Closed tannewt closed 6 years ago

tannewt commented 6 years ago

structures. This is better than a tuple of objects because it creates fewer objects by default and is a fixed cost per device independent of the number of entries in the array.

deshipu commented 6 years ago

I wonder how feasible would be using this for the displays.

tannewt commented 6 years ago

its worth thinking about. I did something similar in the experimental is31fl3731 drivers here: https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731/blob/experimental/adafruit_is31fl3731.py#L132

It doesn't handle 2D slices as far as I know though.

deshipu commented 6 years ago

Speaking of is31fl3731, I think we should make it use the framebuf module, once it's available in all ports.

tannewt commented 6 years ago

@ladyada has ideas for a framebuf alternative that we'll move our display drivers to once we get to it.

@deshipu would you mind reviewing this PR too? :-)

tannewt commented 6 years ago

@deshipu please take another look!

tannewt commented 6 years ago

@deshipu gaves the thumbs up over Discord.