Saarbastler Embedded C++ Library
Motivation
Modern C++ library for microcontrollers.
- C++ templates for hardware abstraction
- CMake
- Define as much as possible during compile time
Example:
In most cases, I/O Pins are already hard wired, so we can define them in Software during compile time:
IO-Definition in header file iodef.h für ESPxx
#include <saba_gpio.h>
namespace iodef = saba::io::espxxx::idf::statically;
using DataControl= iodef::gpio<GPIO_NUM_7>;
using Reset = iodef::gpio<GPIO_NUM_17>;
using Cs = iodef::gpio<GPIO_NUM_6>;
using Copi= iodef::gpio<GPIO_NUM_18>;
using Sck = iodef::gpio<GPIO_NUM_47>;
Rapsberry PI Pico:
#include <saba_gpio.h>
namespace iodef = saba::io::rpxxx::statically;
using DataControl= iodef::gpio<4>;
using Reset = iodef::gpio<5>;
using Cs = iodef::gpio<1>;
using Copi= iodef::gpio<3>;
using Sck = iodef::gpio<2>;
STM32:
#include <saba_gpio.h>
namespace iodef = saba::io::stm32::ll:statically;
using DataControl= iodef::gpio<PortA, 4>;
using Reset = iodef::gpio<PortA, 5>;
using Cs = iodef::gpio<PortB, GPIO_PIN_1>;
using Copi= iodef::gpio<PortB, GPIO_PIN_14>;
using Sck = iodef::gpio<PortB, GPIO_PIN_13>;
IO Initializing (für all CPU-Types identically):
#include "iodef.h"
...
DataControl::init(saba::io::Direction::Output, saba::io::OutputMode::PushPull);
Reset::init(saba::io::Direction::Output, saba::io::OutputMode::PushPull);
Cs::init(saba::io::Direction::Output, saba::io::OutputMode::PushPull);
...
DataControl::set(); // set high
Cs..reset(); // set low
Supported CPUs:
- ESP32xx
- Raspberry PI Pico RP2040, RP2340
- STM32
Installation
see Installation
Libraries
see Libraries
Doxygen
Examples
allgemeine Bibliotheken
Treiber
CPU spezifische Bibliotheken
Grafik
Description
Languages
C++
97.7%
CMake
1.2%
C
1.1%