title: "GPIO Support Integration in SplashKit Core" description: "Added GPIO support to SplashKit Core using libgpiod_if2 and contributed to strategic development planning"
🛠 GPIO Support Integration — SplashKit Core
I extended the SplashKit Core SDK by adding GPIO (General Purpose Input/Output) support for Linux platforms using the libgpiod_if2 library, enabling direct hardware pin interaction from SplashKit programs.
📦 Background
SplashKit Core is the foundational library of the SplashKit SDK, offering a wide range of cross-platform APIs for graphics, audio, input, networking, and more to make game and application development accessible for beginners and educators.
GPIO support allows programs to interact with physical hardware pins on Linux boards (e.g., Raspberry Pi) — reading inputs like button presses and driving outputs like LEDs — directly through SplashKit’s API.
⚙️ Technical Implementation
-
libgpiod_if2 Integration:
- I integrated the Linux GPIO character device interface via the
libgpiod_if2library, a modern userspace C library that replaces the legacy sysfs GPIO interface and provides a robust API for GPIO operations. - This involved linking libgpiod to SplashKit Core and wrapping its functionality behind beginner-friendly SDK calls.
- I integrated the Linux GPIO character device interface via the
-
API Extensions in SplashKit Core:
- Designed and implemented abstractions such as
gpio_open(),gpio_set_direction(),gpio_write(), andgpio_read()that map internally tolibgpiod_if2calls. - Ensured that these functions integrate cleanly into the existing SplashKit lifecycle and error-handling patterns.
- Designed and implemented abstractions such as
-
Cross-Platform Compatibility:
- Wrapped GPIO features with compile-time guards so that builds on unsupported platforms (e.g., Windows/macOS) remain unaffected and compile successfully without GPIO support.
-
Resource Management:
- Implemented safe GPIO resource allocation by managing device handles and release logic to prevent leaks or conflicts with other userspace processes.
-
Testing & Examples:
- Created example programs and tests that demonstrate typical GPIO use cases (e.g., reading a button, toggling an LED) within SplashKit applications.
📈 Strategic Contributions
-
Long-Term Development Planning:
- Proposed a roadmap for expanding hardware interfacing features in SplashKit, such as additional peripheral protocols (I²C, SPI) and platform abstraction layers.
-
Team Coordination & Documentation:
- Collaborated with the core maintainers to refine API designs, scope feature requirements, and document patterns for future contributors.
🧠 Impact
- Expanded SplashKit’s capability from purely graphical and multimedia functionality to include physical computing scenarios, broadening its educational applicability.
- Enabled users to write hardware-interactive programs in the same beginner-friendly SDK they use for game and application development.

