Refactor pins to be user-provided

This commit is contained in:
BlackMark 2022-05-26 15:16:39 +02:00
parent 0303250df8
commit 84d8329b2b
2 changed files with 6 additions and 11 deletions

@ -1 +1 @@
Subproject commit 2bad84d2e6cfc9b4f332f351e16534c1472094e2 Subproject commit 1c01b17f4d0100127c54aeef16c09c99a3f277b1

View File

@ -23,24 +23,19 @@ int main()
serial << F("e-Paper demo") << F("\r\n"); serial << F("e-Paper demo") << F("\r\n");
Epd<spi_t> epd; Epd<spi_t, io::P::C1, io::P::C0, io::P::C2> eink;
if (epd.Init() != 0) { eink.Init();
serial << F("e-Paper init failed") << F("\r\n");
serial.flushTx();
_delay_ms(1000);
return 0;
}
serial << F("e-Paper init") << F("\r\n"); serial << F("e-Paper init") << F("\r\n");
serial << F("e-Paper clear") << F("\r\n"); serial << F("e-Paper clear") << F("\r\n");
epd.DisplayClear(); eink.DisplayClear();
serial << F("e-Paper draw") << F("\r\n"); serial << F("e-Paper draw") << F("\r\n");
epd.DisplayFrame(IMAGE_BLACK, IMAGE_RED); eink.DisplayFrame(IMAGE_BLACK, IMAGE_RED);
serial << F("e-Paper sleep") << F("\r\n"); serial << F("e-Paper sleep") << F("\r\n");
epd.Sleep(); eink.Sleep();
while (true) { while (true) {
serial << F("e-Paper running") << F("\r\n"); serial << F("e-Paper running") << F("\r\n");