diff --git a/src/kaleidoscope/driver/mcu/GD32.h b/src/kaleidoscope/driver/mcu/GD32.h new file mode 100644 index 00000000..b9adafe6 --- /dev/null +++ b/src/kaleidoscope/driver/mcu/GD32.h @@ -0,0 +1,51 @@ +/* -*- mode: c++ -*- + * driver::MCU::GD32 -- GD32 MCU driver for Kaleidoscope, initially targeting the GD32F303 series + * Copyright (C) 2019, 2020 Keyboard.io, Inc + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#pragma once + +#include "kaleidoscope/driver/mcu/Base.h" // for Base, BaseProps + +namespace kaleidoscope { +namespace driver { +namespace mcu { + +struct GD32Props : public kaleidoscope::driver::mcu::BaseProps { +}; + +#ifndef KALEIDOSCOPE_VIRTUAL_BUILD +template +class GD32 : public kaleidoscope::driver::mcu::Base<_Props> { + public: + void detachFromHost() { + USBCore::disconnect(); + } + void attachToHost() { + USBCore::connect(); + } + + + void setup() { + } +}; +#else +template +class GD32 : public kaleidoscope::driver::mcu::Base<_Props> {}; +#endif // ifndef KALEIDOSCOPE_VIRTUAL_BUILD + +} // namespace mcu +} // namespace driver +} // namespace kaleidoscope