diff options
| author | Leon Anavi <leon.anavi@konsulko.com> | 2024-01-02 20:54:10 +0200 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-01-02 11:09:07 -0800 |
| commit | 13a1b1b1a56b41d23933ee5113a338ad5e5156fc (patch) | |
| tree | 6a931f5c9c551112d1f3799f8d2cfdbd4f65fce1 | |
| parent | 231c8bd2642ccbbcff799660a6bc8d455730494c (diff) | |
| download | meta-openembedded-13a1b1b1a56b41d23933ee5113a338ad5e5156fc.tar.gz | |
ssd1306_git.bb: Add ssd1306_linux
Add ssd1306_linux, a simple OLED I2C SSD1306 Linux driver based on
the i2c library libi2c from i2c-tools. Example usage for a
compatible display with resolution 128x64 pixels:
ssd1306_bin -n 1 -I 128x64
ssd1306_bin -n 1 -c
ssd1306_bin -n 1 -r 0
ssd1306_bin -n 1 -x 1 -y 1
ssd1306_bin -n 1 -l "Hello World"
Pending GitHub pull request to the upstream of the project:
https://github.com/armlabs/ssd1306_linux/pull/4
After fixing the upstream 0001-Use-include-filename.patch should
be removed from the recipe.
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch | 49 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb | 25 |
2 files changed, 74 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch b/meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch new file mode 100644 index 0000000000..dfe48175a7 --- /dev/null +++ b/meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | From cb32ebbb1efb3202808809861ec3cbd811c55bd2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Leon Anavi <leon.anavi@konsulko.com> | ||
| 3 | Date: Sat, 30 Dec 2023 13:23:31 +0000 | ||
| 4 | Subject: [PATCH] Use include "filename" | ||
| 5 | |||
| 6 | Use include "filename" to include programmer-defined header files | ||
| 7 | from the same directory as the file containing the directive. | ||
| 8 | |||
| 9 | Upstream-Status: Submitted [https://github.com/armlabs/ssd1306_linux/pull/4] | ||
| 10 | |||
| 11 | Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> | ||
| 12 | --- | ||
| 13 | main.c | 2 +- | ||
| 14 | ssd1306.c | 6 +++--- | ||
| 15 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/main.c b/main.c | ||
| 18 | index c1ffc2f..18e2b84 100644 | ||
| 19 | --- a/main.c | ||
| 20 | +++ b/main.c | ||
| 21 | @@ -6,7 +6,7 @@ | ||
| 22 | #include <string.h> | ||
| 23 | #include <fcntl.h> | ||
| 24 | #include <sys/ioctl.h> | ||
| 25 | -#include <ssd1306.h> | ||
| 26 | +#include "ssd1306.h" | ||
| 27 | |||
| 28 | void print_help() | ||
| 29 | { | ||
| 30 | diff --git a/ssd1306.c b/ssd1306.c | ||
| 31 | index a03674a..2e6ba97 100644 | ||
| 32 | --- a/ssd1306.c | ||
| 33 | +++ b/ssd1306.c | ||
| 34 | @@ -8,9 +8,9 @@ | ||
| 35 | #include <string.h> | ||
| 36 | #include <fcntl.h> | ||
| 37 | #include <sys/ioctl.h> | ||
| 38 | -#include <linux_i2c.h> | ||
| 39 | -#include <ssd1306.h> | ||
| 40 | -#include <font.h> | ||
| 41 | +#include "linux_i2c.h" | ||
| 42 | +#include "ssd1306.h" | ||
| 43 | +#include "font.h" | ||
| 44 | |||
| 45 | const char init_oled_type_file[] = "/tmp/.ssd1306_oled_type"; | ||
| 46 | |||
| 47 | -- | ||
| 48 | 2.39.2 | ||
| 49 | |||
diff --git a/meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb b/meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb new file mode 100644 index 0000000000..5adfd3ed68 --- /dev/null +++ b/meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | SUMMARY="SSD1306 OLED I2C drive" | ||
| 2 | DESCRIPTION = "SSD1306 OLED I2C driver working in Linux" | ||
| 3 | HOMEPAGE = "https://github.com/armlabs/ssd1306_linux" | ||
| 4 | SECTION = "console/utils" | ||
| 5 | LICENSE = "MIT" | ||
| 6 | |||
| 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=7b694e603a996c3bfdc6093ed1f70c8f" | ||
| 8 | |||
| 9 | SRC_URI = " \ | ||
| 10 | git://github.com/armlabs/ssd1306_linux.git;protocol=https;branch=master \ | ||
| 11 | file://0001-Use-include-filename.patch \ | ||
| 12 | " | ||
| 13 | SRCREV = "7375f1088732d243f7167c9a17725f1a860da587" | ||
| 14 | |||
| 15 | S = "${WORKDIR}/git" | ||
| 16 | |||
| 17 | # coreutils provides fmt which is used in the Makefile | ||
| 18 | DEPENDS = "i2c-tools coreutils-native" | ||
| 19 | |||
| 20 | EXTRA_OEMAKE = "CC='${CC}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'" | ||
| 21 | |||
| 22 | do_install() { | ||
| 23 | install -d ${D}${bindir} | ||
| 24 | install -m 0755 ${B}/ssd1306_bin ${D}${bindir} | ||
| 25 | } | ||
