diff mbox series

[meta-oe] ssd1306_git.bb: Add ssd1306_linux

Message ID 20231230171056.1297800-1-leon.anavi@konsulko.com
State Accepted, archived
Headers show
Series [meta-oe] ssd1306_git.bb: Add ssd1306_linux | expand

Commit Message

Leon Anavi Dec. 30, 2023, 5:10 p.m. UTC
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"

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
 .../ssd1306/0001-Use-include-filename.patch   | 49 +++++++++++++++++++
 .../recipes-devtools/ssd1306/ssd1306_git.bb   | 25 ++++++++++
 2 files changed, 74 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch
 create mode 100644 meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb

Comments

Khem Raj Dec. 30, 2023, 5:39 p.m. UTC | #1
On Sat, Dec 30, 2023 at 9:11 AM Leon Anavi <leon.anavi@konsulko.com> wrote:

> 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"
>
> Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
> ---
>  .../ssd1306/0001-Use-include-filename.patch   | 49 +++++++++++++++++++
>  .../recipes-devtools/ssd1306/ssd1306_git.bb   | 25 ++++++++++
>  2 files changed, 74 insertions(+)
>  create mode 100644
> meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch
>  create mode 100644 meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb
>
> 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 000000000..9ec682c7b
> --- /dev/null
> +++
> b/meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch
> @@ -0,0 +1,49 @@
> +From cb32ebbb1efb3202808809861ec3cbd811c55bd2 Mon Sep 17 00:00:00 2001
> +From: Leon Anavi <leon.anavi@konsulko.com>
> +Date: Sat, 30 Dec 2023 13:23:31 +0000
> +Subject: [PATCH] Use include "filename"
> +
> +Use include "filename" to include programmer-defined header files
> +from the same directory as the file containing the directive.
> +
> +Upstream-Status: Pending


I think it’s a good patch to submit upstream perhaps do that as well while
you are at it

>
> +
> +Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
> +---
> + main.c    | 2 +-
> + ssd1306.c | 6 +++---
> + 2 files changed, 4 insertions(+), 4 deletions(-)
> +
> +diff --git a/main.c b/main.c
> +index c1ffc2f..18e2b84 100644
> +--- a/main.c
> ++++ b/main.c
> +@@ -6,7 +6,7 @@
> + #include <string.h>
> + #include <fcntl.h>
> + #include <sys/ioctl.h>
> +-#include <ssd1306.h>
> ++#include "ssd1306.h"
> +
> + void print_help()
> + {
> +diff --git a/ssd1306.c b/ssd1306.c
> +index a03674a..2e6ba97 100644
> +--- a/ssd1306.c
> ++++ b/ssd1306.c
> +@@ -8,9 +8,9 @@
> + #include <string.h>
> + #include <fcntl.h>
> + #include <sys/ioctl.h>
> +-#include <linux_i2c.h>
> +-#include <ssd1306.h>
> +-#include <font.h>
> ++#include "linux_i2c.h"
> ++#include "ssd1306.h"
> ++#include "font.h"
> +
> + const char init_oled_type_file[] = "/tmp/.ssd1306_oled_type";
> +
> +--
> +2.39.2
> +
> 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 000000000..5adfd3ed6
> --- /dev/null
> +++ b/meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb
> @@ -0,0 +1,25 @@
> +SUMMARY="SSD1306 OLED I2C drive"
> +DESCRIPTION = "SSD1306 OLED I2C driver working in Linux"
> +HOMEPAGE = "https://github.com/armlabs/ssd1306_linux"
> +SECTION = "console/utils"
> +LICENSE = "MIT"
> +
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=7b694e603a996c3bfdc6093ed1f70c8f"
> +
> +SRC_URI = " \
> +    git://
> github.com/armlabs/ssd1306_linux.git;protocol=https;branch=master \
> +    file://0001-Use-include-filename.patch \
> +"
> +SRCREV = "7375f1088732d243f7167c9a17725f1a860da587"
> +
> +S = "${WORKDIR}/git"
> +
> +# coreutils provides fmt which is used in the Makefile
> +DEPENDS = "i2c-tools coreutils-native"
> +
> +EXTRA_OEMAKE = "CC='${CC}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
> +
> +do_install() {
> +    install -d ${D}${bindir}
> +    install -m 0755 ${B}/ssd1306_bin ${D}${bindir}
> +}
> --
> 2.39.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#107908):
> https://lists.openembedded.org/g/openembedded-devel/message/107908
> Mute This Topic: https://lists.openembedded.org/mt/103434392/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Leon Anavi Jan. 1, 2024, 7:53 a.m. UTC | #2
Hi Khem,

Happy New Year! Best wishes for 2024.

On Sat, Dec 30, 2023, 19:39 Khem Raj <raj.khem@gmail.com> wrote:

>
>
> On Sat, Dec 30, 2023 at 9:11 AM Leon Anavi <leon.anavi@konsulko.com>
> wrote:
>
>> 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"
>>
>> Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
>> ---
>>  .../ssd1306/0001-Use-include-filename.patch   | 49 +++++++++++++++++++
>>  .../recipes-devtools/ssd1306/ssd1306_git.bb   | 25 ++++++++++
>>  2 files changed, 74 insertions(+)
>>  create mode 100644
>> meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch
>>  create mode 100644 meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb
>>
>> 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 000000000..9ec682c7b
>> --- /dev/null
>> +++
>> b/meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch
>> @@ -0,0 +1,49 @@
>> +From cb32ebbb1efb3202808809861ec3cbd811c55bd2 Mon Sep 17 00:00:00 2001
>> +From: Leon Anavi <leon.anavi@konsulko.com>
>> +Date: Sat, 30 Dec 2023 13:23:31 +0000
>> +Subject: [PATCH] Use include "filename"
>> +
>> +Use include "filename" to include programmer-defined header files
>> +from the same directory as the file containing the directive.
>> +
>> +Upstream-Status: Pending
>
>
> I think it’s a good patch to submit upstream perhaps do that as well while
> you are at it
>

Yes, I have already opened a GitHub pull request to upstream this fix:
https://github.com/armlabs/ssd1306_linux/pull/4

Should I make any changes to the ssd1306 recipe to be accepted to meta-oe?

Best regards, Leon


>> +
>> +Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
>> +---
>> + main.c    | 2 +-
>> + ssd1306.c | 6 +++---
>> + 2 files changed, 4 insertions(+), 4 deletions(-)
>> +
>> +diff --git a/main.c b/main.c
>> +index c1ffc2f..18e2b84 100644
>> +--- a/main.c
>> ++++ b/main.c
>> +@@ -6,7 +6,7 @@
>> + #include <string.h>
>> + #include <fcntl.h>
>> + #include <sys/ioctl.h>
>> +-#include <ssd1306.h>
>> ++#include "ssd1306.h"
>> +
>> + void print_help()
>> + {
>> +diff --git a/ssd1306.c b/ssd1306.c
>> +index a03674a..2e6ba97 100644
>> +--- a/ssd1306.c
>> ++++ b/ssd1306.c
>> +@@ -8,9 +8,9 @@
>> + #include <string.h>
>> + #include <fcntl.h>
>> + #include <sys/ioctl.h>
>> +-#include <linux_i2c.h>
>> +-#include <ssd1306.h>
>> +-#include <font.h>
>> ++#include "linux_i2c.h"
>> ++#include "ssd1306.h"
>> ++#include "font.h"
>> +
>> + const char init_oled_type_file[] = "/tmp/.ssd1306_oled_type";
>> +
>> +--
>> +2.39.2
>> +
>> 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 000000000..5adfd3ed6
>> --- /dev/null
>> +++ b/meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb
>> @@ -0,0 +1,25 @@
>> +SUMMARY="SSD1306 OLED I2C drive"
>> +DESCRIPTION = "SSD1306 OLED I2C driver working in Linux"
>> +HOMEPAGE = "https://github.com/armlabs/ssd1306_linux"
>> +SECTION = "console/utils"
>> +LICENSE = "MIT"
>> +
>> +LIC_FILES_CHKSUM = "file://LICENSE;md5=7b694e603a996c3bfdc6093ed1f70c8f"
>> +
>> +SRC_URI = " \
>> +    git://
>> github.com/armlabs/ssd1306_linux.git;protocol=https;branch=master \
>> +    file://0001-Use-include-filename.patch \
>> +"
>> +SRCREV = "7375f1088732d243f7167c9a17725f1a860da587"
>> +
>> +S = "${WORKDIR}/git"
>> +
>> +# coreutils provides fmt which is used in the Makefile
>> +DEPENDS = "i2c-tools coreutils-native"
>> +
>> +EXTRA_OEMAKE = "CC='${CC}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
>> +
>> +do_install() {
>> +    install -d ${D}${bindir}
>> +    install -m 0755 ${B}/ssd1306_bin ${D}${bindir}
>> +}
>> --
>> 2.39.2
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#107908):
>> https://lists.openembedded.org/g/openembedded-devel/message/107908
>> Mute This Topic: https://lists.openembedded.org/mt/103434392/1997914
>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
>> raj.khem@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>>
Khem Raj Jan. 2, 2024, 1:09 a.m. UTC | #3
On Sun, Dec 31, 2023 at 11:53 PM Leon Anavi <leon.anavi@konsulko.com> wrote:
>
> Hi Khem,
>
> Happy New Year! Best wishes for 2024.

ty. same to you as well.

>
> On Sat, Dec 30, 2023, 19:39 Khem Raj <raj.khem@gmail.com> wrote:
>>
>>
>>
>> On Sat, Dec 30, 2023 at 9:11 AM Leon Anavi <leon.anavi@konsulko.com> wrote:
>>>
>>> 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"
>>>
>>> Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
>>> ---
>>>  .../ssd1306/0001-Use-include-filename.patch   | 49 +++++++++++++++++++
>>>  .../recipes-devtools/ssd1306/ssd1306_git.bb   | 25 ++++++++++
>>>  2 files changed, 74 insertions(+)
>>>  create mode 100644 meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch
>>>  create mode 100644 meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb
>>>
>>> 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 000000000..9ec682c7b
>>> --- /dev/null
>>> +++ b/meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch
>>> @@ -0,0 +1,49 @@
>>> +From cb32ebbb1efb3202808809861ec3cbd811c55bd2 Mon Sep 17 00:00:00 2001
>>> +From: Leon Anavi <leon.anavi@konsulko.com>
>>> +Date: Sat, 30 Dec 2023 13:23:31 +0000
>>> +Subject: [PATCH] Use include "filename"
>>> +
>>> +Use include "filename" to include programmer-defined header files
>>> +from the same directory as the file containing the directive.
>>> +
>>> +Upstream-Status: Pending
>>
>>
>> I think it’s a good patch to submit upstream perhaps do that as well while you are at it
>
>
> Yes, I have already opened a GitHub pull request to upstream this fix:
> https://github.com/armlabs/ssd1306_linux/pull/4
>
> Should I make any changes to the ssd1306 recipe to be accepted to meta-oe?

Yes, update the patch status to reflect this info and send a v2.

>
> Best regards, Leon
>
>>>
>>> +
>>> +Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
>>> +---
>>> + main.c    | 2 +-
>>> + ssd1306.c | 6 +++---
>>> + 2 files changed, 4 insertions(+), 4 deletions(-)
>>> +
>>> +diff --git a/main.c b/main.c
>>> +index c1ffc2f..18e2b84 100644
>>> +--- a/main.c
>>> ++++ b/main.c
>>> +@@ -6,7 +6,7 @@
>>> + #include <string.h>
>>> + #include <fcntl.h>
>>> + #include <sys/ioctl.h>
>>> +-#include <ssd1306.h>
>>> ++#include "ssd1306.h"
>>> +
>>> + void print_help()
>>> + {
>>> +diff --git a/ssd1306.c b/ssd1306.c
>>> +index a03674a..2e6ba97 100644
>>> +--- a/ssd1306.c
>>> ++++ b/ssd1306.c
>>> +@@ -8,9 +8,9 @@
>>> + #include <string.h>
>>> + #include <fcntl.h>
>>> + #include <sys/ioctl.h>
>>> +-#include <linux_i2c.h>
>>> +-#include <ssd1306.h>
>>> +-#include <font.h>
>>> ++#include "linux_i2c.h"
>>> ++#include "ssd1306.h"
>>> ++#include "font.h"
>>> +
>>> + const char init_oled_type_file[] = "/tmp/.ssd1306_oled_type";
>>> +
>>> +--
>>> +2.39.2
>>> +
>>> 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 000000000..5adfd3ed6
>>> --- /dev/null
>>> +++ b/meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb
>>> @@ -0,0 +1,25 @@
>>> +SUMMARY="SSD1306 OLED I2C drive"
>>> +DESCRIPTION = "SSD1306 OLED I2C driver working in Linux"
>>> +HOMEPAGE = "https://github.com/armlabs/ssd1306_linux"
>>> +SECTION = "console/utils"
>>> +LICENSE = "MIT"
>>> +
>>> +LIC_FILES_CHKSUM = "file://LICENSE;md5=7b694e603a996c3bfdc6093ed1f70c8f"
>>> +
>>> +SRC_URI = " \
>>> +    git://github.com/armlabs/ssd1306_linux.git;protocol=https;branch=master \
>>> +    file://0001-Use-include-filename.patch \
>>> +"
>>> +SRCREV = "7375f1088732d243f7167c9a17725f1a860da587"
>>> +
>>> +S = "${WORKDIR}/git"
>>> +
>>> +# coreutils provides fmt which is used in the Makefile
>>> +DEPENDS = "i2c-tools coreutils-native"
>>> +
>>> +EXTRA_OEMAKE = "CC='${CC}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
>>> +
>>> +do_install() {
>>> +    install -d ${D}${bindir}
>>> +    install -m 0755 ${B}/ssd1306_bin ${D}${bindir}
>>> +}
>>> --
>>> 2.39.2
>>>
>>>
>>> -=-=-=-=-=-=-=-=-=-=-=-
>>> Links: You receive all messages sent to this group.
>>> View/Reply Online (#107908): https://lists.openembedded.org/g/openembedded-devel/message/107908
>>> Mute This Topic: https://lists.openembedded.org/mt/103434392/1997914
>>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>
diff mbox series

Patch

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 000000000..9ec682c7b
--- /dev/null
+++ b/meta-oe/recipes-devtools/ssd1306/ssd1306/0001-Use-include-filename.patch
@@ -0,0 +1,49 @@ 
+From cb32ebbb1efb3202808809861ec3cbd811c55bd2 Mon Sep 17 00:00:00 2001
+From: Leon Anavi <leon.anavi@konsulko.com>
+Date: Sat, 30 Dec 2023 13:23:31 +0000
+Subject: [PATCH] Use include "filename"
+
+Use include "filename" to include programmer-defined header files
+from the same directory as the file containing the directive.
+
+Upstream-Status: Pending
+
+Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
+---
+ main.c    | 2 +-
+ ssd1306.c | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/main.c b/main.c
+index c1ffc2f..18e2b84 100644
+--- a/main.c
++++ b/main.c
+@@ -6,7 +6,7 @@
+ #include <string.h>
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
+-#include <ssd1306.h>
++#include "ssd1306.h"
+ 
+ void print_help()
+ {
+diff --git a/ssd1306.c b/ssd1306.c
+index a03674a..2e6ba97 100644
+--- a/ssd1306.c
++++ b/ssd1306.c
+@@ -8,9 +8,9 @@
+ #include <string.h>
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
+-#include <linux_i2c.h>
+-#include <ssd1306.h>
+-#include <font.h>
++#include "linux_i2c.h"
++#include "ssd1306.h"
++#include "font.h"
+ 
+ const char init_oled_type_file[] = "/tmp/.ssd1306_oled_type";
+ 
+-- 
+2.39.2
+
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 000000000..5adfd3ed6
--- /dev/null
+++ b/meta-oe/recipes-devtools/ssd1306/ssd1306_git.bb
@@ -0,0 +1,25 @@ 
+SUMMARY="SSD1306 OLED I2C drive"
+DESCRIPTION = "SSD1306 OLED I2C driver working in Linux"
+HOMEPAGE = "https://github.com/armlabs/ssd1306_linux"
+SECTION = "console/utils"
+LICENSE = "MIT"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7b694e603a996c3bfdc6093ed1f70c8f"
+
+SRC_URI = " \
+    git://github.com/armlabs/ssd1306_linux.git;protocol=https;branch=master \
+    file://0001-Use-include-filename.patch \
+"
+SRCREV = "7375f1088732d243f7167c9a17725f1a860da587"
+
+S = "${WORKDIR}/git"
+
+# coreutils provides fmt which is used in the Makefile
+DEPENDS = "i2c-tools coreutils-native"
+
+EXTRA_OEMAKE = "CC='${CC}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 ${B}/ssd1306_bin ${D}${bindir}
+}