{"id":51666363,"url":"https://github.com/iamnicknack/pjs","last_synced_at":"2026-07-14T21:00:42.009Z","repository":{"id":341228653,"uuid":"1143643695","full_name":"IAmNickNack/pjs","owner":"IAmNickNack","description":"A hardware abstraction layer for the Raspberry Pi and JVM","archived":false,"fork":false,"pushed_at":"2026-06-05T07:28:10.000Z","size":1096,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T08:16:42.011Z","etag":null,"topics":["grpc","http","java","kotlin","raspberry-pi","rest","rpi"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IAmNickNack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-27T20:41:55.000Z","updated_at":"2026-06-05T06:52:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/IAmNickNack/pjs","commit_stats":null,"previous_names":["iamnicknack/pjs"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/IAmNickNack/pjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmNickNack%2Fpjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmNickNack%2Fpjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmNickNack%2Fpjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmNickNack%2Fpjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IAmNickNack","download_url":"https://codeload.github.com/IAmNickNack/pjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAmNickNack%2Fpjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35478764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-14T02:00:06.603Z","response_time":114,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["grpc","http","java","kotlin","raspberry-pi","rest","rpi"],"created_at":"2026-07-14T21:00:20.767Z","updated_at":"2026-07-14T21:00:41.989Z","avatar_url":"https://github.com/IAmNickNack.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PJs\n\n\u003e Basic hardware abstractions for Raspberry Pi development on the JVM\n\nPJs (pronounced \"pee-jays\") is a hardware abstraction layer for the Raspberry Pi that runs on the JVM. \nIts core API is based on the premise that IO interactions essentially boil down to reading and writing \nnumbers.\n\nFor example:\n* Reading and writing to a GPIO pin is essentially a read or write of a binary value.\n* Reading and writing two pins simultaneously is essentially a read or write of a value between 0 and 3.\n* Read/write of more pins therefore becomes a read or write of an arbitrary number of bits which can be represented \n as a number.\n\nAPI design is hard. Every design decision is an expression of an opinion and an attempt to express to others \n your understanding of the problem domain. The more decisions you make, the more opinions you express, and the larger\n the risk surface becomes for disagreement and misunderstanding. As engineers, we are trained to avoid risk by reducing \n the risk surface. One way to do this in the context of API design is to state the fewest opinions possible. \n\nThe primary option stated the PJs APIs is that hardware interactions are predominantly read and write \n operations of one or many numbers and that it isn't too hard to express this via a handful of basic abstractions. \n\nWith this as a central premise, the PJs APIs aim to be as unopinionated as possible. Rather than attempting to provide\n a solution for an unknown number of use cases, they focus on providing a set of generic hardware abstractions that \n can be used as building blocks to solve use cases as they arise. \n\n\u003cimg src=\"docs/assets/model.png\" width=\"1024\" /\u003e\n\nThe core API includes specifications for two primary responsibilities:\n\n## Hardware Abstractions\n\nHardware abstractions (primarily `Port\u003c\u003e`, `Pin` and `SerialPort`) provide applications with access to hardware at \n runtime.\n\nApplications would typically use these abstractions to interact with hardware directly, without needing to be aware of\n the underlying implementation details. Application logic would be written against these abstractions rather than the \n underlying device adapters. \n\n* [PORTS.md](docs/PORTS.md) - An overview and example usage of the PJs `Port\u003c\u003e` and `Pin` abstractions.\n* [SERIAL.md](docs/SERIAL.md) - An overview and example usage of the PJs `SerialPort`, `SPI` and `I2C` abstractions.\n\n## Device Adapters\n\nDevice adapters implement the transport layer used by the hardware abstractions. They are responsible for managing \n any resources (such as file descriptors, HTTP or gRPC clients) and implementing the actual IO operations.\n\nApplications would typically only be aware of these specific types during construction when configuring \n access to hardware. Runtime references to these instances would be via the hardware abstractions they implement.  \n\nDevice adapters provided in this repository include:\n\n* [pjs-native-device](providers/pjs-native) - Adapters which communicate with hardware via Java FFM APIs\n* [pjs-mock-device](providers/pjs-mock-device) - Mock device adapters which can be used for testing\n* [pjs-grpc-device](providers/network/pjs-grpc) - Device adapters and server application which allows PJs to \ncommunicate with a remote Pi via gRPC\n* [pjs-http-device](providers/network/pjs-http) - Device adapters and server application which allows PJs to\n  communicate with a remote Pi via REST\n* [pjs-pi4j-device](providers/pjs-pi4j-device) - Device adapter which uses [Pi4J](https://www.pi4j.com) providers to \ncommunicate with hardware\n\n## Examples\n\nThe [pjs-sandbox](pjs-sandbox) module contains a number of examples that demonstrate how to use the PJs APIs, along\n with examples of PJs abstractions used to implement specific hardware devices.\n\nThe implemented devices currently include:\n* [pjs-hardware-25lc](pjs-sandbox/pjs-hardware-25lc) - A PJs SPI implementation for the 24LC64 EEPROM. \n* [pjs-hardware-mcp23x](pjs-sandbox/pjs-hardware-mcp23x) - PJs SPI and I2C implementations for the MCP23008/S08 port\n expander.\n* [pjs-hardware-sh1106](pjs-sandbox/pjs-hardware-sh1106) - A PJs I2C implementation for the SH1106 OLED display.\n\n[pjs-examples](pjs-sandbox/pjs-examples) contains a number of examples that demonstrate how to use the PJs APIs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamnicknack%2Fpjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamnicknack%2Fpjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamnicknack%2Fpjs/lists"}