diff --git a/KED_structure_idea/bsl/hw_plattform.hpp b/KED_structure_idea/bsl/hw_plattform.hpp index 403f18d..5684419 100644 --- a/KED_structure_idea/bsl/hw_plattform.hpp +++ b/KED_structure_idea/bsl/hw_plattform.hpp @@ -1,11 +1,29 @@ #ifndef __HW_PLATTFORM_HPP__ #define __HW_PLATTFORM_HPP__ +// +// csl ressources +// + #include "./../csl/implementations/dummy/dummy_pin.hpp" +// +// drivers +// + +#include "./../drivers/LED.hpp" + struct HW_plattform { Dummy_Pin pin_0, pin_1; + LED led_0; + HW_plattform(): + pin_0(), + pin_1(), + led_0(pin_0) + {} + + }; diff --git a/KED_structure_idea/drivers/LED.hpp b/KED_structure_idea/drivers/LED.hpp new file mode 100644 index 0000000..dfaec72 --- /dev/null +++ b/KED_structure_idea/drivers/LED.hpp @@ -0,0 +1,35 @@ +#ifndef __LED_HPP__ +#define __LED_HPP__ + +#include "./../csl/interfaces/pin.hpp" + +template +class LED +{ + public: + + LED(Pin& pin) : + pin(pin) + {} + + void turnOn() + { + pin.set(true); + } + + void turnOff() + { + pin.set(false); + } + + void toggle() + { + pin.toggle(); + } + + private: + + Pin& pin; +}; + +#endif // __LED_HPP__ diff --git a/KED_structure_idea/main.cpp b/KED_structure_idea/main.cpp index c546422..20df43c 100644 --- a/KED_structure_idea/main.cpp +++ b/KED_structure_idea/main.cpp @@ -8,6 +8,9 @@ int main() HW_plattform hw; - hw.pin_0.set(true); + hw.pin_1.set(true); + + hw.led_0.turnOn(); + return 1; } \ No newline at end of file diff --git a/KED_structure_idea/runtest b/KED_structure_idea/runtest index 8634205..c0a191e 100755 Binary files a/KED_structure_idea/runtest and b/KED_structure_idea/runtest differ