From 100ba9c485b589a7033b266ff9546636504af568 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sun, 29 Mar 2020 01:46:11 +0100 Subject: [PATCH] Add uart for interfacing --- .gitmodules | 9 +++++++++ thermistor/clock.hpp | 4 ++++ thermistor/flash | 1 + thermistor/io | 1 + thermistor/main.cpp | 17 +++++++++++++++++ thermistor/thermistor.cppproj | 33 +++++++++++++++++++++++++++++++++ thermistor/uart | 1 + 7 files changed, 66 insertions(+) create mode 100644 .gitmodules create mode 100644 thermistor/clock.hpp create mode 160000 thermistor/flash create mode 160000 thermistor/io create mode 160000 thermistor/uart diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..24afbde --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "thermistor/uart"] + path = thermistor/uart + url = git@git.blackmark.me:avr/uart.git +[submodule "thermistor/flash"] + path = thermistor/flash + url = git@git.blackmark.me:avr/flash.git +[submodule "thermistor/io"] + path = thermistor/io + url = git@git.blackmark.me:avr/io.git diff --git a/thermistor/clock.hpp b/thermistor/clock.hpp new file mode 100644 index 0000000..94845e9 --- /dev/null +++ b/thermistor/clock.hpp @@ -0,0 +1,4 @@ +#pragma once + +#define F_CPU 16000000 +#include diff --git a/thermistor/flash b/thermistor/flash new file mode 160000 index 0000000..9245b49 --- /dev/null +++ b/thermistor/flash @@ -0,0 +1 @@ +Subproject commit 9245b49e4c981098ca966343f396f5064f762fb5 diff --git a/thermistor/io b/thermistor/io new file mode 160000 index 0000000..80de36e --- /dev/null +++ b/thermistor/io @@ -0,0 +1 @@ +Subproject commit 80de36ee7ee3e6b0842d5eaee81d54062cb496b2 diff --git a/thermistor/main.cpp b/thermistor/main.cpp index a46866d..9ddd3f8 100644 --- a/thermistor/main.cpp +++ b/thermistor/main.cpp @@ -1,4 +1,21 @@ +#include "clock.hpp" + +#include + +#include "flash/flash.hpp" +#include "uart/uart.hpp" + +#define UART0_INT_VECTORS +#include "uart/hardware0.hpp" + int main() { + uart::Uart0<> serial; + serial.init(); + + serial << F("Thermistor reader\r\n"); + + serial.flushTx(); + return 0; } diff --git a/thermistor/thermistor.cppproj b/thermistor/thermistor.cppproj index 8f6a4af..830955b 100644 --- a/thermistor/thermistor.cppproj +++ b/thermistor/thermistor.cppproj @@ -176,11 +176,44 @@ + + compile + + + compile + + + compile + compile + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + + \ No newline at end of file diff --git a/thermistor/uart b/thermistor/uart new file mode 160000 index 0000000..cb436b1 --- /dev/null +++ b/thermistor/uart @@ -0,0 +1 @@ +Subproject commit cb436b11a8428c2c40a11b51fedb4d2c7d38ece7