Open fweiss opened 2 weeks ago
STM32 driver using c++17 uses this template::
Gpio::toggle<Gpio::Port::PortA, Gpio::Pin::Pin5>();
Hmm not sure where the above was. Here's a good one in digitalout.cpp
using namespace cpp_stm32::driver;
using cpp_stm32::gpio::PinName;
DigitalOut<PinName::PA_5> led;
led.toggle();
The whole project is pretty extensive and uses a lot of C++17 tricks like template argument bundles. At the low end, like in gpio.hxx
it uses template functions instead of class functions, maybe as a way to do pin-ganging:
template <Port InputPort, Pin... Pins>
constexpr void toggle() noexcept {
Here are some: