{"id":15197199,"url":"https://github.com/ribasco/ucgdisplay","last_synced_at":"2026-01-14T01:51:25.811Z","repository":{"id":48299926,"uuid":"102100878","full_name":"ribasco/ucgdisplay","owner":"ribasco","description":"A character/graphics lcd library for single board computers (e.g. Raspberry Pi) written in Java. Provides drivers for graphics monochrome display devices (lcd, oled, e-ink etc) powered by U8g2","archived":true,"fork":false,"pushed_at":"2021-08-02T17:00:40.000Z","size":84158,"stargazers_count":14,"open_issues_count":3,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-02T13:42:12.404Z","etag":null,"topics":["8-bit","arm","display","e-ink","embedded-systems","glcd","graphics","hd44780","i2c","iot","java","lcd","library","oled","parallel","raspberry-pi","single-board-computers","spi","u8g2"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ribasco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-01T10:10:34.000Z","updated_at":"2024-07-01T06:21:51.000Z","dependencies_parsed_at":"2022-09-08T04:50:21.212Z","dependency_job_id":null,"html_url":"https://github.com/ribasco/ucgdisplay","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/ribasco/ucgdisplay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribasco%2Fucgdisplay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribasco%2Fucgdisplay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribasco%2Fucgdisplay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribasco%2Fucgdisplay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ribasco","download_url":"https://codeload.github.com/ribasco/ucgdisplay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribasco%2Fucgdisplay/sbom","scorecard":{"id":774758,"data":{"date":"2025-08-11","repo":{"name":"github.com/ribasco/ucgdisplay","commit":"598ba4da7f464d9492414a29d8567612e939dafe"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ucgd-main.yml:1","Warn: no topLevel permission defined: .github/workflows/ucgd-release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ucgd-main.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/ribasco/ucgdisplay/ucgd-main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ucgd-main.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/ribasco/ucgdisplay/ucgd-main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ucgd-main.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/ribasco/ucgdisplay/ucgd-main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ucgd-release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/ribasco/ucgdisplay/ucgd-release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ucgd-release.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/ribasco/ucgdisplay/ucgd-release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ucgd-release.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/ribasco/ucgdisplay/ucgd-release.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v3.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-5v34-g2px-j4fw","Warn: Project is vulnerable to: GHSA-q5r4-cfpx-h6fh","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T03:14:44.511Z","repository_id":48299926,"created_at":"2025-08-23T03:14:44.511Z","updated_at":"2025-08-23T03:14:44.511Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["8-bit","arm","display","e-ink","embedded-systems","glcd","graphics","hd44780","i2c","iot","java","lcd","library","oled","parallel","raspberry-pi","single-board-computers","spi","u8g2"],"created_at":"2024-09-28T00:45:01.259Z","updated_at":"2026-01-14T01:51:25.779Z","avatar_url":"https://github.com/ribasco.png","language":"C","readme":"### Universal Character/Graphics LCD Library for Java\n\n[![Github Workflow Build Status](https://github.com/ribasco/ucgdisplay/workflows/CI%20/%20Testing%20/%20Deployment/badge.svg)](https://github.com/ribasco/ucgdisplay/actions?query=branch%3Amaster) [![Release Deployment](https://github.com/ribasco/ucgdisplay/actions/workflows/ucgd-release.yml/badge.svg)](https://github.com/ribasco/ucgdisplay/actions/workflows/ucgd-release.yml) [![Maven Central](https://img.shields.io/maven-central/v/com.ibasco.ucgdisplay/ucg-display.svg?label=Maven%20Central)](https://search.maven.org/search?q=com.ibasco.ucgdisplay) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/4209cfcd33eb4f98a6e1d16414804d45)](https://app.codacy.com/app/ribasco/ucgdisplay?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=ribasco/ucgdisplay\u0026utm_campaign=Badge_Grade_Dashboard) [![Javadocs](https://www.javadoc.io/badge/com.ibasco.ucgdisplay/ucg-display.svg)](https://www.javadoc.io/doc/com.ibasco.ucgdisplay/ucg-display)\n\n### Change Log\n**3.0.0 (04/30/2021)**\n\n- Modularized project (for jdk 11 above)\n- Dropped input and character display modules\n- Removed travis ci script.\n\n**2.0.0-alpha (07/04/2020)**\n- Added drawPixels() and drawPixelsBgra() method\n- Added setPrimaryColor and setSecondaryColor methods in native class\n- Added direct native access for BGRA buffers. \n- Added GlcdInterfaceLookup utility class to provide additional information about a communication protocol \n- New meta data information for fonts\n- Renamed GlcdBufferType to GlcdBufferLayout\n- Renamed GlcdBusInterface to GlcdCommProtocol\n- Renamed GlcdBusType to GlcdCommType\n- Renamed GlcdControllerType to GlcdController\n- Apply alpha blending for primary and secondary colors in virtual mode\n\n**1.5.2-alpha (11/23/2019)** \n\n- Fixed missing dependencies in the aggregate jar\n\n**1.5.1-alpha (11/22/2019)**\n\n- Fixed 'symbol lookup error' (Issue: [#22](https://github.com/ribasco/ucgdisplay/issues/22))\n- Added support for multiple I/O peripheral providers ([libgpiod](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/), [pigpiod](https://github.com/joan2937/pigpio), [c-periphery](https://github.com/vsergeev/c-periphery)) (Issue [#24](https://github.com/ribasco/ucgdisplay/issues/24))\n- 64 bit architectures are now fully supported for ARM and x86. Note that 32 bit support for OSX platform may be removed in the future versions.\n- Added native logging capability for improved traceability (all native logging is routed to SLF4J)\n- On Raspberry Pi platforms, GPIO pins are now automatically configured internally by the native library.\n- API changes on [GlcdConfigBuilder](https://github.com/ribasco/ucgdisplay/blob/master/drivers/glcd/src/main/java/com/ibasco/ucgdisplay/drivers/glcd/GlcdConfigBuilder.java). \n\n### Features\n\n---\n\n##### General features\n\n* Supports Graphics/Dot-Matrix display devices\n* Support for multiple I/O peripheral providers\n   * [Libgpiod](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/)\n   * [Pigpio](https://github.com/joan2937/pigpio) (Daemon or Standalone)\n   * [C-Periphery](https://github.com/vsergeev/c-periphery) (Based on the linux kernel)\n* Provides native bindings (via JNI) to the U8g2 library for graphics displays.\n* Provides a virtual driver interface allowing u8g2 native operations to be accessed in java. Useful for apps that needs to simulate u8g2 draw operations without the need for a real display device.\n\n##### Display drivers\n\n###### Graphic LCD driver features\n\n* SPI and I2C hardware capability and other software bit-banging implementations\n* Over 46+ controllers are supported. Refer to the table below for the list of supported display controllers.\n* The graphics display module wraps around the popular c/c++ [U8g2](https://github.com/olikraus/u8g2) library by Oliver. All drawing operations present in the library should be similar to the ones found in U8g2 (Refer to the official [U8g2 reference manual](https://github.com/olikraus/u8g2/wiki/u8g2reference) for more information).\n\n### Supported display controllers\n\n---\n###### Graphic/Dot-Matrix LCD\n\n* A2PRINTER, HX1230, IL3820, IST3020, KS0108, LC7981, LD7032, LS013B7DH03, LS027B7DH01, MAX7219, NT7534, PCD8544, PCF8812, RA8835, SBN1661, SED1330, SED1520, SH1106, SH1107, SH1108, SH1122, SSD1305, SSD1306, SSD1309, SSD1317, SSD1322, SSD1325, SSD1326, SSD1327, SSD1329, SSD1606, SSD1607, ST75256, ST7565, ST7567, ST7586S, ST7588, ST7920, T6963, UC1601, UC1604, UC1608, UC1610, UC1611, UC1638, UC1701\n\n### Supported bus interfaces (GLCD)\n\n| Interface     | Type              | Description                                                                       | Hardware | Software |\n|---------------|-------------------|-----------------------------------------------------------------------------------|----------|----------|\n| SPI           | 4-Wire            | 4-Wire interface                                                                  | YES      | YES      |\n| SPI           | 4-Wire (ST7920)   | 4-Wire interface with no DC                                                       | YES      | YES      |\n| SPI           | 3-Wire            | 3-Wire interface                                                                  | NO       | YES      |\n| I2C           | Two-Wire          | I2C Two-Wire interface                                                            | YES      | YES      |\n| Parallel 8080 | Parallel          | Parallel 8080 (Intel)                                                             | NO       | YES      |\n| Parallel 6800 | Parallel          | Parallel 6800 (Motorola)                                                          | NO       | YES      |\n| Parallel 6800 | Parallel (KS0108) | Special KS0108 protocol. Mostly identical to 6800, but has more chip select lines | NO       | YES      |\n| SED1520       | SED1520           | Special SED1520 protocol                                                          | NO       | YES      |\n\n\n### Project Resources\n\n---\n* [Snapshot Builds](https://oss.sonatype.org/content/repositories/snapshots/com/ibasco/ucgdisplay/) - Builds from the latest development branch\n* [Release Builds](https://oss.sonatype.org/content/repositories/releases/com/ibasco/ucgdisplay) - All release builds\n\n### Pre-requisites\n\n---\n* Java JDK 11+ (See [AdoptOpenJDK](https://adoptopenjdk.net/))\n* (Optional) [Libgpiod](https://github.com/brgl/libgpiod) (v1.4.1 or higher) - C library and tools for interacting with the linux GPIO character device (gpiod stands for GPIO device).\n* (Optional) [Pigpio](https://github.com/joan2937/pigpio) (v71 above) - pigpio is a C library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO). \n\n\u003e **IMPORTANT:** For libgpiod, make sure the c++ bindings are included when you install from source (--enable-bindings-cxx)\n\n### Downloading Snapshots from Sonatype\n\n---\n\nTo be able to download snapshots from Sonatype, add the following profile entry to your `.m2/settings.xml` file and activate with  `mvn -P sonatype install \u003c....\u003e`.\n\n```xml\n\u003cprofile\u003e\n    \u003cid\u003esonatype\u003c/id\u003e\n    \u003crepositories\u003e\n        \u003crepository\u003e\n            \u003cid\u003eossrh\u003c/id\u003e\n            \u003cname\u003eSonatype OSS Maven Repository\u003c/name\u003e\n            \u003curl\u003ehttps://oss.sonatype.org/content/groups/public\u003c/url\u003e\n            \u003csnapshots\u003e\n                \u003cenabled\u003etrue\u003c/enabled\u003e\n                \u003cupdatePolicy\u003ealways\u003c/updatePolicy\u003e\n                \u003cchecksumPolicy\u003efail\u003c/checksumPolicy\u003e\n            \u003c/snapshots\u003e\n        \u003c/repository\u003e\n    \u003c/repositories\u003e\n\u003c/profile\u003e\n```\n\n### Installation\n\n---\n\n\n1. From maven repository - All in one package\n\n    ```xml\n    \u003cdependencies\u003e\n        \u003c!-- Ucgdisplay Uber Jar --\u003e\n         \u003cdependency\u003e\n             \u003cgroupId\u003ecom.ibasco.ucgdisplay\u003c/groupId\u003e\n             \u003cartifactId\u003eucg-display\u003c/artifactId\u003e\n             \u003cversion\u003e3.0.1\u003c/version\u003e\n         \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n    ```\n    \n    \n    \n2. From maven repository - Specific module\n\n    ```xml\n    \u003cdependencies\u003e\n         \u003c!-- Graphics display driver --\u003e\n         \u003cdependency\u003e\n             \u003cgroupId\u003ecom.ibasco.ucgdisplay\u003c/groupId\u003e\n             \u003cartifactId\u003eucgd-drivers-glcd\u003c/artifactId\u003e\n             \u003cversion\u003e3.0.1\u003c/version\u003e\n         \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n    ```\n\n3. From source\n\n    Clone from Github (Sub-modules included)\n\n    ```bash\n    git clone --recurse-submodules -j4 https://github.com/ribasco/ucgdisplay.git\n    ```\n\n    Switch to the project directory\n\n    ```bash\n    cd ucgdisplay\n    ```\n\n    Install to your local maven repository\n\n    * Installing from a Linux system with ARM 32/64 bit architecture\n      \n        ```bash\n        mvn install -Dcompile.native=true\n        ```\n\n    * Installing from a 64-bit `Linux` system for `ARM` architecture 32 and 64 bit versions\n\n        ```bash\n        mvn install -Dcompile.native=true -Dgraphics.target=native-build-cc-arm-all -Dinput.target=native-build-cc-arm-all -Dbuild.type=Debug\n        ```\n      \n    * Installing from a 64-bit `Linux` system for all supported architectures\n\n        ```bash\n        mvn install -Dcompile.native=true -Dgraphics.target=native-build-cc-all -Dinput.target=native-build-cc-all -Dbuild.type=Debug\n        ```\n\n    \u003e **Note:** Please see the [cross-compilation guide](https://github.com/ribasco/ucgdisplay/tree/master/native) for more details\n\n### Usage examples\n\n---\nSimple hello world examples\n\n######  Graphic LCD Example (ST7920 SPI Hardware)\n\nExample for`ST7920` display controller using RPi's SPI Hardware capability ([Other Examples](https://github.com/ribasco/ucgdisplay/blob/master/examples/drivers/glcd/src/main/java/com/ibasco/ucgdisplay/examples/glcd/GlcdST7920HWExample.java)).\n\n\u003e  **Note:** For I2C/SPI hardware capability, there is no need to map the pins explicitly. \n\n\n```java\nimport com.ibasco.ucgdisplay.drivers.glcd.*;\nimport com.ibasco.ucgdisplay.drivers.glcd.enums.*;\nimport com.ibasco.ucgdisplay.drivers.glcd.utils.XBMData;\nimport com.ibasco.ucgdisplay.drivers.glcd.utils.XBMUtils;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.time.Duration;\nimport java.util.Objects;\n\n/**\n * ST7920 Example - Hardware SPI\n */\npublic class GlcdST7920HWExample {\n\n    private static final Logger log = LoggerFactory.getLogger(GlcdST7920HWExample.class);\n\n    public static void main(String[] args) throws Exception {\n        new GlcdST7920HWExample().run();\n    }\n\n    private void run() throws Exception {\n        //SPI HW 4-Wire config for ST7920\n\n        //NOTE: On Raspberry Pi, pins can be automatically configured for hardware \t\t   capability (setting pin modes to ALT*).\n        //Automatic pin configuration for special modes will only take place if PIGPIO is installed\n\n        //Pinout for Main SPI Peripheral \n        // - MOSI = 10\n        // - SCLK = 11\n        // - CE1 = 7\n        GlcdConfig config = GlcdConfigBuilder\n                //Use ST7920 - 128 x 64 display, SPI 4-wire Hardware\n                .create(Glcd.ST7920.D_128x64, GlcdBusInterface.SPI_HW_4WIRE_ST7920)\n                //Set to 180 rotation\n                .option(GlcdOption.ROTATION, GlcdRotation.ROTATION_180)\n                //Using system/c-periphery provider\n                .option(GlcdOption.PROVIDER, Provider.SYSTEM)\n                //Set to 1,000,000 Hz/bps (1.00 MHz)\n                .option(GlcdOption.BUS_SPEED, 1000000)\n                //The SPI Bus (RPI as two SPI buses available, the Main and Auxillary)\n                .option(GlcdOption.SPI_BUS, SpiBus.MAIN)\n                //Use CE1 or Chip Select 1 on Main SPI peripheral/bus\n                .option(GlcdOption.SPI_CHANNEL, SpiChannel.CHANNEL_1)\n                .build();\n\n        GlcdDriver driver = new GlcdDriver(config);\n\n        //Clear the GLCD buffer\n        driver.clearBuffer();\n\n        //Write Operations to the GLCD buffer\n        driver.setFont(GlcdFont.FONT_6X12_MR);\n        driver.drawString(10, 10, \"Hello World\");\n            \n        //Send all buffered data to the display\n        driver.sendBuffer();\n\n        //Clear the display\n        driver.clearDisplay();\n    }\n}\n\n```\n\n###### Graphic LCD Example (ST7920 SPI Software)\n\nHere is an alternative version of the above example using bit-bang method.  ([Other Examples](https://github.com/ribasco/ucgdisplay/blob/master/examples/drivers/glcd/src/main/java/com/ibasco/ucgdisplay/examples/glcd/GlcdST7920SWExample.java))\n\n\u003e  **Note:** This is slower than SPI Hardware\n\n```java\nimport com.ibasco.ucgdisplay.drivers.glcd.*;\nimport com.ibasco.ucgdisplay.drivers.glcd.enums.*;\nimport com.ibasco.ucgdisplay.drivers.glcd.utils.XBMData;\nimport com.ibasco.ucgdisplay.drivers.glcd.utils.XBMUtils;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.time.Duration;\nimport java.util.Objects;\n\n/**\n * ST7920 Example - SPI Software Bit-Bang.\n *\n * Note: This is ALOT slower than SPI HW\n */\npublic class GlcdST7920SWExample {\n\n    private static final Logger log = LoggerFactory.getLogger(GlcdST7920SWExample.class);\n\n    public static void main(String[] args) throws Exception {\n        new GlcdST7920SWExample().run();\n    }\n\n    private void run() throws Exception {\n        //SPI Software config for ST7920\n\n        //NOTE: For software/bit-bang implementation, pin modes will be automatically configured to OUTPUT by the native module\n\n        //Pinout for Main SPI Peripheral \n        // - MOSI = 10\n        // - SCLK = 11\n        // - CE1 = 7\n        GlcdConfig config = GlcdConfigBuilder\n                //Use ST7920 - 128 x 64 display, SPI Software implementation\n                .create(Glcd.ST7920.D_128x64, GlcdBusInterface.SPI_SW_4WIRE_ST7920)\n                //Set to 180 rotation\n                .option(GlcdOption.ROTATION, GlcdRotation.ROTATION_180)\n                //Using system/c-periphery provider\n                .option(GlcdOption.PROVIDER, Provider.SYSTEM)\n                //Map GlcdPin to BCM pin number\n                .mapPin(GlcdPin.SPI_MOSI, 10)\n                .mapPin(GlcdPin.SPI_CLOCK, 11)\n                .mapPin(GlcdPin.CS, 7)\n                .build();\n\n        GlcdDriver driver = new GlcdDriver(config);\n\n        //Clear the GLCD buffer\n        driver.clearBuffer();\n\n        //Write Operations to the GLCD buffer\n        driver.setFont(GlcdFont.FONT_6X12_MR);\n        driver.drawString(10, 10, \"Hello World\");\n            \n        //Send all buffered data to the display\n        driver.sendBuffer();\n    }\n}\n```\n\n###### Configuration options (All available options in GlcdOption enum)\n\n| Option Name        | Raw Type | **Enum**                                                     | **Description**                                              | **Category** |\n| ------------------ | -------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------ |\n| PROVIDER           | String   | [Provider](https://github.com/ribasco/ucgdisplay/blob/master/drivers/glcd/src/main/java/com/ibasco/ucgdisplay/drivers/glcd/enums/Provider.java) | The default provider to use for communicating with the display. Available providers are `libgpiod`, `pigpio`, `pigpiod` and `cperiphery`. | General      |\n| BUS_SPEED          | Integer  | N/A                                                          | The SPI/I2C bus speed in Hz                                  | SPI/I2C      |\n| GPIO_CHIP          | Integer  | [GpioChip](https://github.com/ribasco/ucgdisplay/blob/master/drivers/glcd/src/main/java/com/ibasco/ucgdisplay/drivers/glcd/enums/GpioChip.java) | GPIO chip number. Will be translated to the actual GPIO device path. | GPIO         |\n| SPI_CHANNEL        | Integer  | [SpiChannel](https://github.com/ribasco/ucgdisplay/blob/master/drivers/glcd/src/main/java/com/ibasco/ucgdisplay/drivers/glcd/enums/SpiChannel.java) | The SPI channel (Chip-Select). In raspberry pi, we have `CE0 `and `CE1` for Main SPI and `CE0`, `CE1`, `CE2` for Auxiliary. | SPI          |\n| SPI_BUS            | Integer  | [SpiBus](https://github.com/ribasco/ucgdisplay/blob/master/drivers/glcd/src/main/java/com/ibasco/ucgdisplay/drivers/glcd/enums/SpiBus.java) | The primary bus to be used for SPI communication. In raspberry pi, there are two SPI peripherals available, the main and the auxillary. | SPI          |\n| SPI_MODE           | Integer  | [SpiMode](https://github.com/ribasco/ucgdisplay/blob/master/drivers/glcd/src/main/java/com/ibasco/ucgdisplay/drivers/glcd/enums/SpiMode.java) | SPI mode. Mode 0, 1, 2 or 3. Check source documentation for more info. (Default: 0) | SPI          |\n| SPI_BIT_ORDER      | Integer  | [SpiBitOrder](https://github.com/ribasco/ucgdisplay/blob/master/drivers/glcd/src/main/java/com/ibasco/ucgdisplay/drivers/glcd/enums/SpiBitOrder.java) | SPI Bit Order. Can be either 0 = `MSB First` or 1 = `LSB First`. (Default: 0) | SPI          |\n| SPI_BITS_PER_WORD  | Integer  | N/A                                                          | SPI Bits per word. (Default: 8)                              | SPI          |\n| SPI_FLAGS          | Integer  | N/A                                                          | Provider specific SPI flags. Only use this if you know what you are doing. Read more information on the provider's website (Default: 0). | SPI          |\n| I2C_DEVICE_ADDRESS | Integer  | N/A                                                          | The address of the display device on the I2C bus.            | I2C          |\n| I2C_BUS            | Integer  | [I2CBus](https://github.com/ribasco/ucgdisplay/blob/master/drivers/glcd/src/main/java/com/ibasco/ucgdisplay/drivers/glcd/enums/I2CBus.java) | The primary bus to be used for I2C communication.            | I2C          |\n| I2C_FLAGS          | Integer  | N/A                                                          | Provider specific I2C flags.                                 | I2C          |\n| ROTATION           | Integer  | [GlcdRotation](https://github.com/ribasco/ucgdisplay/blob/master/drivers/glcd/src/main/java/com/ibasco/ucgdisplay/drivers/glcd/enums/GlcdRotation.java) | The default rotation to set for the display.                 | General      |\n| PIGPIO_ADDRESS     | String   | N/A                                                          | The IP address of the pigpio daemon. (Default: 127.0.0.1)    | General      |\n| PIGPIO_PORT        | Integer  | N/A                                                          | The port number of the pigpio daemon. (Default: 8888)        | General      |\n| EXTRA_DEBUG_INFO   | Boolean  | N/A                                                          | Enable/Disable extra debug information to be displayed on the console (Default: false) | General      |\n\n### Limitations\n\n---\n* Works only on linux kernel v4.8 or higher\n* The adapters for character lcd driver `Mcp23008LcdAdapter` and `Pcf8574TLcdAdapter` are not yet implemented. \n* Due to lack of hardware availability, I am currently unable to test the `SPI`, `I2C` and bit-bang interfaces for most of the display controllers. The code implementation for these interfaces are complete, so In theory, they should work but it not confirmed. I am going to rely on your feedback for this and I will do my best to support any issues you may encounter.\n\n### Cross-Compilation Guide (for the Virtual driver interface)\n\n---\nContributions are always welcome. For starters, checkout the guide to setting up your Dev/Build environment for more information.\n\n* [Cross-compilation guide](https://github.com/ribasco/ucgdisplay/blob/master/native/README.md) \n\n### Planned Features\n\n- For the Character LCD library, I plan to move away from Pi4J (v1.2 still using Wiring Pi which is now deprecated) and use the native layer instead for device communication. This will allow us to use different peripheral providers of our choice. \n\n### Credits\n\n- [olikraus](https://github.com/olikraus) - Project maintainer of [u8g2](https://github.com/olikraus/u8g2)\n- [vsergeev](https://github.com/vsergeev) - Project maintainer of [c-periphery](https://github.com/vsergeev/c-periphery)\n- [joan2937](https://github.com/joan2937) - Project maintainer of [pigpio](https://github.com/joan2937/pigpio)\n- [brgl](https://github.com/brgl) - Project maintainer of [libgpiod](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/)\n\n### Related projects\n\n---\n* [GLCD Simulator Project](https://github.com/ribasco/glcd-emulator)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fribasco%2Fucgdisplay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fribasco%2Fucgdisplay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fribasco%2Fucgdisplay/lists"}