diff --git a/Makefile b/Makefile index b7a2589..acf4a63 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ cpp_src += $(wildcard *.cpp) cpp_src += $(wildcard ./utils/*.cpp) +cpp_src += $(wildcard ./interfaces/*.cpp) #cpp_src += $(wildcard ./communication/i2c/*.cpp) #c_src += $(wildcard ./algorithms/*.c) diff --git a/README.md b/README.md index 987b6a5..d67df74 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ # KED -Kerems and Edwins Develeppoment platform. \ No newline at end of file +Kerems and Edwins Develeppoment platform. + +08.08.21 Kerem & Edwin + - Preparing the main implementation (dummy) of our structure which consists of : + - CSL : Chip Support Layer + - CSL for Raspberry + - CSL for STM Nucleo + - BSL : Board Support Layer + - BSL for Raspberry + - BSL for Oven Control + - Project Level + - Integrate BSL dummy fct. to our main.cpp + diff --git a/bsl/csl/raspberry/peripherals/pinRaspberry.hpp b/bsl/csl/raspberry/peripherals/pinRaspberry.hpp new file mode 100644 index 0000000..4ba5ea3 --- /dev/null +++ b/bsl/csl/raspberry/peripherals/pinRaspberry.hpp @@ -0,0 +1,15 @@ +#ifndef __PINRASPBERRY_HPP__ +#define __PINRASPBERRY_HPP__ + +#include + +struct Pin_Raspberry : Pin +{ + void writeImpl(bool logic) + { + std::cout << "Raspberry pin set to " << logic << std::endl; + } +}; + + +#endif // __PINRASPBERRY_HPP__ diff --git a/interfaces/pin.hpp b/interfaces/pin.hpp new file mode 100644 index 0000000..3a265d6 --- /dev/null +++ b/interfaces/pin.hpp @@ -0,0 +1,13 @@ +#ifndef __PIN_HPP__ +#define __PIN_HPP__ + +template +struct Pin +{ + void write(bool logic) + { + static_cast(this)->writeImpl(logic); + } +}; + +#endif // __PIN_HPP__ diff --git a/main.cpp b/main.cpp index 44cfaa1..a52103e 100644 --- a/main.cpp +++ b/main.cpp @@ -14,9 +14,13 @@ CommandManager commander; +Pin_Raspberry rpin; + void dummy() { + rpin.write(1); std::cout << "Dummy" << std::endl; + } int main(int argc, char *argv[]) diff --git a/main.hpp b/main.hpp index 5c928bb..5e48fef 100644 --- a/main.hpp +++ b/main.hpp @@ -5,5 +5,7 @@ #include #include #include "./utils/commandManager.h" +#include "./interfaces/pin.hpp" +#include "bsl/csl/raspberry/peripherals/pinRaspberry.hpp" #endif // __MAIN_HPP__ diff --git a/runtest b/runtest index b6a1d39..f1a0c3a 100755 Binary files a/runtest and b/runtest differ