Zwei Hilfsfunktionen, die sonst überall doppelt entstünden.
GpioDelayMicroseconds wartet über clock_nanosleep auf der monotonen Uhr — genau genug für Bit-Bang-Protokolle (±1–2 µs), und im Gegensatz zu einer Warteschleife ohne Last auf dem Kern.
GpioCopyStringToBuf kopiert einen pchar längenbegrenzt in einen Rohpuffer — gebraucht für die Consumer-Labels der ioctl-Schnittstelle, die als Byte-Feld fester Größe übergeben werden.
std.hardware.gpio — Übersicht · GPIO-Guide · Standard Library
| Signatur |
|---|
GpioCopyStringToBuf(src: pchar, dst: int64, max_len: int64): int64 |
GpioDelayMicroseconds(delay_us: int64) |
| Konstante | Wert | Bedeutung |
|---|---|---|
GPIO_CLOCK_MONOTONIC | 1 | – |
GPIO_TIMESPEC_SIZE | 16 | sec(8) + nsec(8) |
GPIO_NS_PER_US | 1000 | – |
GPIO_NS_PER_SEC | 1000000000 | – |
Quelle: std/hardware/gpio_util.lyx · geprüft mit lyxc 1.0.21A · Stand 2026-08-12