Implemented basic example showing usage
This commit is contained in:
1 parent
623b968aff
commit
eed7e91486
5 files changed
+28
-4
No files matched your search
@@ -1,3 +1,6 @@
|
||||
[submodule "spi/spi"]
|
||||
path = spi/spi
|
||||
url = git@git.blackmark.me:avr/spi.git
|
||||
[submodule "spi/io"]
|
||||
path = spi/io
|
||||
url = git@git.blackmark.me:avr/io.git
|
||||
Submodule
+1
Submodule spi/io added at 80de36ee7e.
+14
-1
@@ -1,6 +1,19 @@
|
||||
#include "clock.hpp"
|
||||
|
||||
void spiTest() {}
|
||||
#include "spi/spi.hpp"
|
||||
|
||||
void spiTest()
|
||||
{
|
||||
using namespace spi;
|
||||
|
||||
using cfg = Config<ClockDiv::DIV_128, Mode::MODE_0, Side::MASTER, BitOrder::MSB_FIRST, false>;
|
||||
using driver = Hardware<cfg>;
|
||||
|
||||
Spi<driver> spiDriver;
|
||||
spiDriver.init();
|
||||
spiDriver.select(true);
|
||||
spiDriver.transfer(0xff);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
+1
-1
Submodule spi/spi updated: 7a1761e054...70aabc07f6.
+9
-2
@@ -179,17 +179,24 @@
|
||||
<Compile Include="clock.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="io\io.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="main.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="spi\spi.cpp">
|
||||
<Compile Include="spi\config.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="spi\spi.h">
|
||||
<Compile Include="spi\hardware.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="spi\spi.hpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="io" />
|
||||
<Folder Include="spi" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
||||
|
||||
Reference in new issue
Block a user