Skip to content

Commit 0974632

Browse files
stemschmidtcfriedt
authored andcommitted
boards: shields: Add support for the Adafruit Featherwing 128x32 OLED
The Adafruit Featherwing 128x32 OLED board supports a SSD1306 compatible OLED display with a resolution of 128 x 32 and three user buttons. It has been tested with the Adafruit Feather nRF52840 and the sample samples/subsys/display/lvgl. Signed-off-by: Stefan Schmidt <[email protected]>
1 parent 26d98f5 commit 0974632

File tree

5 files changed

+144
-0
lines changed

5 files changed

+144
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright The Zephyr Project Contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SHIELD_ADAFRUIT_FEATHERWING_128X32_OLED
5+
6+
if DISPLAY
7+
8+
if LVGL
9+
10+
config LV_Z_VDB_SIZE
11+
default 64
12+
13+
config LV_DPI_DEF
14+
default 148
15+
16+
config LV_Z_BITS_PER_PIXEL
17+
default 1
18+
19+
config LV_Z_COLOR_MONO_HW_INVERSION
20+
default y
21+
22+
choice LV_COLOR_DEPTH
23+
default LV_COLOR_DEPTH_1
24+
endchoice
25+
26+
endif # LVGL
27+
28+
endif # DISPLAY
29+
30+
endif # SHIELD_ADAFRUIT_FEATHERWING_128X32_OLED
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright The Zephyr Project Contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_ADAFRUIT_FEATHERWING_128X32_OLED
5+
def_bool $(shields_list_contains,adafruit_featherwing_128x32_oled)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright The Zephyr Project Contributors
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
chosen {
9+
zephyr,display = &ssd1306_ssd1306_128x32;
10+
};
11+
12+
aliases {
13+
sw0 = &buttonA;
14+
};
15+
16+
buttons {
17+
compatible = "gpio-keys";
18+
19+
buttonA: button_A {
20+
gpios = <&feather_header 16 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; /* D9 */
21+
label = "Button A";
22+
zephyr,code = <INPUT_KEY_A>;
23+
};
24+
25+
buttonB: button_B {
26+
/* Button B has a pull up resistor on board. */
27+
gpios = <&feather_header 15 GPIO_ACTIVE_LOW>; /* D6 */
28+
label = "Button B";
29+
zephyr,code = <INPUT_KEY_B>;
30+
};
31+
32+
buttonC: button_C {
33+
gpios = <&feather_header 14 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; /* D5 */
34+
label = "Button C";
35+
zephyr,code = <INPUT_KEY_C>;
36+
};
37+
};
38+
};
39+
40+
&feather_i2c {
41+
ssd1306_ssd1306_128x32: ssd1306@3c {
42+
compatible = "solomon,ssd1306fb";
43+
reg = <0x3c>;
44+
width = <128>;
45+
height = <32>;
46+
segment-offset = <0>;
47+
page-offset = <0>;
48+
display-offset = <0>;
49+
multiplex-ratio = <31>;
50+
segment-remap;
51+
com-invdir;
52+
com-sequential;
53+
prechargep = <0x22>;
54+
};
55+
};
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.. _adafruit_featherwing_128x32_oled:
2+
3+
Adafruit FeatherWing 128x32 OLED Shield
4+
#######################################
5+
6+
Overview
7+
********
8+
9+
The `Adafruit OLED FeatherWing Shield`_ features a SSD1306 compatible OLED display
10+
with a resolution of 128x32 pixels and three user buttons.
11+
12+
Pins Assignment of the Adafruit FeatherWing 128x32 OLED shield
13+
==============================================================
14+
15+
+-----------------------+---------------------------------------------+
16+
| Shield Connector Pin | Function |
17+
+=======================+=============================================+
18+
| SDA | SSD1306 I2C SDA |
19+
+-----------------------+---------------------------------------------+
20+
| SCL | SSD1306 I2C SCL |
21+
+-----------------------+---------------------------------------------+
22+
| GPIO5 | Button C (INPUT_KEY_C) |
23+
+-----------------------+---------------------------------------------+
24+
| GPIO6 | Button B (INPUT_KEY_B) |
25+
+-----------------------+---------------------------------------------+
26+
| GPIO9 | Button A (INPUT_KEY_A) |
27+
+-----------------------+---------------------------------------------+
28+
29+
Requirements
30+
************
31+
32+
This shield can only be used with a board which provides a configuration for Feather connector and
33+
defines a node alias for I2C (see :ref:`shields` for more details).
34+
35+
Programming
36+
***********
37+
38+
Set ``--shield adafruit_featherwing_128x32_oled`` when you invoke ``west build``. For example:
39+
40+
.. zephyr-app-commands::
41+
:zephyr-app: samples/subsys/display/lvgl
42+
:board: adafruit_feather_nrf52840
43+
:shield: adafruit_featherwing_128x32_oled
44+
:goals: build
45+
46+
.. _Adafruit OLED FeatherWing Shield:
47+
https://learn.adafruit.com/adafruit-oled-featherwing
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
shields:
2+
- name: adafruit_featherwing_128x32_oled
3+
full_name: Adafruit FeatherWing 128x32 OLED
4+
vendor: adafruit
5+
supported_features:
6+
- display
7+
- input

0 commit comments

Comments
 (0)