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

gbadisplay: add simple driver for the GameBoy Advance display #620

Open aykevl opened 7 months ago

aykevl commented 7 months ago

This only implements the 15 bits per pixel mode, not any of the other possible display modes. This matches conventional SPI displays most closely. Future additions might add more display modes.

Normally I'd argue interfacing with chip/board specific hardware should be done in the machine package using a generic interface, but the GBA is kind of special and I don't want the machine package to depend on the tinygo.org/x/drivers/pixel package.

deadprogram commented 7 months ago

Perhaps this would be better off in the https://github.com/tinygo-org/tinygba repo?

aykevl commented 7 months ago

Yes, sounds like a good idea. I'll make a PR there.

aykevl commented 7 months ago

Ok, made a PR for the RGB555 pixel format here: https://github.com/tinygo-org/drivers/pull/621

Honestly I just wanted to add the RGB555 pixel format here, so that I could use it with my in-development board package here: https://github.com/aykevl/board/blob/main/board-gameboy-advance.go I could also make a PR to the tinygba repo with the display, if you like? I'm also fine with keeping everything inside that board package and only adding the RGB555 pixel format.

deadprogram commented 7 months ago

I could also make a PR to the tinygba repo with the display, if you like?

It seems like a useful thing for people to be able to find, so yes please.