Expand description
AUTO-GENERATED by scripts/gen-abi-bindings.sh (bindgen 0.72.1) — DO NOT EDIT.
Source of truth: packages/platform/nros-platform-api/include/nros/platform*.h (RFC-0054).
Edit the headers, rerun the script, commit both.
Structs§
Constants§
- NROS_
PLATFORM_ CONDVAR_ STORAGE_ SIZE - NROS_
PLATFORM_ MUTEX_ REC_ STORAGE_ SIZE - NROS_
PLATFORM_ MUTEX_ STORAGE_ SIZE - NROS_
PLATFORM_ PRIORITY_ INHERIT - NROS_
PLATFORM_ PRIORITY_ MAX - NROS_
PLATFORM_ PRIORITY_ MIN - NROS_
PLATFORM_ RET_ ERROR - NROS_
PLATFORM_ RET_ INVALID - NROS_
PLATFORM_ RET_ NOMEM - NROS_
PLATFORM_ RET_ OK - NROS_
PLATFORM_ RET_ TIMEOUT - NROS_
PLATFORM_ RET_ UNSUPPORTED - NROS_
PLATFORM_ STORAGE_ ALIGN - NROS_
PLATFORM_ TASK_ DETACHED - NROS_
PLATFORM_ TASK_ STORAGE_ SIZE
Functions§
- nros_
platform_ ⚠alloc - Allocate
sizebytes; returnNULLon failure. May be called from any thread. - nros_
platform_ ⚠clock_ ns - Monotonic nanoseconds since a platform-defined epoch (boot, program start, …). Never decreases. Wraps after ~584 years.
- nros_
platform_ ⚠clock_ resolution_ ns - Granularity of
nros_platform_clock_ns, in nanoseconds: the smallest non-zero difference two successive reads can report. - nros_
platform_ ⚠condvar_ drop - nros_
platform_ ⚠condvar_ init - nros_
platform_ ⚠condvar_ signal - nros_
platform_ ⚠condvar_ signal_ all - nros_
platform_ ⚠condvar_ signal_ from_ isr - Phase 124.B.7.a — ISR-safe signal.
- nros_
platform_ ⚠condvar_ storage_ align - nros_
platform_ ⚠condvar_ storage_ size - nros_
platform_ ⚠condvar_ wait - Atomically release
mand block oncv. The mutex is re-acquired before this function returns. - nros_
platform_ ⚠condvar_ wait_ until - Like
condvar_wait, but with an absolute monotonic deadline in MILLISECONDS on thenros_platform_clock_ns()epoch — i.e.clock_ns() / 1000000. Returns non-zero on timeout. - nros_
platform_ ⚠critical_ section_ acquire - nros_
platform_ ⚠critical_ section_ release - nros_
platform_ ⚠dealloc - Free a previously allocated block.
NULLis a no-op. - nros_
platform_ ⚠epoch_ us - Microseconds since the UNIX EPOCH (1970-01-01T00:00:00Z), or
0when this platform has no wall-clock source. - nros_
platform_ ⚠heap_ total_ bytes - Total managed heap size in bytes (used + free), or
0if unknown. - nros_
platform_ ⚠heap_ used_ bytes - Bytes currently allocated from the platform heap, or
0if the port does not instrument it. Phase 230 / RFC-0034 D7: the true unified figure where the platform owns one kernel heap shared by the C side and the Rust#[global_allocator]. - nros_
platform_ ⚠log_ flush - nros_
platform_ ⚠log_ write - nros_
platform_ ⚠mutex_ drop - nros_
platform_ ⚠mutex_ init - nros_
platform_ ⚠mutex_ lock - nros_
platform_ ⚠mutex_ rec_ drop - nros_
platform_ ⚠mutex_ rec_ init - Initialise a recursive mutex (same-thread re-entry permitted). Required by zenoh-pico.
- nros_
platform_ ⚠mutex_ rec_ lock - nros_
platform_ ⚠mutex_ rec_ storage_ align - nros_
platform_ ⚠mutex_ rec_ storage_ size - nros_
platform_ ⚠mutex_ rec_ try_ lock - nros_
platform_ ⚠mutex_ rec_ unlock - nros_
platform_ ⚠mutex_ storage_ align - nros_
platform_ ⚠mutex_ storage_ size - Opaque-storage sizing for the lock family, matching
wakeandtask. Pure functions, callable before the corresponding_init. - nros_
platform_ ⚠mutex_ try_ lock - nros_
platform_ ⚠mutex_ unlock - nros_
platform_ ⚠network_ poll - Pump the underlying network stack to process pending I/O. No-op on platforms with a kernel-driven socket layer (POSIX, Zephyr, lwIP, NetX Duo). Bare-metal smoltcp targets advance the stack from this entry point.
- nros_
platform_ ⚠panic - nros_
platform_ ⚠random_ fill - Fill
lenbytes atbufwith random data. - nros_
platform_ ⚠random_ u8 - Random
u8. Cryptographically random where the platform has an entropy source; otherwise a seeded PRNG. Must be deterministic within a single test session for reproducibility. - nros_
platform_ ⚠random_ u16 - Random
u16. Seerandom_u8notes. - nros_
platform_ ⚠random_ u32 - Random
u32. Seerandom_u8notes. - nros_
platform_ ⚠random_ u64 - Random
u64. Seerandom_u8notes. - nros_
platform_ ⚠realloc - Resize the block at
ptrtosizebytes. Equivalent to libcrealloc:NULLptr → fresh alloc;0size → free + returnNULL. Preserves contents up tomin(old, new). - nros_
platform_ ⚠register_ log_ writer - nros_
platform_ ⚠sleep_ ms - Sleep at least
msmilliseconds. - nros_
platform_ ⚠sleep_ s - Sleep at least
sseconds. - nros_
platform_ ⚠sleep_ us - Sleep at least
usmicroseconds. Spin if the platform clock has no sub-millisecond timer. - nros_
platform_ ⚠socket_ accept - Accept a pending connection from
sock_inintosock_out. - nros_
platform_ ⚠socket_ close - Socket-layer shutdown + close. Distinct from
nros_platform_tcp_closebecause zenoh-pico’s helper layer exposes both. - nros_
platform_ ⚠socket_ set_ non_ blocking - Switch a socket to non-blocking mode.
- nros_
platform_ ⚠socket_ wait_ event - Wait for socket events on a multi-peer set. Optional on platforms without a poll/select primitive.
- nros_
platform_ ⚠task_ attr_ init - Fill
attrwith the defaults — equivalent to passingNULLtotask_init. - nros_
platform_ ⚠task_ cancel - Request
taskto terminate at the next cancellation point. Cooperative: a task that never reaches a cancel point will not stop. - nros_
platform_ ⚠task_ detach - Mark
taskas detached — its storage is reclaimed on exit without a join. - nros_
platform_ ⚠task_ exit - Terminate the calling task immediately. Does not return.
- nros_
platform_ ⚠task_ free - Free task storage allocated by
task_init. Called aftertask_joinortask_detach + exit. - nros_
platform_ ⚠task_ init - Spawn a new task.
taskis opaque caller-provided storage (size fromnros_platform_task_storage_size);attris anros_platform_task_attr_t *, orNULLfor every default;entryis the task entry point;argis forwarded toentry. - nros_
platform_ ⚠task_ join - Block until
taskexits. Cleans up task storage on success. - nros_
platform_ ⚠task_ stack_ unused_ bytes - Smallest number of bytes ever left unused on the CALLING task’s stack, or
0if this port cannot report it. - nros_
platform_ ⚠task_ storage_ align - nros_
platform_ ⚠task_ storage_ size - Opaque-storage sizing for
task, mirroring the wake primitive’s probes below. Both are pure functions (no global state) and may be called beforenros_platform_task_init. - nros_
platform_ ⚠tcp_ close - Close a TCP socket.
- nros_
platform_ ⚠tcp_ create_ endpoint - Resolve
(address, port)strings into the caller-allocated endpoint storage atep. Both strings are NUL-terminated. - nros_
platform_ ⚠tcp_ free_ endpoint - Release any resources held by the endpoint at
ep. - nros_
platform_ ⚠tcp_ listen - Open a listening TCP socket bound to
endpoint. - nros_
platform_ ⚠tcp_ open - Open a TCP client connection to
endpoint. - nros_
platform_ ⚠tcp_ read - Read up to
lenbytes. Returns bytes received, orNROS_PLATFORM_NET_SOCKET_ERRORon error. - nros_
platform_ ⚠tcp_ read_ exact - Read exactly
lenbytes. Returnslenon success, orNROS_PLATFORM_NET_SOCKET_ERRORon error. - nros_
platform_ ⚠tcp_ send - Send
lenbytes. Returns bytes sent, orNROS_PLATFORM_NET_SOCKET_ERRORon error. - nros_
platform_ ⚠time_ now_ ns - Wall-clock nanoseconds since the Unix epoch, or
0if the platform has no real-time clock. - nros_
platform_ ⚠timer_ cancel - Cancel a previously-armed timer. Returns:
- nros_
platform_ ⚠timer_ create_ oneshot - Register a one-shot timer that invokes
callback(user_data)once aftertimeout_usmicroseconds. Returns the platform-native handle on success, NULL on failure. - nros_
platform_ ⚠timer_ create_ periodic - Register a periodic timer that invokes
callback(user_data)everyperiod_usmicroseconds. Returns the platform-native handle on success, NULL on failure. - nros_
platform_ ⚠timer_ destroy - Cancel + free the timer. Drains in-flight callback invocations
before returning so
user_datais no longer accessed. Idempotent on already-destroyed handles. - nros_
platform_ ⚠udp_ close - nros_
platform_ ⚠udp_ create_ endpoint - nros_
platform_ ⚠udp_ free_ endpoint - nros_
platform_ ⚠udp_ listen - Bind a UDP socket in listen / server mode. Optional — return -1 on platforms that don’t expose a UDP-server primitive.
- nros_
platform_ ⚠udp_ mcast_ close - nros_
platform_ ⚠udp_ mcast_ listen - nros_
platform_ ⚠udp_ mcast_ open - nros_
platform_ ⚠udp_ mcast_ read - nros_
platform_ ⚠udp_ mcast_ read_ exact - nros_
platform_ ⚠udp_ mcast_ send - nros_
platform_ ⚠udp_ open - nros_
platform_ ⚠udp_ read - nros_
platform_ ⚠udp_ read_ exact - nros_
platform_ ⚠udp_ send - Send
lenbytes toendpoint. - nros_
platform_ ⚠udp_ set_ recv_ timeout - Set the recv timeout in milliseconds;
0means block indefinitely. - nros_
platform_ ⚠wake_ drop - nros_
platform_ ⚠wake_ init - nros_
platform_ ⚠wake_ signal - nros_
platform_ ⚠wake_ signal_ from_ isr - nros_
platform_ ⚠wake_ storage_ align - nros_
platform_ ⚠wake_ storage_ size - Opaque-storage sizing. Both helpers are pure functions (no global
state) and may be called before
nros_platform_wake_init. - nros_
platform_ ⚠wake_ wait_ ms - nros_
platform_ ⚠yield_ now - Voluntarily yield the current task / thread. On bare-metal,
core::hint::spin_loop()is acceptable; on RTOSes use the native cooperative-yield primitive (k_yield,vPortYield,tx_thread_relinquish,sched_yield, …). RTOS yields are not ISR-safe.
Type Aliases§
- nros_
platform_ log_ flush_ fn_ t - nros_
platform_ log_ writer_ fn_ t - nros_
platform_ ret_ t - nros_
platform_ timer_ callback_ t - @file platform_timer.h @brief Canonical C ABI for the nros platform timer surface.