Add waveshare eink display library

This commit is contained in:
BlackMark 2022-05-26 14:49:17 +02:00
parent e34d6b88df
commit ca3fb7854e
6 changed files with 124 additions and 57 deletions

6
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "eink/eink"]
path = eink/eink
url = git@git.blackmark.me:avr/eink.git
[submodule "eink/uart"]
path = eink/uart
url = git@git.blackmark.me:avr/uart.git
@ -10,3 +13,6 @@
[submodule "eink/flash"]
path = eink/flash
url = git@git.blackmark.me:avr/flash.git
[submodule "eink/spi"]
path = eink/spi
url = git@git.blackmark.me:avr/spi.git

View File

@ -1,4 +1,4 @@
#pragma once
#define F_CPU 8'000'000
#define F_CPU 16'000'000
#include <util/delay.h>

1
eink/eink Submodule

@ -0,0 +1 @@
Subproject commit 08dd1073af43b65b358257b968852aae8fc77946

View File

@ -83,6 +83,17 @@
</custom>
<AAFDebugger>
<AAFDebugFiles>
<DebugFile>
<path>\Debug\eink.lss</path>
<AAFSetting>
<Label>Lss Files</Label>
<Extention>.lss</Extention>
<Regex>^\s*(?&lt;address&gt;[a-f0-9]*):\s*.*$</Regex>
<DebugEnabled>true</DebugEnabled>
<RegexGroups>address</RegexGroups>
<DebuggerExpression>$pc</DebuggerExpression>
</AAFSetting>
</DebugFile>
</AAFDebugFiles>
</AAFDebugger>
</PropertyGroup>
@ -207,6 +218,15 @@
<Compile Include="clock.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="eink\epd1in54b_V2.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="eink\imagedata.cpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="eink\imagedata.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="flash\flash.hpp">
<SubType>compile</SubType>
</Compile>
@ -216,6 +236,15 @@
<Compile Include="main.cpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="spi\config.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="spi\hardware.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="spi\spi.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="uart\config.hpp">
<SubType>compile</SubType>
</Compile>
@ -253,6 +282,8 @@
<ItemGroup>
<Folder Include="flash" />
<Folder Include="io" />
<Folder Include="eink" />
<Folder Include="spi" />
<Folder Include="util" />
<Folder Include="uart" />
</ItemGroup>

View File

@ -2,20 +2,48 @@
#include "flash/flash.hpp"
#include "io/io.hpp"
#include "spi/spi.hpp"
#include "uart/uart.hpp"
#include "eink/epd1in54b_V2.h"
#include "eink/imagedata.h"
using uart_t = uart::Uart0<>;
REGISTER_UART0_INT_VECTORS(uart_t);
//////////////////////////////////////////////////////////////////////////
int main()
{
using spi_t = spi::Hardware<spi::Config<>>;
uart_t serial;
serial.init();
sei();
serial << F("e-Paper demo") << F("\r\n");
Epd<spi_t> epd;
if (epd.Init() != 0) {
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 clear") << F("\r\n");
epd.DisplayClear();
serial << F("e-Paper draw") << F("\r\n");
epd.DisplayFrame(IMAGE_BLACK, IMAGE_RED);
serial << F("e-Paper sleep") << F("\r\n");
epd.Sleep();
while (true) {
serial << F("Hello World!") << F("\r\n");
serial << F("e-Paper running") << F("\r\n");
_delay_ms(1000);
}

1
eink/spi Submodule

@ -0,0 +1 @@
Subproject commit 70aabc07f64a33b04e3e9ee00627f5c120b1f9ef