diff --git a/app/raspberry_pi/repository/packages/p/pca9685/xmake.lua b/app/raspberry_pi/repository/packages/p/pca9685/xmake.lua deleted file mode 100644 index d38a7f07..00000000 --- a/app/raspberry_pi/repository/packages/p/pca9685/xmake.lua +++ /dev/null @@ -1,30 +0,0 @@ -package("pca9685") - set_homepage("https://github.com/chaoticmachinery/pca9685") - set_description("PCA9685 C++ Library. Works with SunFounder") - set_license("LGPL-2.1") - - set_urls("https://github.com/chaoticmachinery/pca9685.git") - - add_versions("2017.12.07", "6f9794d888f77b863884c3eac933b75a07101347") - - on_install("linux", function (package) - io.writefile("xmake.lua", [[ - add_rules("mode.debug", "mode.release") - target("pca9685") - set_kind("$(kind)") - set_languages("c++11") - add_files("PCA9685.cpp") - add_headerfiles("PCA9685.h") - ]]) - local configs = {} - import("package.tools.xmake").install(package, configs) - end) - - on_test(function (package) - assert(package:check_cxxsnippets({test = [[ - #include "PCA9685.h" - void test() { - PCA9685 pwm; - } - ]]}, {configs = {languages = "c++11"}})) - end) diff --git a/app/raspberry_pi/repository/packages/t/tb6612/tb6612/include/TB6612.h b/app/raspberry_pi/repository/packages/t/tb6612/tb6612/include/TB6612.h new file mode 100644 index 00000000..7df3e81e --- /dev/null +++ b/app/raspberry_pi/repository/packages/t/tb6612/tb6612/include/TB6612.h @@ -0,0 +1,37 @@ +#ifndef TB6612_H +#define TB6612_H + +#pragma once + +#include "cppgpio.hpp" + +namespace tb6612 +{ + class Motor + { + public: + Motor( + const int &direction_channel, + const int &pwn = 0, + const bool &offset = true) : + direction_channel(direction_channel), + pwm(pwm), + offset(offset), + forward_offset(offset), + backward_offset(!offset) + { + } + + private: + const int direction_channel; + const int pwm; + const bool offset; + + bool forward_offset; + bool backward_offset; + + int speed = 0; + } +} + +#endif \ No newline at end of file diff --git a/app/raspberry_pi/repository/packages/t/tb6612/xmake.lua b/app/raspberry_pi/repository/packages/t/tb6612/xmake.lua new file mode 100644 index 00000000..b7f0a0fe --- /dev/null +++ b/app/raspberry_pi/repository/packages/t/tb6612/xmake.lua @@ -0,0 +1,8 @@ +package("tb6612") + add_deps("cppgpio") + set_sourcedir(path.join(os.scriptdir(), "tb6612")) + on_install(function (package) + local configs = {} + import("package.tools.xmake").install(package, configs) + end) +package_end() \ No newline at end of file