Implement custom spi protocol

This commit is contained in:
BlackMark 2022-06-01 20:19:56 +02:00
parent c9bcdb1ca0
commit 04a9e1b132
5 changed files with 9 additions and 21 deletions

3
.gitmodules vendored
View File

@ -13,9 +13,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
[submodule "eink/avr-libstdcpp"] [submodule "eink/avr-libstdcpp"]
path = eink/avr-libstdcpp path = eink/avr-libstdcpp
url = git@github.com:modm-io/avr-libstdcpp.git url = git@github.com:modm-io/avr-libstdcpp.git

@ -1 +1 @@
Subproject commit 83a064ddc1156b4d66ff8551b7c639b6432f9dd8 Subproject commit 113931f8ba3395a9094ce8d7d23c4272458cfffb

View File

@ -218,6 +218,9 @@
<Compile Include="clock.hpp"> <Compile Include="clock.hpp">
<SubType>compile</SubType> <SubType>compile</SubType>
</Compile> </Compile>
<Compile Include="eink\eink_spi.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="eink\eink.hpp"> <Compile Include="eink\eink.hpp">
<SubType>compile</SubType> <SubType>compile</SubType>
</Compile> </Compile>
@ -230,18 +233,6 @@
<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\software.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>
@ -268,7 +259,6 @@
<Folder Include="flash" /> <Folder Include="flash" />
<Folder Include="io" /> <Folder Include="io" />
<Folder Include="eink" /> <Folder Include="eink" />
<Folder Include="spi" />
<Folder Include="util" /> <Folder Include="util" />
<Folder Include="uart" /> <Folder Include="uart" />
</ItemGroup> </ItemGroup>

View File

@ -9,7 +9,6 @@
#include "eink/eink.hpp" #include "eink/eink.hpp"
#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"
using uart_t = uart::Uart0<>; using uart_t = uart::Uart0<>;
@ -300,7 +299,7 @@ constexpr auto RLE_IMAGE [[gnu::progmem]] = std::tuple{
int main() int main()
{ {
using spi_t = spi::Software<spi::SoftwareConfig<io::P::C4, io::P::NONE, io::P::C5, io::P::C3>>; using spi_t = eink::Spi<io::P::C4, io::P::C5, io::P::C3, io::P::C2>;
uart_t serial; uart_t serial;
serial.init(); serial.init();
@ -309,7 +308,7 @@ int main()
serial << F("e-Paper demo") << F("\r\n"); serial << F("e-Paper demo") << F("\r\n");
auto einkDisplay = eink::Eink<200, 200, spi_t, io::P::C1, io::P::C2, io::P::C0>{}; auto einkDisplay = eink::Eink<200, 200, spi_t, io::P::C1, io::P::C0>{};
einkDisplay.init(); einkDisplay.init();
serial << F("e-Paper init") << F("\r\n"); serial << F("e-Paper init") << F("\r\n");
@ -317,6 +316,9 @@ int main()
serial << F("e-Paper clear") << F("\r\n"); serial << F("e-Paper clear") << F("\r\n");
einkDisplay.clear(); einkDisplay.clear();
serial << F("e-Paper autofill") << F("\r\n");
einkDisplay.autoPatternFill();
serial << F("e-Paper draw") << F("\r\n"); serial << F("e-Paper draw") << F("\r\n");
einkDisplay.draw(RLE_IMAGE); einkDisplay.draw(RLE_IMAGE);

@ -1 +0,0 @@
Subproject commit 8bf3d1a87411d0fdade0941ff51832cd6dd0a425