fweiss / tm4c-led-pwm

Simple exploration of tm4c123g using PIO and C++
0 stars 0 forks source link

survey of c++ libraries for M4 #6

Open fweiss opened 2 weeks ago

fweiss commented 2 weeks ago

Here are some:

fweiss commented 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 {