Useful, header-only C++ library collection for STM32 microcontrollers.
- Modern C++ (C++17, C++20)
- STM32 HAL drivers
- STM32CubeIDE
- Install STM32CubeIDE version 1.9 or later.
- Open an STM32 project.
- Select the programming language as C++.
- Set up the C++ standard;
Project => Properties => C/C++ Build => Settings =>
Tool Settings => MCU G++ Compiler => General =>
Language Standard => ISO C++20
- Set up the runtime library;
Project => Properties => C/C++ Build => Settings =>
Tool Settings => MCU Settings => Runtime library =>
Standard C, standard C++
- Copy the header file you want to use, along with its dependencies, to the Core/Inc folder of your STM32 project.
- Rename the automatically generated main.c file to main.cpp.
- To prevent your old code from being deleted when generating new code, write your code between the USER CODE BEGIN and USER CODE END sections.
- Rename the main.cpp file to main.c before making any changes to the .ioc file and generating new code. After generating new code, rename the automatically generated main.c file to main.cpp.
BSD 3-Clause License, see LICENSE file for details.
- I2C
- MPU6050
- SPI
- I2S
- CANBUS
- 7-Segment Display
- LCD
- Multi-mode gpio
- DS18B20
- LM35
- ADXL345
- PID control
- Test code
- Use double as a non-type template parameter when supported by the compiler