boards/shields: ssd1306: Factorize and move to conditional Kconfig

Factorize definitions for ssd1306_128x32 and sd1306_128x64 shields
and move to conditional Kconfig.
As part of this change, direct drivers Kconfig symbols enabling
(I2C, SSD1306) are removed as they are application responsibility.
Also disabling SSD16XX is removed as SSD16XX should not be enabled
by default.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2019-12-10 14:34:46 +01:00 committed by Anas Nashif
parent 980ddb6b98
commit 4faf6546b1
14 changed files with 68 additions and 64 deletions

View file

@ -0,0 +1,45 @@
# Copyright (c) 2019 Linaro Limited
# SPDX-License-Identifier: Apache-2.0
if SHIELD_SSD1306_128X64 || SHIELD_SSD1306_128X32
if DISPLAY
config I2C
default y
config SSD1306
default y
if LVGL
config LVGL_DISPLAY_DEV_NAME
default "SSD1306"
config LVGL_HOR_RES
default 128
config LVGL_VER_RES
default 64 if SHIELD_SSD1306_128X64
default 32 if SHIELD_SSD1306_128X32
config LVGL_VDB_SIZE
default 64
config LVGL_DPI
default 148
config LVGL_BITS_PER_PIXEL
default 1
choice LVGL_COLOR_DEPTH
default LVGL_COLOR_DEPTH_1
endchoice
endif # LVGL
rsource "boards/*.defconfig"
endif # DISPLAY
endif # SHIELD_SSD1306_128X64 || SHIELD_SSD1306_128X32

View file

@ -0,0 +1,8 @@
# Copyright (c) 2019 Linaro Limited
# SPDX-License-Identifier: Apache-2.0
config SHIELD_SSD1306_128X32
def_bool $(shields_list_contains,ssd1306_128x32)
config SHIELD_SSD1306_128X64
def_bool $(shields_list_contains,ssd1306_128x64)

View file

@ -0,0 +1,10 @@
# Copyright (c) 2019 Linaro Limited
# SPDX-License-Identifier: Apache-2.0
if BOARD_REEL_BOARD
choice I2C_0_NRF_TYPE
default I2C_0_NRF_TWI
endchoice
endif # BOARD_REEL_BOARD

View file

@ -1,12 +1,12 @@
.. _ssd1306_128x64_shield:
.. _ssd1306_128_shield:
SSD1306 128x64 pixels generic shield
####################################
SSD1306 128x64(/32) pixels generic shield
#########################################
Overview
********
This is a generic shield for 128x64 pixel resolution OLED displays
This is a generic shield for 128x64(/32) pixel resolution OLED displays
based on SSD1306 controller. These displays have an I2C interface and
usually only four pins: GND, VCC, SCL and SDA. Display pins can be
connected to the pin header of a board using jumper wires.

View file

@ -1,2 +0,0 @@
CONFIG_I2C_0_NRF_TWI=y
CONFIG_SSD16XX=n

View file

@ -1,30 +0,0 @@
.. _ssd1306_128x32_shield:
SSD1306 128x32 pixels generic shield
####################################
Overview
********
This is a generic shield for 128x32 pixel resolution OLED displays
based on SSD1306 controller. These displays have an I2C interface and
usually only four pins: GND, VCC, SCL and SDA. Display pins can be
connected to the pin header of a board using jumper wires.
Requirements
************
This shield can only be used with a board which provides a configuration
for Arduino connectors and defines a node alias for the I2C interface
(see :ref:`shields` for more details).
Programming
***********
Set ``-DSHIELD=ssd1306_128x32`` when you invoke ``west build``. For example:
.. zephyr-app-commands::
:zephyr-app: samples/gui/lvgl
:board: frdm_k64f
:shield: ssd1306_128x32
:goals: build

View file

@ -1,11 +0,0 @@
CONFIG_I2C=y
CONFIG_SSD1306=y
CONFIG_LVGL_COLOR_DEPTH_1=y
CONFIG_LVGL_BITS_PER_PIXEL=1
CONFIG_LVGL_HOR_RES=128
CONFIG_LVGL_VER_RES=32
CONFIG_LVGL_DPI=148
CONFIG_LVGL_VDB_SIZE=64
CONFIG_LVGL_DISPLAY_DEV_NAME="SSD1306"

View file

@ -1,2 +0,0 @@
CONFIG_I2C_0_NRF_TWI=y
CONFIG_SSD16XX=n

View file

@ -1,3 +0,0 @@
&arduino_i2c {
compatible = "nordic,nrf-twi";
};

View file

@ -1,11 +0,0 @@
CONFIG_I2C=y
CONFIG_SSD1306=y
CONFIG_LVGL_COLOR_DEPTH_1=y
CONFIG_LVGL_BITS_PER_PIXEL=1
CONFIG_LVGL_HOR_RES=128
CONFIG_LVGL_VER_RES=64
CONFIG_LVGL_DPI=148
CONFIG_LVGL_VDB_SIZE=64
CONFIG_LVGL_DISPLAY_DEV_NAME="SSD1306"

View file

@ -16,7 +16,7 @@ Display shield and a board which provides a configuration
for Arduino connectors, for example:
- :ref:`adafruit_2_8_tft_touch_v2` and :ref:`nrf52840_pca10056`
- :ref:`ssd1306_128x64_shield` and :ref:`frdm_k64f`
- :ref:`ssd1306_128_shield` and :ref:`frdm_k64f`
or a simulated display environment in a native Posix application: