mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:52:44 +01:00
pkg: u8g2: add u8g2 graphics library.
This commit is contained in:
parent
03d380845e
commit
6bb108c054
10
pkg/u8g2/Makefile
Normal file
10
pkg/u8g2/Makefile
Normal file
@ -0,0 +1,10 @@
|
||||
PKG_NAME=u8g2
|
||||
PKG_URL=https://github.com/olikraus/u8g2
|
||||
PKG_VERSION=94dacdb84e06a6088b9d17a1e7ba009dbd3618be
|
||||
|
||||
.PHONY: all
|
||||
|
||||
all: git-download
|
||||
"$(MAKE)" -C $(PKG_BUILDDIR)
|
||||
|
||||
include $(RIOTBASE)/pkg/pkg.mk
|
6
pkg/u8g2/Makefile.include
Normal file
6
pkg/u8g2/Makefile.include
Normal file
@ -0,0 +1,6 @@
|
||||
INCLUDES += -I$(BINDIRBASE)/pkg/$(BOARD)/u8g2/csrc
|
||||
|
||||
# Link SDL if enabled.
|
||||
ifneq (,$(filter u8g2_sdl,$(USEMODULE)))
|
||||
LINKFLAGS += `sdl-config --libs`
|
||||
endif
|
28
pkg/u8g2/README.md
Normal file
28
pkg/u8g2/README.md
Normal file
@ -0,0 +1,28 @@
|
||||
# U8g2
|
||||
|
||||
## Introduction
|
||||
[U8g2](https://github.com/olikraus/u8g2) is a monochrome graphics library for LCDs and OLEDs. It contains both drivers and high-level drawing routines.
|
||||
|
||||
The library is originally written for Arduino's, but it runs fine on other platforms if the right drivers are available.
|
||||
|
||||
## Usage
|
||||
Just put `USEPKG += u8g2` in your Makefile and `#include "u8g.h"` to your code.
|
||||
|
||||
## API
|
||||
This package patches the original source to add an interface for RIOT-OS peripherals and removing most of the device/platform specific code.
|
||||
|
||||
The following two interfaces add add support for the included drivers via I2C and SPI peripherals:
|
||||
|
||||
* `u8g_com_riotos_hw_spi_init` — Interface for U8g2 included SPI displays.
|
||||
* `u8g_com_riotos_ssd_i2c_init` — Interface for U8g2 included I2C SSD displays.
|
||||
|
||||
In addition, the following three drivers are general-purpose interfaces to write your own display driver:
|
||||
|
||||
* `u8g_com_riotos_i2c_init` — Generic I2C display driver interface.
|
||||
* `u8g_com_riotos_spi_init` — Generic SPI display driver interface.
|
||||
* `u8g_com_riotos_init` — General-purpose interface that accepts a void pointer argument.
|
||||
|
||||
For targets without an I2C or SPI, the following two interfaces emulate a display:
|
||||
|
||||
* `u8g_dev_riotos_stdout_init` — Virtual display via stdout.
|
||||
* `u8g_dev_riotos_stdout_ansi_init` — Virtual display via stdout using ANSI control characters.
|
BIN
pkg/u8g2/patches/0001-u8g2-add-riot-os-makefiles.patch
Normal file
BIN
pkg/u8g2/patches/0001-u8g2-add-riot-os-makefiles.patch
Normal file
Binary file not shown.
BIN
pkg/u8g2/patches/0002-u8g2-add-riot-os-interface.patch
Normal file
BIN
pkg/u8g2/patches/0002-u8g2-add-riot-os-interface.patch
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user