tinygo-org / drivers

TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
585 stars 180 forks source link

Adafruit 'seesaw' support #612

Closed trichner closed 7 months ago

trichner commented 8 months ago

Here we go again. Simple driver for the "i2c to anything" seesaw chip.

https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout/overview

This also addresses half of #564.

bgould commented 8 months ago

This looks generally good to me, I will look over some more tomorrow. Was trying to find if I have my TFT Featherwing with me to test, but I think I might not have it (also will check more tomorrow).

I can picture that maybe in addition to this low-level package, eventually there could be sub-packages for devices that use it, like /drivers/seesaw/mini-tft-featherwing. A "device" implemented on top of this package could look something like this:

https://github.com/bgould/go-seesaw/blob/main/mini-tft-wing.go

associated example:

https://github.com/bgould/go-seesaw/blob/main/examples/mini-tft-wing/main.go

(like I said I will try to see if I still have that board so that I can give your package a test drive)

trichner commented 8 months ago

This looks generally good to me, I will look over some more tomorrow. Was trying to find if I have my TFT Featherwing with me to test, but I think I might not have it (also will check more tomorrow).

I can picture that maybe in addition to this low-level package, eventually there could be sub-packages for devices that use it, like /drivers/seesaw/mini-tft-featherwing. A "device" implemented on top of this package could look something like this:

https://github.com/bgould/go-seesaw/blob/main/mini-tft-wing.go

associated example:

https://github.com/bgould/go-seesaw/blob/main/examples/mini-tft-wing/main.go

(like I said I will try to see if I still have that board so that I can give your package a test drive)

Indeed! And actually that's what I've done here: https://github.com/tinygo-org/drivers/issues/564

I added ontop Keypad & NeoPixel and then wrapped it all to make the NeoTrellis work nicely :)

Though in hindsight I think those are not yet polished enough for the tinygo-org/drivers repo ;)

trichner commented 7 months ago

Bump? Any chance for a review?

trichner commented 7 months ago

What's missing? Any interest?

bgould commented 7 months ago

Sorry I was trying to find a board with seesaw on it to test, but I could not find. All in all, LGTM, now merging. Thank you for your contribution @trichner

trichner commented 7 months ago

Sorry I was trying to find a board with seesaw on it to test, but I could not find. All in all, LGTM, now merging. Thank you for your contribution @trichner

Ahh, that would have been great indeed. Thanks for merging. I'll give it a go with the Neotrellis, its a more complex component with a seesaw than my soilsensor.