commit e34d6b88dff12587f17803baf37dc877c1baf5fd Author: BlackMark Date: Wed May 25 20:37:09 2022 +0200 Initial commit diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..63ebf38 --- /dev/null +++ b/.clang-format @@ -0,0 +1,13 @@ +--- +BasedOnStyle: LLVM +ColumnLimit: 120 +IndentWidth: 4 +TabWidth: 4 +UseTab: ForIndentation +AlignEscapedNewlines: DontAlign +AllowShortFunctionsOnASingleLine: Empty +AlwaysBreakTemplateDeclarations: true +BreakBeforeBraces: Custom +BraceWrapping: + AfterFunction: true +... diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3e5b64f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +*.h eol=lf +*.hpp eol=lf +*.c eol=lf +*.cpp eol=lf +.git* eol=lf +*.vcxproj* eol=crlf +*.cppproj eol=crlf +*.sln eol=crlf +*.atsln eol=crlf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f584cc --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +.vs +Release +Debug +*.componentinfo.xml +*.elf +*.o +*.hex +*.srec +*.eeprom +*.lss +*.map diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..88de5d1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "eink/uart"] + path = eink/uart + url = git@git.blackmark.me:avr/uart.git +[submodule "eink/io"] + path = eink/io + url = git@git.blackmark.me:avr/io.git +[submodule "eink/util"] + path = eink/util + url = git@git.blackmark.me:avr/util.git +[submodule "eink/flash"] + path = eink/flash + url = git@git.blackmark.me:avr/flash.git diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..80da57f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 BlackMark + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/eink.atsln b/eink.atsln new file mode 100644 index 0000000..5ccf2a6 --- /dev/null +++ b/eink.atsln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Atmel Studio Solution File, Format Version 11.00 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "eink", "eink\eink.cppproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|AVR = Debug|AVR + Release|AVR = Release|AVR + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/eink/clock.hpp b/eink/clock.hpp new file mode 100644 index 0000000..376492e --- /dev/null +++ b/eink/clock.hpp @@ -0,0 +1,4 @@ +#pragma once + +#define F_CPU 8'000'000 +#include diff --git a/eink/eink.cppproj b/eink/eink.cppproj new file mode 100644 index 0000000..d232554 --- /dev/null +++ b/eink/eink.cppproj @@ -0,0 +1,260 @@ + + + + 2.0 + 7.0 + com.Atmel.AVRGCC8.CPP + dce6c7e3-ee26-4d79-826b-08594b9ad897 + ATmega328P + none + Executable + CPP + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + eink + eink + eink + avr-g++-9.1.0 + true + false + true + true + 0x20000000 + + true + exception_table + 2 + 0 + 0 + + com.atmel.avrdbg.tool.atmelice + J41800099437 + 0x1E950F + + + + 125000 + + ISP + + com.atmel.avrdbg.tool.stk500 + + + STK500 + + ISP + 125000 + + + + + + + + + + + + + + + + 125000 + + ISP + + com.atmel.avrdbg.tool.atmelice + J41800099437 + Atmel-ICE + + + + + 125000 + + + + + custom + + + Custom Programming Tool + + + + + + + + + + -mmcu=atmega328p + True + True + True + True + False + True + True + + + NDEBUG + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include + + + Optimize for size (-Os) + True + True + True + True + -fno-threadsafe-statics -std=c11 + True + True + + + NDEBUG + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include + + + Optimize for size (-Os) + True + True + True + -fno-threadsafe-statics -Wextra -std=c++17 + + + libm + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include + + + + + + + + + -mmcu=atmega328p + True + True + True + True + False + True + True + + + DEBUG + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include + + + Optimize (-O1) + True + Maximum (-g3) + True + True + True + -fno-threadsafe-statics -std=c11 + True + True + + + DEBUG + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include + + + Optimize debugging experience (-Og) + True + Maximum (-g3) + True + True + -fno-threadsafe-statics -Wextra -std=c++17 + + + libm + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.4.346\include + + + Default (-Wa,-g) + + + + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + + + + + + + + \ No newline at end of file diff --git a/eink/flash b/eink/flash new file mode 160000 index 0000000..6edb2e5 --- /dev/null +++ b/eink/flash @@ -0,0 +1 @@ +Subproject commit 6edb2e5a21e0ce58ff2df936caee8b84e240a46b diff --git a/eink/io b/eink/io new file mode 160000 index 0000000..80de36e --- /dev/null +++ b/eink/io @@ -0,0 +1 @@ +Subproject commit 80de36ee7ee3e6b0842d5eaee81d54062cb496b2 diff --git a/eink/main.cpp b/eink/main.cpp new file mode 100644 index 0000000..c2297b8 --- /dev/null +++ b/eink/main.cpp @@ -0,0 +1,23 @@ +#include "clock.hpp" + +#include "flash/flash.hpp" +#include "io/io.hpp" +#include "uart/uart.hpp" + +using uart_t = uart::Uart0<>; +REGISTER_UART0_INT_VECTORS(uart_t); + +////////////////////////////////////////////////////////////////////////// +int main() +{ + uart_t serial; + serial.init(); + sei(); + + while (true) { + serial << F("Hello World!") << F("\r\n"); + _delay_ms(1000); + } + + return 0; +} diff --git a/eink/uart b/eink/uart new file mode 160000 index 0000000..119de32 --- /dev/null +++ b/eink/uart @@ -0,0 +1 @@ +Subproject commit 119de3244588b19b4afb06f33f66f22bb80a89b5 diff --git a/eink/util b/eink/util new file mode 160000 index 0000000..632ed6c --- /dev/null +++ b/eink/util @@ -0,0 +1 @@ +Subproject commit 632ed6cf41c45786c738732d6e10d3d2bf988690