Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Platform API

The platform API is the porting boundary between nano-ros and a concrete OS / RTOS / bare-metal target. Each platform provides a clock, optionally a heap, optionally threading, optionally networking. Platform is internal — user applications use the Rust / C / C++ APIs, not the platform vtable directly.

Canonical reference

The C vtable in packages/core/nros-platform-cffi/include/nros/platform_vtable.h is the source of truth. Every function pointer’s brief, parameter docs, ownership rules, blocking / non-blocking classification, and ISR-safe contract live in the Doxygen output.

SurfaceLink
platform-cffi Doxygen (canonical)HTML · header

To regenerate locally:

just doc-platform-cffi   # produces target/doxygen/platform-cffi/

This page does not duplicate the interface specification — read the Doxygen for that.

Reference implementations

Each row is a complete worked example. The crate’s README.md walks the implementation; the source is the worked solution to copy.

CrateTargetSource
nros-platform-posixLinux / *BSDpackages/core/nros-platform-posix
nros-platform-nuttxNuttX RTOSpackages/core/nros-platform-nuttx
nros-platform-freertosFreeRTOSpackages/core/nros-platform-freertos
nros-platform-threadxAzure RTOS / ThreadXpackages/core/nros-platform-threadx
nros-platform-zephyrZephyr RTOSpackages/core/nros-platform-zephyr
nros-platform-mps2-an385Cortex-M3 (QEMU)packages/platforms/nros-platform-mps2-an385
nros-platform-stm32f4STM32F4packages/platforms/nros-platform-stm32f4
nros-platform-esp32-qemuESP32-C3 (QEMU)packages/platforms/nros-platform-esp32-qemu

The POSIX implementation is the canonical reference port.

Writing a custom platform