Add uart for interfacing

This commit is contained in:
BlackMark 2020-03-29 01:46:11 +01:00
parent 5cde5428e0
commit 100ba9c485
7 changed files with 66 additions and 0 deletions

9
.gitmodules vendored Normal file
View File

@ -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

4
thermistor/clock.hpp Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#define F_CPU 16000000
#include <util/delay.h>

1
thermistor/flash Submodule

@ -0,0 +1 @@
Subproject commit 9245b49e4c981098ca966343f396f5064f762fb5

1
thermistor/io Submodule

@ -0,0 +1 @@
Subproject commit 80de36ee7ee3e6b0842d5eaee81d54062cb496b2

View File

@ -1,4 +1,21 @@
#include "clock.hpp"
#include <stdint.h>
#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;
}

View File

@ -176,11 +176,44 @@
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>
<Compile Include="clock.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="flash\flash.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="io\io.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="main.cpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="uart\config.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="uart\hardware.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="uart\hardware0.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="uart\hardware1.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="uart\software.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="uart\uart.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="uart\utils.hpp">
<SubType>compile</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="flash" />
<Folder Include="io" />
<Folder Include="uart" />
</ItemGroup>
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
</Project>

1
thermistor/uart Submodule

@ -0,0 +1 @@
Subproject commit cb436b11a8428c2c40a11b51fedb4d2c7d38ece7