Commit graph

151 commits

Author SHA1 Message Date
Aurelien Jarno 0b7e790250 display: ssd1673: add support for ssd16xx monochrome controllers
From the driver point of view, monochrome controllers from the ssd16xx
family mostly differ by the amount of row and columns that are
supported. If they support more than 256 rows and/or columns the
corresponding size or position is sent using 2 bytes instead of 1 byte.

This patch therefore adds the width-bits and height-bits DT properties
to make this configurable.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-02-02 10:28:11 -05:00
Aurelien Jarno 9f54c06eac display: ssd1673: replace hardcoded display dimensions by DT values
Instead of hardcoding multiple times the display dimensions, use the
values from DT. This still assume 8 rows per page and 8 pixels per
bytes, but that should always be the case for this controller and a
monochrome display.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-02-02 10:28:11 -05:00
Aurelien Jarno 0a0c5adde5 display: ssd1673: drop unused constants
Drop constants that are unused and hardcoded to the display dimensions.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-02-02 10:28:11 -05:00
Piotr Mienkowski dc6066946e drivers: mb_display: remove usage of gpio_port_ functions.
gpio_port_ functions are being deprecated. This commit removes their
usage.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-02-01 08:57:58 -05:00
Kumar Gala 935d6855d9 display: ili9340: Fixup SPI CS handling
Replace undefined Kconfig SPI CS defines with DTS based defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-01 04:11:01 -06:00
Aurelien Jarno d0afacc6b4 display: ssd1673: replace k_busy_wait by k_sleep
The SSD1673 driver currently use k_busy_wait to wait for the
controller to finish the execution of a commmand. However a display
update command can take from a few hundreds of ms (default LUT) to
almost a second (initial LUT). k_busy_wait is just a spinning loop,
which prevents all the threads with lower priority to not be executed
during that time. That could be the case for example of the shell or
the log thread.

As the timing is not critical, it's better to use k_sleep instead,
allowing the CPU to process other threads. In the long term it might
even be better to use an interrupt there, but might not be that easy if
we want to support to various SoCs that can be connected to such a
display.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-31 06:34:05 -05:00
Kumar Gala d0aca3b92c display: ili9340: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert ili9340 display driver to use new defines so we can remove
the dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 15:25:46 -06:00
Kumar Gala fe8edc2884 display: ssd1306: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert ssd1306 display driver to use new defines so we can remove
the dts_fixup.h code for it.  Also dropped "-i2c" from compatible.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 14:21:32 -06:00
Kumar Gala 3b42943fe7 display: ssd1673: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert ssd1673 display driver to use new defines so we can remove
the dts_fixup.h code for it.  Also dropped "-spi" from compatible.

Fix up references in reel_board dts and sample.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 14:21:06 -06:00
Varun Sharma 77c643a5a3 drivers: Modify drivers to use DEVICE_AND_API_INIT()
Modified drivers to use DEVICE_AND_API_INIT() instead of DEVICE_INIT()

This will make sure driver_api,is populated at build time and is exposed
to user space

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
2019-01-15 10:39:34 -08:00
Jan Van Winkel 49ffca4553 display: Added double buffer screen info to display API
Extend display API screen info with double buffer enum entry.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-07 16:05:35 -05:00
Jan Van Winkel 848b0844dd driver: display: Added dummy display driver
Added dummy display driver.

fixes: #12001

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-30 15:53:39 -05:00
Jan Van Winkel 1f1ea26cdc driver: display: sdl: Return correct pixel format
Return actual pixel format that is in use by the SDL display driver
instead of returning a hard coded value.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-26 09:42:05 -05:00
Jan Van Winkel 6cb629c35b driver: SDL based display emulation driver
This driver introduces an emulated LCD display for the native POSIX
board. The emulated display driver makes use of SDL2 to render the
displays frame buffer into a dedicated desktop window.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-10 20:37:29 -05:00
Jan Van Winkel cbbea99eb5 drivers: display: Added windowing for SSD1673
Added support to the SSD1673 dipslay for partially writing the display

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-10 17:21:37 -05:00
Jan Van Winkel 6f42904185 drivers: Clear SSD1673 display during display init
Clear SSD1673 display during display driver initialization instead of
triggering clear via setting contrast.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-10 17:21:37 -05:00
Jan Van Winkel 79b58aa3fa drivers: Return correct erorr codes in SSD1673 driver
Return correct error codes in SSD1673 driver instead of -1

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-10 17:21:37 -05:00
Jan Van Winkel 8457891cea drivers: Added missing API functions in ssd drivers
Added missing API function set_orientation to ssd1306 & ssd1673
drivers.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-10 17:21:37 -05:00
Jan Van Winkel 9607dd9a16 drivers: Allow to set supported pix format in ssd drivers
Allow to set supported pixel format in ssd1306 & ssd1673 drivers

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-10 17:21:37 -05:00
Patrik Flykt 8ff96b5a57 drivers: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Johann Fischer aee6764c32 drivers: ssd1673: fix SPI GPIO CS configuration
Use DT_SSD1673_SPI_GPIO_CS_DRV_NAME for CS configuration.

Resolves: #10720

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-11-23 08:39:20 -05:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Himanshu Jha d0a98b7cf9 drivers: Remove redundant semicolon
Remove the redundant semicolon used as a terminator in
`if`, `switch`, `while` statements.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:34:06 -05:00
Kumar Gala 95776d945c drivers/display: mb_display: Move gpio defines to driver
Since the mb_display driver is specific to the microbit we can move
the GPIO pin defines from board.h into the driver.  This lets us remove
one of the few remaining drivers that is including board.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 15:58:51 -05:00
Jan Van Winkel a466154dcc drivers: display: Added DTS support for ili9340
Added device tree support for ili9340 display driver

Part of #10894

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-10-29 22:19:58 -04:00
Anas Nashif d2c8d52336 grove: lcd: move grove lcd driver to drivers/display
Move to display drivers where it belongs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-28 11:46:36 -04:00
Kumar Gala 1becbfcb8b drivers: display: ssd1673: Fixup dts support
There were several issues in the dts binding for the ssd1673 display:
* binding file mixed description & generation up together
* Use of BASE_LABEL
* orientation-flipped should have been of type boolean

Update the binding file to reflect these changes, and made associated
changes to dts_fixup.h and driver as needed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-26 08:13:04 +01:00
Kumar Gala 060b8c1512 drivers: ssd1306: fixup dts support
A few issues with the dts support for the SSD1306 display driver:
1. binding file mixed description & generation up together
   - rename most uses of generation to description and add proper
     generation field into yaml
2. Drop use of BASE_LABEL, this shouldn't be used by most bindings
3. dts defines that are being assumed in driver aren't correct.  We
   should be using a dts_fixup.h in the sample to map the generated
   defines to those used in the driver.  We remove the incorrect
   defines that the driver assumes right now.
4. Fixup 'segment-remap' and 'com-invdir' properties that are booleans
   in the binding file and associated code changes.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-24 16:42:35 +01:00
Johann Fischer 3a66b86544 drivers: add SSD1673 EPD controller driver
Add SSD1673 electrophoretic display controller driver.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-16 14:54:47 -04:00
Johann Fischer 419f4b7801 drivers: add SSD1306 display controller driver
Add SSD1306 OLED display controller driver.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-16 14:54:47 -04:00
Anas Nashif 68958b35a1 drivers: display: define DISPLAY log level
Use a common log level for display drivers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Jan Van Winkel d332ae5b6a driver: Updated ILI9340 driver to use display API
Updated ILI9340 display driver and sample application to make use off
the display API

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-10-03 11:29:00 -07:00
Jan Van Winkel 3dc2e733e8 drivers: display: Migrate to new logging subsystem
Migrate from SYS_LOG to LOG logging mechanism.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-10-03 11:29:00 -07:00
Flavio Ceolin 67ca176754 headers: Fix headers across the project
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-17 15:49:26 -04:00
Mieszko Mierunski 4f6aac1a67 dts: nrf5: Changed GPIO and GPIOTE define names
Changed names using nrf5 to nrf for consistency with other drivers.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-08-17 07:29:14 -07:00
Ulf Magnusson 8cf8db3a73 Kconfig: Use a short, consistent style for prompts
Consistently use

    config FOO
            bool/int/hex/string "Prompt text"

instead of

    config FOO
            bool/int/hex/string
            prompt "Prompt text"

(...and a bunch of other variations that e.g. swapped the order of the
type and the 'prompt', or put other properties between them).

The shorthand is fully equivalent to using 'prompt'. It saves lines and
avoids tricking people into thinking there is some semantic difference.

Most of the grunt work was done by a modified version of
https://unix.stackexchange.com/questions/26284/
how-can-i-use-sed-to-replace-a-multi-line-string/26290#26290, but some
of the rarer variations had to be converted manually.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-15 04:10:10 -07:00
Ulf Magnusson 38185db8fd drivers: display: Kconfig: Remove redundant 'default n' properties
Bool symbols implicitly default to 'n'.

A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though, and is
inconsistent.

This will make the auto-generated Kconfig documentation have "No
defaults. Implicitly defaults to n." as well, which is clearer than
'default n if ...'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-03 17:11:31 -04:00
Jan Van Winkel ca16779d9e driver: ILI9340 LCD display driver
Minimal driver for ILI9340 LCD display driver including support
for adafruit 2.2" LCD display (1480)

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-05-18 20:21:45 +03:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Johan Hedberg 7a7c8a57f5 drivers/display: mb_display: Fix struct member alignment
The alignment went off because of the move to use internal fixed-size
integer types (instead of standard int types).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-09 12:23:28 -04:00
Andrew Boie 65a9d2a94a kernel: make K_.*_INITIALIZER private to kernel
Upcoming memory protection features will be placing some additional
constraints on kernel objects:

- They need to reside in memory owned by the kernel and not the
application
- Certain kernel object validation schemes will require some run-time
initialization of all kernel objects before they can be used.

Per Ben these initializer macros were never intended to be public. It is
not forbidden to use them, but doing so requires care: the memory being
initialized must reside in kernel space, and extra runtime
initialization steps may need to be peformed before they are fully
usable as kernel objects. In particular, kernel subsystems or drivers
whose objects are already in kernel memory may still need to use these
macros if they define kernel objects as members of a larger data
structure.

It is intended that application developers instead use the
K_<object>_DEFINE macros, which will automatically put the object in the
right memory and add them to a section which can be iterated over at
boot to complete initiailization.

There was no K_WORK_DEFINE() macro for creating struct k_work objects,
this is now added.

k_poll_event and k_poll_signal are intended to be instatiated from
application memory and have not been changed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-10 11:44:56 -07:00
Johan Hedberg 7574bebbfe drivers/display: mb_display: Use 4 ms refresh timer
The code was so far requesting 5 ms refresh timer, however with a
default TICKS_PER_SECOND=100 this was always rounded up to 10 ms,
causing some flickering. The closest TICKS_PER_SECOND that will give
flicker-less display but also give optimal ms-to-ticks calculations is
250, so change the timer to match that. After this change any code
using the display is recommended to set 250 as ticks per second.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-30 12:29:11 +03:00
Kumar Gala ccad5bf3e3 drivers: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I08f51e2bfd475f6245771c1bd2df7ffc744c48c4
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 10:06:48 -05:00
Johan Hedberg d7a189d2ec drivers: display: mb_display: Unify image and string APIs
Both the string and image rendering may want to take advantage of
scrolling and sequential display capabilities. Consolidate the APIs so
that there's a single one for images (mb_display_image) and a single
one for strings (mb_display_print). Both take a duration parameter for
the per-frame duration as well as a mode parameter which specifies
sequential vs scrolling behavior as well as an optional looping flag.

Change-Id: Ia092d771e3f1b94afd494c7544dab988161c539e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-06 00:59:30 +00:00
Johan Hedberg 86e64b77f2 drivers: display: mb_display: Make display context more compact
Reorder the struct members for more compact layout. The current row
tracker tracks just values 0 to 2 so uint8_t is more than enough for
it.

Change-Id: I845c84aeb32d59ed0ebbd55d8b6cfda7ad19b75a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-06 00:59:29 +00:00
Johan Hedberg 5c22802fa2 drivers: display: mb_display: Get rid of unnecessary image tracking
We don't need to store copies of the current and next image when
scrolling text, since looking up the font is just as efficient and
also consumes less memory.

Change-Id: Ia905164c5b5784afb52cb2bb38c1ab1d00817df0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-06 00:59:28 +00:00
Johan Hedberg 0260af6372 drivers: display: mb_display: Add internal reset helper
Add a helper function to reset the state of the display, and make use
of it from the various public functions. This also ensures that the
timer is stopped before starting a new display routine.

Change-Id: I8a916b5b13c18b41b7fc3593e6d97e874ef117af
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-06 00:59:28 +00:00
Johan Hedberg e129699a50 drivers: display: mb_display: Add empty column to scrolling text
Add an empty column between characters of scrolling text so that the
individual characters are more easily distinguishable instead of being
back-to-back mashed together.

Also adjust the default scrolling step interval so that the character
display frequency stays roughly the same as before.

Change-Id: Idca0dc149a84f3f99b753a28ad1120ce75b97667
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-06 00:59:27 +00:00
Johan Hedberg 7e5df0cc02 drivers: display: Enhance BBC micro:bit string output capabilities
Add a new mb_display_print() API which takes printf-style parameters
and outputs scrolling text instead of one character at a time. The
existing mb_display_str() API is renamed to mb_display_string() for
consistency, and now also takes printf-style parameters.

Change-Id: I59c42bcd74c62f05ecb6d097dc808b9e5c1984c5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-04 13:54:00 +03:00
Johan Hedberg 380d24de1d drivers: Add support for BBC micro:bit LED display
Adds a simple driver to access the 5x5 LED display found on BBC
micro:bit boards. The display is so limited that no effort is done to
try to integrate with the existing console (which would likely make
the display unusable). Instead, dedicated mb_display_* APIs are added
that are specific to this display.

References:

 https://www.microbit.co.uk/device/screen
 https://lancaster-university.github.io/microbit-docs/ubit/display/

Jira: ZEP-1990
Change-Id: I431b5b358b5f07592a60d3aed87eaab6ac20ce25
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-04 08:14:36 +03:00