DEPRECATED, use our successor library https://modm.io instead
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci [ci] scons qtcreator and cmake wrapper generator Feb 1, 2018
doc Driver: MCP2515: Revive driver and add 8 MHz config. Aug 22, 2017
examples [examples] Nucleo-L432KC pwm example May 24, 2018
ext [ext/st] Update STM32 CMSIS headers Jan 7, 2018
release/tests [examples] Refactor examples' and release tests' SConstruct files for… Dec 21, 2017
scons [scons] Enable strict checks. May 18, 2018
src [boards] Add Nucleo-L432KC board target May 24, 2018
templates [scons] CMake wrapper generator Feb 1, 2018
tools Update for 2018q2 release Jun 28, 2018
.editorconfig Add .editorconfig. Mar 30, 2017
.gitattributes [attributes] do not normalize line endings in ext Sep 15, 2015
.gitignore [gitignore] ignore CMake files Feb 1, 2018
.gitlab-ci.yml [ci] Enable CI for STM32L476 and update README. May 2, 2017
.mailmap Update for 2018q2 release Jun 28, 2018
AUTHORS Update for 2018q2 release Jun 28, 2018
CHANGELOG.md Update for 2018q2 release Jun 28, 2018
CONTRIBUTING.md Typo Mar 28, 2017
LICENSE Update for 2017q1 release. Apr 4, 2017
PORTING.md Replace remaining "execfile" usage. Jan 16, 2018
README.md [readme] More information on modm Jun 24, 2018
SConscript.check [scons] Make SCons* and site_tools Python 3 compatible Dec 21, 2017
SConscript.generate [scons] Make SCons* and site_tools Python 3 compatible Dec 21, 2017
SConstruct Fix scons template from root folder. Oct 26, 2017
TESTING.md [ci] Fix the unit test runners for STM32 and AVR. May 2, 2016

README.md

xpcc is now deprecated and this repo will be archived at the end of 2018!

Use these instructions to port your code to the successor library modm.

Ping @salkinium for answers to your questions.

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!

xpcc: C++ microcontroller framework Build Status

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.

This project also has guide for developers as well as a technical blog to document larger design concepts.

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.

Features

  • Efficient and fast object-oriented C++14 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
    • ADC
    • UART, I2C, SPI
    • CAN
  • 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.

Supported hardware

Here is a list of supported and tested microcontrollers and development boards:

Controller Development Board Support
AT90can custom ★★★
ATtiny44a custom ★★★
ATtiny85 custom ★★★
ATmega328p Arduino Uno ★★★
STM32F031 Nucleo F031K6 ★★★★
STM32F051 STM32F0 Discovery ★★
STM32F072 STM32F072 Discovery ★★★★
STM32F100 STM32F1 Discovery ★★★
STM32F103 Nucleo F103RB ★★★
STM32F103 STM32F1 Blue Pill ★★★
STM32F303 STM32F3 Discovery ★★★★★
STM32F303 Nucleo F303K8 ★★★★
STM32F407 STM32F4 Discovery ★★★★★
STM32F401 Nucleo F401RE ★★★★
STM32F411 Nucleo F411RE ★★★★
STM32F429 STM32F429 Discovery ★★★★★
STM32F429 Nucleo F429ZI ★★★★
STM32F469 STM32F469 Discovery ★★★★
STM32F746 STM32F746 Discovery ★★★★
STM32F769 STM32F769 Discovery ★★★★
STM32L476 STM32L476 Discovery ★★
STM32L476 Nucleo L476RG ★★
LPC11C24 LPCxpresso ★★

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.

Your target

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.

Documentation

The project homepage is located at xpcc.io.
Complete installation instructions for our build system and toolchains can be found here.

The API documentation is created from doxygen files in the doc-folder and can be found online here.
If you want to have up-to-date documentation of the develop branch, execute scons doc in the xpcc root directory and the current development documentation will be available in xpcc/doc/build/api/index.html.

xpcc also has a blog for in-depth write ups of the programming techniques used.

How can I contribute?

The easiest way for you and the best way for us to see if something is unclear or missing, is if you use the library and give us some feedback.

You may of course file a bug report or if you have a fix already, open a pull request.

See CONTRIBUTING.md for our contributing guidelines.

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) with significant contributions from Sascha Schade (@strongly-typed), Kevin Läufer (@ekiwi), Fabian Greif (@dergraaf), Martin Rosekeit (@thundernail), Daniel Krebs (@daniel-k) and Georgi Grinshpun (@georgi-g).

Folder structure

build
Temporary folder, build files created during building the unit tests etc. go in here. Can be deleted to save disk space.
doc
Documentation, mainly the doxygen documentation. The online documentation is build by running `doxygen doxyfile` in this folder or `scons doc` in the root folder.
examples
Example projects that show the usage of parts of the xpcc library. These projects are always up to date and are tested to compile before a release.
release
Among other things some test programs which are run before a release to check that everything is compiling correctly.
scons
SCons tools (e.g. xpcc.py for the build process, avr.py for compiling for AVR microcontrollers, arm.py for compiling for Cortex-M3/4, etc.)

Look at the SConstruct files in the example folder and the online documentation to see how to use the provided scons tools.

src
Source files for the xpcc library
templates
Template files for xpcc, Unit-Tests etc.
tools
Supporting tools for the usage of the library.

For example the communication builder, used to generate header files for the communication architecture from XML-files.