Skip to content

Open-source embedded C++

Write the driver once. Run it on any MCU.

Kokeb Labs builds the software between your firmware and the chips on your board: C++20 drivers that never call a vendor SDK, a framework that joins them, and the tools and process that keep them trustworthy. You give a driver a few small functions for your bus, and the same code runs on ESP32, STM32, RP2040 or your laptop, where its tests run without hardware. MIT licensed.

Browse the drivers Request a driver GitHub

What Kokeb Labs is

Kokeb (ኮከብ) means "star" in Amharic. Kokeb Labs is one project with four parts:

  • Chip drivers


    One public repository per chip, named driver-<chip>: 22 today, from ADCs, encoders and sensors to motor controllers and a CANopen client. Each is a header-only C++20 library with a datasheet-backed documentation site.

    See the drivers

  • Tooling and process


    driver-template starts a driver in one command, ci-tools gives every repository the same checks, docs and releases, and espidf-tools builds ESP-IDF apps. The handbook holds the rules the checks enforce.

    See the tooling

  • Open boards


    KiCad boards built around the drivers, traced from needs to test results. A template, a parts library and a block library exist; the first board is at concept stage.

    See the boards

  • A framework, coming


    kb-core joins drivers to ports and an RTOS layer, with ports for ESP32 and STM32. It is in development and not public yet. Drivers do not wait for it: they work on their own.

    Read the roadmap

How the pieces fit

System map: your firmware calls chip drivers, directly or through kb-core when it is released; a driver reaches the chip only through an MCU port; beside this path, the templates, ci-tools, the handbook and driver-requests start, check and release every repository.System map: your firmware calls chip drivers, directly or through kb-core when it is released; a driver reaches the chip only through an MCU port; beside this path, the templates, ci-tools, the handbook and driver-requests start, check and release every repository.
How Kokeb Labs fits together
Figure description and sources

Top to bottom, each arrow is a call. Your firmware calls the chip drivers directly today, or through kb-core when it is released; a driver reaches the chip only through the hooks of an MCU port, which is a short class you write or a ready one for ESP32 or STM32; the port drives the chip on your board. Dashed cards are in development or at an early stage. At the top right, the open boards your firmware can run on, built around the drivers. On the right, the tooling and process every repository uses: driver-template starts a driver, board-template starts a board, ci-tools checks, documents and releases them all, the handbook holds the rules the checks enforce, espidf-tools builds and flashes ESP-IDF projects, and driver-requests takes the requests for new drivers.

Your firmware calls a driver. The driver knows the chip and nothing about your MCU: it reaches the bus only through the hooks of a port class. Beside that path sits the tooling lane: the templates start a repository, ci-tools runs the same checks in all of them, the handbook says what those checks enforce, and the request repository takes the asks for new drivers.

Why it's different

  • You write the port, not the driver


    A driver needs a few functions from you: bring the bus up, move bytes, wait. A C++20 concept checks them at compile time, so a missing or wrong hook is a compile error, not a crash on the bench.

  • Tests before the board arrives


    Every driver builds and runs its tests on the host against a model of the chip written from the datasheet. A fuzzer corrupts the chip's replies, and compile-fail tests prove the port contract rejects what it should.

  • Small and predictable


    Every call returns Result<T> with an error code. No exceptions, no heap, no RTTI, no virtual calls, so it fits small MCUs and safety reviews.

  • Honest about status


    Each driver states how far it has been checked on real hardware as a level, H0 to H2. All 22 are at H0 today: host-tested and fuzzed, not yet verified on a bench. Every README says so.

What a port looks like

The whole MCU-specific part of an SPI driver, from driver-template. Fill in the bodies with your SDK's calls:

#include "xmpl100.hpp"

class MyPort : public xmpl100::SpiInterface<MyPort> {
 public:
  bool EnsureInitialized() noexcept;  // bring the bus up on the first call; true at once afterwards
  bool Transfer(const uint8_t* tx, uint8_t* rx, std::size_t len) noexcept;  // one transfer, CS held low
  void DelayUs(uint32_t us) noexcept;  // wait at least us microseconds
};

Then use the driver the same way on every board:

xmpl100::XMPL100<MyPort> sensor(port);          // no I/O yet
if (auto r = sensor.EnsureInitialized(); !r) {  // bus up, reset, chip ID check
  return static_cast<int>(r.error);             // Bus, Timeout or DeviceIdMismatch
}
const auto t = sensor.ReadTemperatureC();       // t.value in degrees Celsius, or t.error
Sequence of a driver start and one measurement, in which the firmware starts the driver, the driver checks the chip through the port and returns a result, and a later call returns a value or an error code.Sequence of a driver start and one measurement, in which the firmware starts the driver, the driver checks the chip through the port and returns a result, and a later call returns a value or an error code.
One measurement through a driver
Figure description and sources

The Firmware calls EnsureInitialized on the Driver. The Driver sends its first transfers to the Port, which moves the bytes on the bus to the Chip and returns the replies. The Driver checks the chip identity against the datasheet and returns a Result to the Firmware. A later measurement call goes through the Port the same way, and the Driver returns either the value in physical units or an Error, never a number it could not trust.

Drawn from: docs/model/one-measurement.seq.yml.

Built for firmware where a bug can hurt

The process is written for software that may end up in a safety-classified product: MISRA C++:2023 checks on every pull request, an independent review of each driver, fuzzing, coverage gates, release candidates before releases and a stated hardware validation level. A Kokeb component is not a certified product; it supplies the evidence a manufacturer's own process asks for.

Read how we build

Where to start

  • I want to use a driver


    Pick the chip, read its quickstart, write the port class for your SDK. Each driver has a host example you can run on your PC first.

    Driver list

  • I need a driver that isn't here


    Open a request with a link to the vendor's public datasheet. Votes, public documents and effort decide the order.

    Request a driver

  • I want to write a driver


    Create a repository from the template and run one command. Your first build and tests pass before you change a line.

    Using the template

  • I want this CI in my repository


    A few short caller workflows give you C++ checks, firmware builds, a docs site and releases.

    ci-tools quickstart