{"id":15043643,"url":"https://github.com/ktgpio/ktgpio","last_synced_at":"2025-04-14T23:11:38.703Z","repository":{"id":44470928,"uuid":"298858958","full_name":"ktgpio/ktgpio","owner":"ktgpio","description":"GPIO on a Raspberry Pi with Kotlin/Native","archived":false,"fork":false,"pushed_at":"2022-10-16T17:31:58.000Z","size":196,"stargazers_count":30,"open_issues_count":4,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-28T11:12:10.800Z","etag":null,"topics":["kotlin-native","raspberry-pi"],"latest_commit_sha":null,"homepage":"https://ktgp.io","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ktgpio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-26T16:50:56.000Z","updated_at":"2025-01-19T09:01:59.000Z","dependencies_parsed_at":"2022-07-16T11:00:30.638Z","dependency_job_id":null,"html_url":"https://github.com/ktgpio/ktgpio","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktgpio%2Fktgpio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktgpio%2Fktgpio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktgpio%2Fktgpio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktgpio%2Fktgpio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ktgpio","download_url":"https://codeload.github.com/ktgpio/ktgpio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975318,"owners_count":21192210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kotlin-native","raspberry-pi"],"created_at":"2024-09-24T20:49:22.584Z","updated_at":"2025-04-14T23:11:38.685Z","avatar_url":"https://github.com/ktgpio.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build](https://github.com/ktgpio/ktgpio/actions/workflows/build.yml/badge.svg)](https://github.com/ktgpio/ktgpio/actions/workflows/build.yml)\n[![Maven Central](https://img.shields.io/maven-central/v/io.ktgp/core)](https://search.maven.org/artifact/io.ktgp/core)\n\n# GPIO on a Raspberry Pi with Kotlin/Native\n\n## Getting started\n\n### Supported targets\n\n`ktgpio` only supports `arm64` and `armhf` linux targets. It was tested\nand is confirmed to work on\n[Raspberry Pi OS armhf](https://downloads.raspberrypi.org/raspios_armhf/)\nand [Raspberry Pi OS arm64](https://downloads.raspberrypi.org/raspios_arm64/).\n\nFor the list of supported hosts refer to Kotlin/Native\n[release notes](https://github.com/JetBrains/kotlin/blob/master/kotlin-native/RELEASE_NOTES.md#supported-platforms).\n\n### Target preparation\n\n`ktgpio` is dynamically linked with `libgpiod` and `libi2c`. If your target\nis running Raspberry Pi OS or any other Debian-like system install them by \nrunning\n\n```shell script\napt-get install libgpiod2 libi2c0 \n```\n\n### Using template repository\n\nThe easiest way to get started is creating repository from \n[ktgpio-samples](https://github.com/ktgpio/ktgpio-samples/generate)\ntemplate. Please note that build configuration there only supports\n`linux_arm32_hfp` and `linux_arm64` Raspberry Pi OS targets. If you\nare targeting different OS, make sure you're providing correct\n`libgpiod` and `libi2c` libraries to the build. Refer to\n[build.gradle.kts](https://github.com/ktgpio/ktgpio-samples/blob/main/build.gradle.kts)\nand [native-libs.gradle.kts](https://github.com/ktgpio/ktgpio-samples/blob/main/gradle/native-libs.gradle.kts)\nin the template repository for examples, and to the next section for details.\n\n### Starting from scratch\n\nHere is a minimal `build.gradle.kts` example:\n\n```kotlin\nplugins {\n  kotlin(\"multiplatform\") version \"1.7.20\"\n}\n\nrepositories {\n  mavenCentral()\n}\n\nkotlin {\n  val native = linuxArm32Hfp(\"native\")\n\n  sourceSets {\n    val commonMain by getting {\n      dependencies {\n        implementation(\"io.ktgp:core:0.0.9\")\n        implementation(kotlin(\"stdlib\"))\n      }\n    }\n  }\n\n  configure(listOf(native)) {\n    binaries.executable()\n  }\n}\n```\n\nApplications using `ktgpio` should be dynamically linked against\n`libgpiod` and `libi2c`. Make sure `.so` files for your target\narchitecture are visible to the linker. If you are cross-compiling,\nyou can manually copy them from your target machine and specify path\nto them using `linkerOpts` property of a `NativeBinary`:\n\n```kotlin\nbinaries.all {\n  linkerOpts.add(\"-Llibs/\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktgpio%2Fktgpio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fktgpio%2Fktgpio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktgpio%2Fktgpio/lists"}