Compare commits

...

4 Commits

Author SHA1 Message Date
0ad99f5c6e Refactor interface to be fully static 2022-05-26 16:03:50 +02:00
84d8329b2b Refactor pins to be user-provided 2022-05-26 15:16:39 +02:00
0303250df8 Refactor eink driver 2022-05-26 15:11:27 +02:00
00a1cfa25b Add waveshare eink display library 2022-05-26 14:49:17 +02:00
6 changed files with 61 additions and 2 deletions

3
.gitmodules vendored
View File

@@ -10,3 +10,6 @@
[submodule "eink/flash"] [submodule "eink/flash"]
path = eink/flash path = eink/flash
url = git@git.blackmark.me:avr/flash.git 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 #pragma once
#define F_CPU 8'000'000 #define F_CPU 16'000'000
#include <util/delay.h> #include <util/delay.h>

1
eink/eink Submodule

Submodule eink/eink added at 2cb38b9fdc

View File

@@ -83,6 +83,17 @@
</custom> </custom>
<AAFDebugger> <AAFDebugger>
<AAFDebugFiles> <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> </AAFDebugFiles>
</AAFDebugger> </AAFDebugger>
</PropertyGroup> </PropertyGroup>
@@ -207,6 +218,15 @@
<Compile Include="clock.hpp"> <Compile Include="clock.hpp">
<SubType>compile</SubType> <SubType>compile</SubType>
</Compile> </Compile>
<Compile Include="eink\eink.hpp">
<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"> <Compile Include="flash\flash.hpp">
<SubType>compile</SubType> <SubType>compile</SubType>
</Compile> </Compile>
@@ -216,6 +236,15 @@
<Compile Include="main.cpp"> <Compile Include="main.cpp">
<SubType>compile</SubType> <SubType>compile</SubType>
</Compile> </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"> <Compile Include="uart\config.hpp">
<SubType>compile</SubType> <SubType>compile</SubType>
</Compile> </Compile>
@@ -253,6 +282,8 @@
<ItemGroup> <ItemGroup>
<Folder Include="flash" /> <Folder Include="flash" />
<Folder Include="io" /> <Folder Include="io" />
<Folder Include="eink" />
<Folder Include="spi" />
<Folder Include="util" /> <Folder Include="util" />
<Folder Include="uart" /> <Folder Include="uart" />
</ItemGroup> </ItemGroup>

View File

@@ -2,20 +2,43 @@
#include "flash/flash.hpp" #include "flash/flash.hpp"
#include "io/io.hpp" #include "io/io.hpp"
#include "spi/spi.hpp"
#include "uart/uart.hpp" #include "uart/uart.hpp"
#include "eink/eink.hpp"
#include "eink/imagedata.h"
using uart_t = uart::Uart0<>; using uart_t = uart::Uart0<>;
REGISTER_UART0_INT_VECTORS(uart_t); REGISTER_UART0_INT_VECTORS(uart_t);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
int main() int main()
{ {
using spi_t = spi::Hardware<spi::Config<>>;
uart_t serial; uart_t serial;
serial.init(); serial.init();
sei(); sei();
serial << F("e-Paper demo") << F("\r\n");
auto einkDisplay = eink::Eink<200, 200, spi_t, io::P::C1, io::P::C0, io::P::C2>{};
einkDisplay.init();
serial << F("e-Paper init") << F("\r\n");
serial << F("e-Paper clear") << F("\r\n");
einkDisplay.clear();
serial << F("e-Paper draw") << F("\r\n");
einkDisplay.draw(IMAGE_BLACK, IMAGE_RED);
serial << F("e-Paper sleep") << F("\r\n");
einkDisplay.sleep();
while (true) { while (true) {
serial << F("Hello World!") << F("\r\n"); serial << F("e-Paper running") << F("\r\n");
_delay_ms(1000); _delay_ms(1000);
} }

1
eink/spi Submodule

Submodule eink/spi added at bb78d2291d