Implemented basic example showing usage
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
|||||||
[submodule "spi/spi"]
|
[submodule "spi/spi"]
|
||||||
path = spi/spi
|
path = spi/spi
|
||||||
url = git@git.blackmark.me:avr/spi.git
|
url = git@git.blackmark.me:avr/spi.git
|
||||||
|
[submodule "spi/io"]
|
||||||
|
path = spi/io
|
||||||
|
url = git@git.blackmark.me:avr/io.git
|
||||||
|
|||||||
1
spi/io
Submodule
1
spi/io
Submodule
Submodule spi/io added at 80de36ee7e
15
spi/main.cpp
15
spi/main.cpp
@@ -1,6 +1,19 @@
|
|||||||
#include "clock.hpp"
|
#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()
|
int main()
|
||||||
{
|
{
|
||||||
|
|||||||
2
spi/spi
2
spi/spi
Submodule spi/spi updated: 7a1761e054...70aabc07f6
@@ -179,17 +179,24 @@
|
|||||||
<Compile Include="clock.hpp">
|
<Compile Include="clock.hpp">
|
||||||
<SubType>compile</SubType>
|
<SubType>compile</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="io\io.hpp">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Include="main.cpp">
|
<Compile Include="main.cpp">
|
||||||
<SubType>compile</SubType>
|
<SubType>compile</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="spi\spi.cpp">
|
<Compile Include="spi\config.hpp">
|
||||||
<SubType>compile</SubType>
|
<SubType>compile</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="spi\spi.h">
|
<Compile Include="spi\hardware.hpp">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="spi\spi.hpp">
|
||||||
<SubType>compile</SubType>
|
<SubType>compile</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Folder Include="io" />
|
||||||
<Folder Include="spi" />
|
<Folder Include="spi" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
||||||
|
|||||||
Reference in New Issue
Block a user