# u8g2-arm-linux
**Repository Path**: powes/u8g2-arm-linux
## Basic Information
- **Project Name**: u8g2-arm-linux
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-12-26
- **Last Updated**: 2025-12-26
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# U8g2 for arm-linux
[](https://circleci.com/gh/wuhanstudio/u8g2-arm-linux)
## Quick Start
```
$ git clone --recursive https://github.com/wuhanstudio/u8g2-arm-linux.git
$ cd u8g2-arm-linux
# Build source with GPIO character device
$ make CPPFLAGS=-DPERIPHERY_GPIO_CDEV_SUPPORT=1 CC=gcc CXX=g++
# Build source with GPIO sysfs (legacy)
$ make CC=gcc CXX=g++
$ ls bin/
```
Check wiki [here](https://github.com/wuhanstudio/u8g2-arm-linux/wiki) for the kernel set up.
- [U8g2 for arm-linux](#u8g2-for-arm-linux)
- [Introduction](#introduction)
- [Todo list](#todo-list)
- [Gallery](#gallery)
- [How to compile](#how-to-compile)
- [Run Examples](#run-examples)
## Introduction
U8g2 is a monochrome graphics library for embedded devices, and I ported it onto arm linux.
It should work fine on virtually all devices running linux with i2c, spi support, since no libraries pertaining to specific platforms has been used, yet you need to choose right compilers for your devices.
## Todo list
[●] Hardware I2C
[●] Hardware SPI
[●] Software I2C
[●] Software SPI
[●] 8080 mode
[●] Add C++ wrapper
[●] Faster GPIO by tracking fd
[●] Better build system
[●] Upstream the port
[●] Replace sysfs with gpiod
[ ] Benchmark
## Gallery
Nanopi
[http://wiki.friendlyarm.com/wiki/index.php/NanoPi](http://wiki.friendlyarm.com/wiki/index.php/NanoPi)
Nanopi NEO
[http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO](http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO)
Raspberry Pi ZERO
[https://www.raspberrypi.org/products/raspberry-pi-zero/](https://www.raspberrypi.org/products/raspberry-pi-zero/)
Raspberry Pi 2 B+
[https://www.raspberrypi.org/products/raspberry-pi-2-model-b/](https://www.raspberrypi.org/products/raspberry-pi-2-model-b/)
Orange Pi ZERO
[http://www.orangepi.org/orangepizero/](http://www.orangepi.org/orangepizero/)
Lichee Pi NANO
[http://nano.lichee.pro/](http://nano.lichee.pro/)
C-SKY
[https://c-sky.github.io/docs/gx6605s.html](https://c-sky.github.io/docs/gx6605s.html)
## How to compile
First, clone this repo:
```
$ git clone --recursive https://github.com/wuhanstudio/u8g2-arm-linux.git
$ cd u8g2-arm-linux
```
Change the cross-compiler according to your board.
# Chosse proper compiler for your PI
# NanoPi: arm-linux-gnueabi-gcc
# Raspberry Pi Zero: arm-linux-gnueabi-gcc
# Raspberry Pi 2: arm-linux-gnueabihf-gcc
# OrangePi Zero: arm-linux-gnueabihf-gcc
# NanoPi NEO: arm-linux-gnueabihf-gcc
# NanoPi NEO Plus 2: arm-linux-gnueabihf-gcc
# C-SKY: csky-linux-gcc
CC = arm-linux-gnueabihf-gcc
For cross-compile:
arm-linux-gnueabi-gcc for armv6
arm-linux-gnueabihf-gcc for armv7
For native-compile (compile on your board), simply use:
CC = gcc
Finally, time to compile:
```
# Build source with GPIO character device
$ make CPPFLAGS=-DPERIPHERY_GPIO_CDEV_SUPPORT=1 CC=gcc CXX=g++
# Build source with GPIO sysfs (legacy)
$ make CC=gcc CXX=g++
```
## Run Examples
Before running, you can check your I2C devices using i2c-tools:
```
$ sudo apt-get install i2c-tools
```
List your devices:
```
$ ls /dev/i2c*
/dev/i2c-0 /dev/i2c-1
```
Probe your devices on bus 1:
```
$ i2cdetect -y -r 1
```
For cross-compile, you can change ip address in Makefile:
# IP Address of your PI
PI=pi@10.1.1.232
Then upload generated binary file onto your board:
```
$ make upload
```
## Related Projects
- U8g2: https://github.com/olikraus/u8g2
- U8glib: https://github.com/olikraus/u8glib
## Contact
* Author:Han Wu
* Homepage:http://wuhanstudio.cc
* Contact:https://github.com/wuhanstudio/u8g2-arm-linux/issues