adafruit / Adafruit_CircuitPython_DotStar

Dotstarrin' away in CircuitPython land
MIT License
46 stars 38 forks source link

Add support for chip_select #53

Closed lesamouraipourpre closed 3 years ago

lesamouraipourpre commented 3 years ago

Most onboard DotStar implementations have no need for a chip_select pin and work fine without it.

However, the Pimoroni Pico RGB Keypad Base is a pack to be added to a board and requires a chip_select to be pulled low before sending the data to the LEDs. While this can be done outside the DotStar library it would be nice if this could be controlled by the library.

Example: https://github.com/lesamouraipourpre/Community_CircuitPython_TCA9555/blob/main/examples/tca9555_pimoroni_rgb_base.py

If this sounds like a reasonable addition I can prepare a PR for it. It could either:

My preference would be for the first one as I believe it can be done without breaking the API.

jposada202020 commented 3 years ago

@kattni You are our Sherpa regarding lights, you know I stay away fro leds/dotstars/neopixels and everything in between so if you could answer our friend @lesamouraipourpre it would be good :)

ladyada commented 3 years ago

do you have to pull CS each time or just once to enable the buffers?

lesamouraipourpre commented 3 years ago

Pulling the chip_select low at the start works. As there is nothing else using these SPI clock/data lines this will be fine for normal usage.

If there is no other use case for adding chip_select support, then this can be closed.

ladyada commented 3 years ago

yeah i really think this should be handled in the higher level user code - especially since it isnt clear if folks would want to always have it on or just sometimes

lesamouraipourpre commented 3 years ago

Closing for now. It can always be resurrected later if needed.

jposada202020 commented 3 years ago

Thanks @lesamouraipourpre :)