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
607 stars 191 forks source link

epd2in66b: Waveshare 2.66inch E-Paper Display Module (B) for Raspberry Pi Pico #673

Closed trichner closed 3 months ago

trichner commented 5 months ago

A simple driver for the Waveshare 2.66in EPD for the Pico. Heavily inspired by the official python implementation and its magic timing.

See also: https://www.waveshare.com/Pico-ePaper-2.66-B.htm

Using machine package currently breaks the build. How should I go about removing the machine package from the unit tests?

Example looks like this: image

deadprogram commented 5 months ago

In an optimal scenario, we would add an spi test capabilty similar to https://github.com/tinygo-org/drivers/blob/release/tester/i2c.go

In the meantime, using the drivers.SPI interface instead of machine.SPI can also help.

deadprogram commented 5 months ago

Looks like it is missing the example? https://github.com/tinygo-org/drivers/actions/runs/8860923503/job/24332227160?pr=673#step:8:308

trichner commented 5 months ago

Looks like it is missing the example? https://github.com/tinygo-org/drivers/actions/runs/8860923503/job/24332227160?pr=673#step:8:308

Too much copy paste, should be fixed. Sorry about that.

aykevl commented 5 months ago

Why is this driver specific to the pico? It looks like a regular driver to me that should work on any chip?

trichner commented 5 months ago

Why is this driver specific to the pico? It looks like a regular driver to me that should work on any chip?

The driver 'should' already work with any other chip. The pins & SPI is all configurable. I only have the pico HAT to test currently though: https://www.waveshare.com/pico-epaper-2.66.htm

If this looks too specific, I can also remove the pico HAT specific defaults.

What would you prefer? Either works for me.

On a side note: I did not manage to figure out whether this is a specific waveshare driver chip or something more generic.

deadprogram commented 5 months ago

If this looks too specific, I can also remove the pico HAT specific defaults.

It would be better to make them more generic.

To make life easier for devs, you could also add a file protected by build tag, with the specific values for the board you are using. That way the "default" case for your board "just works".

@trichner what do you think?

trichner commented 5 months ago

If this looks too specific, I can also remove the pico HAT specific defaults.

It would be better to make them more generic.

To make life easier for devs, you could also add a file protected by build tag, with the specific values for the board you are using. That way the "default" case for your board "just works".

@trichner what do you think?

Sounds good! I gave it a try with build flags, was this what you had in mind?

trichner commented 4 months ago

@deadprogram let me know if anything else is missing or needs change.

trichner commented 4 months ago

Alright, all cleaned up!

trichner commented 4 months ago

Anything left?

trichner commented 3 months ago

Ping? :)

deadprogram commented 3 months ago

Thanks for adding this @trichner now squash/merging.