xpcc: C++ microcontroller framework #
modm has significantly improved on the code generation ideas we've prototyped in xpcc, both in breadth (more devices supported) and depth (more accurate data). Check out how modm works and how you can get started with it.
We've had some fantastic engineers volunteer their time on this project over the years, to all of you a big THANK YOU! All your contributions have been ported to modm already.We're looking forward to even more collaboration with you in modm's future!
The xpcc framework consists of powerful hardware abstraction layers for many different microcontrollers, a set of drivers for various external targets and a general purpose toolbox for building hardware orientated applications.
The main goal of xpcc is to provide a usable API for barebone microcontroller programming, which is efficient enough to be deployed on a small ATtiny, yet powerful enough to make use of advanced capabilities found on the 32bit ARM Cortex-M.
xpcc is battle-tested in the real-world, highly competitive environment of Eurobot. It is the foundation of all of @RCA_eV's robot code, and is the culmination of many years worth of effort, experience and improvements.
- Feast your eyes on lots of working examples.
- API reference is available here.
- We have continuous integration as well.
- And we care a lot about testing.
- You have questions? Ask them on our mailing list or have a look at the archive.
- You found a bug? Open up an issue, we don't bite.
- You want to contribute? Read the contribution guidelines and open a pull request so we can merge it.
- You want to port xpcc? Read our porting guide.
The source code is freely available under a 3-clause BSD license, so feel free to fork this project and adapt it to your needs. The only thing we ask of you is to contribute your changes back. That way everyone can profit.
- Efficient and fast object-oriented C++11 API.
- Support of AVR and ARM Cortex-M based microcontrollers from Atmel, ST and NXP.
- Build system based on SCons and extendable using Python.
- Data-driven HAL generation using Jinja2 template engine.
- No memory allocations in HAL with very low overall RAM consumption.
- Cross platform peripheral interfaces incl. bit banging:
- GPIO & GPIO expanders
- UART, I2C, SPI
- Interfaces for external I2C and SPI device drivers.
- Debug/logging system with IOStream interface.
- Lightweight, stackless threads and resumable functions using cooperative multitasking.
- Useful mathematical and geometric algorithms optimized for microcontrollers.
- Lightweight unit testing system (suitable for AVRs).
- Graphical user interface for small binary displays.
Here is a list of supported and tested microcontrollers and development boards:
|STM32F103||STM32F1 Blue Pill||★★★★|
All of these targets are compiling and booting correctly (★) and have GPIO and UART working (★★). Most targets have support for basic peripherals, like I2C, SPI and ADC (★★★) as well as complicated peripherals, like Timers, CAN and external memory (★★★★). We also use a few targets in everyday development, which are very well tested (★★★★★).
Please see our examples for a complete list of tested projects.
While the xpcc API is designed to be portable, we are only a small team of developers and are limited in the amount of platforms we can support and test in hardware. The following microcontrollers should be able to compile, but have not been tested extensively in hardware:
- All AT90 targets
- All ATtiny targets
- All ATmega targets
- All STM32F0 targets
- All STM32F1 targets
- All STM32F3 targets
- All STM32F4 targets
- All STM32F7 targets
There are more platforms which we have prepared, but currently not finished support for (Xmega, STM32F2, STM32L). Drop us an email to ask if your specific target is supported out-of-the-box and what you can do if it's not.
Who we are#
During the last decade the Roboterclub Aachen e.V. has developed a software library for communication among components that are distributed on PCs and microcontrollers. This library was used in autonomous robots for the Eurobot competition.
In 2009, xpcc became a separate project and since then focussed on a new approach to cross target microcontroller libraries. Over the years xpcc grew from a communication library to a general purpose framework suitable for all kinds of embedded applications.
The xpcc project is maintained by Niklas Hauser (@salkinium) and Kevin Läufer (@ekiwi) with significant contributions from Fabian Greif (@dergraaf), Daniel Krebs (@daniel-k), @georgi-g and @thundernail.
Have a look at the quarter finals of the Eurobot 2015 competition. Both our robots are running xpcc and starting from the right: