parent
2962ebd6e3
commit
34ef9bf307
@ -1 +1,5 @@
|
|||||||
# add_subdirectory(${CSL_USED})
|
add_library(SPI spi.c)
|
||||||
|
target_compile_options(SPI PRIVATE ${C_FLAGS})
|
||||||
|
target_compile_definitions(SPI PRIVATE ${C_DEFS})
|
||||||
|
target_include_directories(SPI PUBLIC ${INTERFACES_DIR} ${CSL_INCLUDES})
|
||||||
|
add_library(sub::spi ALIAS SPI)
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
add_library(ledDriver led.cpp)
|
|
||||||
|
|
||||||
target_compile_options(ledDriver PRIVATE ${C_FLAGS})
|
|
||||||
target_compile_definitions(ledDriver PRIVATE ${C_DEFS})
|
|
||||||
target_include_directories(ledDriver PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
|
|
||||||
add_library(sub::led ALIAS ledDriver)
|
|
@ -1,30 +0,0 @@
|
|||||||
#include "led.hpp"
|
|
||||||
|
|
||||||
Led::Led(Pin* pin_ptr)
|
|
||||||
{
|
|
||||||
pin = pin_ptr;
|
|
||||||
pin->init();
|
|
||||||
pin->setMode(Pin::mode::output);
|
|
||||||
pin->setSpeed(Pin::speed::fast);
|
|
||||||
}
|
|
||||||
|
|
||||||
Led::~Led()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Led::on()
|
|
||||||
{
|
|
||||||
pin->write(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Led::off()
|
|
||||||
{
|
|
||||||
pin->write(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Led::toggle()
|
|
||||||
{
|
|
||||||
pin->toggle();
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
#ifndef _LED_HPP
|
|
||||||
#define _LED_HPP
|
|
||||||
|
|
||||||
|
|
||||||
class Led
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Led(Pin *pin_ptr);
|
|
||||||
~Led();
|
|
||||||
|
|
||||||
void on();
|
|
||||||
void off();
|
|
||||||
void toggle();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Pin *pin;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __LED_HPP */
|
|
Loading…
Reference in new issue