====== std.hardware.gpio_syscalls ====== Die **unterste Ebene**: dünne Hüllen um die Syscalls, die der GPIO-Zugriff braucht — ''open'', ''close'', ''read'', ''ioctl'', ''poll'', ''mmap'', ''munmap''. Sie tragen alle das Präfix ''Gpio'', damit sie nicht mit den gleichnamigen Builtins kollidieren. Diese Unit ruft man selten direkt. Sie ist die gemeinsame Grundlage von [[lyx_-_programmiersprache:units:hardware:gpio_mmio|gpio_mmio]] und [[lyx_-_programmiersprache:units:hardware:gpio_ioctl|gpio_ioctl]] und dann nützlich, wenn ein ioctl gebraucht wird, den die höheren Ebenen nicht anbieten. ''GpioPollFdSet'' und ''GpioPollFdRevents'' schreiben und lesen die Felder einer ''pollfd''-Struktur im Rohspeicher — Lyx kennt keine C-Structs, die Felder werden über Offsets angesprochen. [[lyx_-_programmiersprache:units:hardware:gpio|std.hardware.gpio — Übersicht]] · [[lyx_-_programmiersprache:guides:gpio|GPIO-Guide]] · [[lyx_-_programmiersprache:units|Standard Library]] ---- ===== Schnittstelle ===== ^ Signatur ^ | ''GpioOpen(path: pchar, flags: int64): int64'' | | ''GpioSysClose(fd: int64): int64'' | | ''GpioRead(fd: int64, buf: int64, count: int64): int64'' | | ''GpioIoctl(fd: int64, request: int64, arg: int64): int64'' | | ''GpioPoll(fds_ptr: int64, nfds: int64, timeout_ms: int64): int64'' | | ''GpioMmap(addr: int64, length: int64, prot: int64, flags: int64, fd: int64, offset: int64): int64'' | | ''GpioMunmap(addr: int64, length: int64): int64'' | | ''GpioPollFdSet(ptr: int64, fd: int64, events: int64)'' | | ''GpioPollFdRevents(ptr: int64): int64'' | ^ Konstante ^ Wert ^ Bedeutung ^ | ''GPIO_O_RDONLY'' | ''0'' | – | | ''GPIO_O_WRONLY'' | ''1'' | – | | ''GPIO_O_RDWR'' | ''2'' | – | | ''GPIO_O_SYNC'' | ''4096'' | 0x1000 — synchronous I/O | | ''GPIO_PROT_READ'' | ''1'' | – | | ''GPIO_PROT_WRITE'' | ''2'' | – | | ''GPIO_PROT_RW'' | ''3'' | – | | ''GPIO_MAP_SHARED'' | ''1'' | – | | ''GPIO_MAP_FAILED'' | ''-1'' | mmap Fehler-Sentinel | | ''GPIO_POLLIN'' | ''1'' | – | | ''GPIO_POLLOUT'' | ''4'' | – | | ''GPIO_POLLERR'' | ''8'' | – | Quelle: ''std/hardware/gpio_syscalls.lyx'' · geprüft mit ''lyxc 1.0.21A'' · Stand 2026-08-12 ---- Letzte Aktualisierung: 2026-08-16 (Dateistand)