Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: Add text display interface #52032

Merged
merged 10 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
/drivers/adc/adc_ads1x1x.c @XenuIsWatching
/drivers/adc/adc_stm32.c @cybertale
/drivers/audio/*nrfx* @anangl
/drivers/auxdisplay/* @thedjnK
/drivers/bbram/* @yperess @sjg20 @jackrosenthal
/drivers/bluetooth/ @alwa-nordic @jhedberg @Vudentz
/drivers/bluetooth/hci/hci_esp32.c @sylvioalves
Expand Down Expand Up @@ -563,6 +564,7 @@
/dts/bindings/i3c/ @dcpleung
/dts/bindings/pm_cpu_ops/* @carlocaione
/dts/bindings/ethernet/*gem.yaml @ibirnbaum
/dts/bindings/auxdisplay/* @thedjnK
/dts/posix/ @aescolar @daor-oti
/dts/bindings/sensor/*bme680* @BoschSensortec
/dts/bindings/sensor/*ina23* @bbilas
Expand All @@ -573,6 +575,7 @@
/include/ @nashif @carlescufi @galak @MaureenHelm
/include/zephyr/drivers/*/*litex* @mateusz-holenko @kgugala @pgielda
/include/zephyr/drivers/adc.h @anangl
/include/zephyr/drivers/auxdisplay.h @thedjnK
/include/zephyr/drivers/can.h @alexanderwachter @henrikbrixandersen
/include/zephyr/drivers/can/ @alexanderwachter @henrikbrixandersen
/include/zephyr/drivers/counter.h @nordic-krch
Expand Down
11 changes: 11 additions & 0 deletions MAINTAINERS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,17 @@ Release Notes:
labels:
- "area: Battery Backed RAM (bbram)"

"Drivers: Aux display":
status: maintained
maintainers:
- thedjnK
files:
- include/zephyr/drivers/auxdisplay.h
- drivers/auxdisplay/*
- dts/bindings/auxdisplay/*
labels:
- "area: Aux display"

"Drivers: CAN":
status: maintained
maintainers:
Expand Down
4 changes: 4 additions & 0 deletions doc/develop/api/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ between major releases are available in the :ref:`zephyr_release_notes`.
- Experimental
- 1.13

* - :ref:`auxdisplay_api`
- Unstable
- 3.3

* - :ref:`bluetooth_api`
- Stable
- 1.0
Expand Down
30 changes: 30 additions & 0 deletions doc/hardware/peripherals/auxdisplay.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. _auxdisplay_api:

Auxiliary Display (auxdisplay)
##############################

Overview
********

Auxiliary Displays are text-based displays that have simple interfaces for
displaying textual, numeric or alphanumeric data, as opposed to the
`Display API <display_api>`_, auxiliary displays do not support custom
graphical output to displays (and and most often monochrome), the most
advanced custom feature supported is generation of custom characters.
These inexpensive displays are commonly found with various configurations
and sizes, a common display size is 16 characters by 2 lines.

This API is unstable and subject to change.

Configuration Options
*********************

Related configuration options:

* :kconfig:option:`CONFIG_AUXDISPLAY`
* :kconfig:option:`CONFIG_AUXDISPLAY_INIT_PRIORITY`

API Reference
*************

.. doxygengroup:: auxdisplay_interface
1 change: 1 addition & 0 deletions doc/hardware/peripherals/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Peripherals

w1.rst
adc.rst
auxdisplay.rst
audio/index.rst
bc12.rst
clock_control.rst
Expand Down
14 changes: 14 additions & 0 deletions doc/releases/release-notes-3.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ New APIs in this release
:c:func:`rtc_set_calibration` and :c:func:`rtc_get_calibration` are enabled with
:kconfig:option:`CONFIG_RTC_CALIBRATION`.

* Introduced :ref:`auxdisplay_api` for auxiliary (alphanumeric-based) displays.

Kernel
******

Expand Down Expand Up @@ -335,6 +337,18 @@ Build system and infrastructure
Drivers and Sensors
*******************

* Auxiliary display

* New auxiliary display (auxdisplay) peripheral has been added, this allows
for interfacing with simple alphanumeric displays that do not feature
graphic capabilities. This peripheral is marked as unstable.

* HD44780 driver added.

* Noritake Itron driver added.

* Grove LCD driver added (ported from existing sample).

* ADC

* MCUX LPADC driver now uses the channel parameter to select a software channel
Expand Down
1 change: 1 addition & 0 deletions drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ add_subdirectory_ifdef(CONFIG_CRYPTO crypto)
add_subdirectory_ifdef(CONFIG_DAC dac)
add_subdirectory_ifdef(CONFIG_DAI dai)
add_subdirectory_ifdef(CONFIG_DISPLAY display)
add_subdirectory_ifdef(CONFIG_AUXDISPLAY auxdisplay)
add_subdirectory_ifdef(CONFIG_DMA dma)
add_subdirectory_ifdef(CONFIG_EDAC edac)
add_subdirectory_ifdef(CONFIG_EEPROM eeprom)
Expand Down
1 change: 1 addition & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
menu "Device Drivers"

source "drivers/adc/Kconfig"
source "drivers/auxdisplay/Kconfig"
source "drivers/audio/Kconfig"
source "drivers/bbram/Kconfig"
source "drivers/bluetooth/Kconfig"
Expand Down
6 changes: 6 additions & 0 deletions drivers/auxdisplay/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
zephyr_library_sources_ifdef(CONFIG_AUXDISPLAY_HD44780 auxdisplay_hd44780.c)
zephyr_library_sources_ifdef(CONFIG_AUXDISPLAY_ITRON auxdisplay_itron.c)
zephyr_library_sources_ifdef(CONFIG_AUXDISPLAY_JHD1313 auxdisplay_jhd1313.c)
27 changes: 27 additions & 0 deletions drivers/auxdisplay/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Auxiliary Display drivers

# Copyright (c) 2022 Jamie McCrae
# SPDX-License-Identifier: Apache-2.0

menuconfig AUXDISPLAY
bool "Auxiliary (textual) Display Drivers"
help
Enable auxiliary/texual display drivers (e.g. alphanumerical displays)

if AUXDISPLAY

config AUXDISPLAY_INIT_PRIORITY
int "Auxiliary display devices init priority"
default 85
help
Auxiliary (textual) display devices initialization priority.

module = AUXDISPLAY
module-str = auxdisplay
source "subsys/logging/Kconfig.template.log_config"

source "drivers/auxdisplay/Kconfig.hd44780"
source "drivers/auxdisplay/Kconfig.itron"
source "drivers/auxdisplay/Kconfig.jhd1313"

endif # AUXDISPLAY
9 changes: 9 additions & 0 deletions drivers/auxdisplay/Kconfig.hd44780
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2023 Jamie McCrae
# SPDX-License-Identifier: Apache-2.0

config AUXDISPLAY_HD44780
bool "Hitachi HD44780 LCD driver"
default y
depends on DT_HAS_HIT_HD44780_ENABLED
help
Enable driver for Hitachi HD44780 and compatible LCDs.
11 changes: 11 additions & 0 deletions drivers/auxdisplay/Kconfig.itron
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright (c) 2022 Jamie McCrae
# SPDX-License-Identifier: Apache-2.0

config AUXDISPLAY_ITRON
bool "Noritake Itron VFD driver"
default y
select GPIO
select SERIAL
depends on DT_HAS_NORITAKE_ITRON_ENABLED
thedjnK marked this conversation as resolved.
Show resolved Hide resolved
help
Enable driver for Noritake Itron VFD.
10 changes: 10 additions & 0 deletions drivers/auxdisplay/Kconfig.jhd1313
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2022 Jamie McCrae
# SPDX-License-Identifier: Apache-2.0

config AUXDISPLAY_JHD1313
bool "Jinghua Display JHD1313 driver"
default y
select I2C
depends on DT_HAS_JHD_JHD1313_ENABLED
thedjnK marked this conversation as resolved.
Show resolved Hide resolved
help
Enable driver for Jinghua Display JHD1313 display.
157 changes: 157 additions & 0 deletions drivers/auxdisplay/auxdisplay_handlers.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
/*
* Copyright (c) 2022-2023 Jamie McCrae
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/drivers/auxdisplay.h>
#include <zephyr/syscall_handler.h>

static inline int z_vrfy_auxdisplay_display_on(const struct device *dev)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_display_on(dev);
}
#include <syscalls/auxdisplay_display_on_mrsh.c>

static inline int z_vrfy_auxdisplay_display_off(const struct device *dev)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_display_off(dev);
}
#include <syscalls/auxdisplay_display_off_mrsh.c>

static inline int z_vrfy_auxdisplay_cursor_set_enabled(const struct device *dev, bool enabled)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_cursor_set_enabled(dev, enabled);
}
#include <syscalls/auxdisplay_cursor_set_enabled_mrsh.c>

static inline int z_vrfy_auxdisplay_position_blinking_set_enabled(const struct device *dev,
bool enabled)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_position_blinking_set_enabled(dev, enabled);
}
#include <syscalls/auxdisplay_position_blinking_set_enabled_mrsh.c>

static inline int z_vrfy_auxdisplay_cursor_shift_set(const struct device *dev, uint8_t direction,
bool display_shift);
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_cursor_shift_set(dev, direction, display_shift);
}
#include <syscalls/auxdisplay_cursor_shift_set_mrsh.c>

static inline int z_vrfy_auxdisplay_cursor_position_set(const struct device *dev,
enum auxdisplay_position type,
int16_t x, int16_t y)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_cursor_position_set(dev, type, x, y);
}
#include <syscalls/auxdisplay_cursor_position_set_mrsh.c>

static inline int z_vrfy_auxdisplay_cursor_position_get(const struct device *dev, int16_t *x,
int16_t *y)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_cursor_position_get(dev, x, y);
}
#include <syscalls/auxdisplay_cursor_position_get_mrsh.c>

static inline int z_vrfy_auxdisplay_display_position_set(const struct device *dev,
enum auxdisplay_position type,
int16_t x, int16_t y)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_display_position_set(dev, type, x, y);
}
#include <syscalls/auxdisplay_display_position_set_mrsh.c>

static inline int z_vrfy_auxdisplay_display_position_get(const struct device *dev, int16_t *x,
int16_t *y)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_display_position_get(dev, x, y);
}
#include <syscalls/auxdisplay_display_position_get_mrsh.c>

static inline int z_vrfy_auxdisplay_capabilities_get_api(const struct device *dev,
struct auxdisplay_capabilities *capabilities)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_capabilities_get_api(dev, capabilities);
}
#include <syscalls/auxdisplay_capabilities_get_api_mrsh.c>

static inline int z_vrfy_auxdisplay_clear(const struct device *dev)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_clear(dev);
}
#include <syscalls/auxdisplay_clear_mrsh.c>

static inline int z_vrfy_auxdisplay_brightness_get(const struct device *dev,
uint8_t *brightness)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_brightness_get(dev, brightness);
}
#include <syscalls/auxdisplay_brightness_get_mrsh.c>

static inline int z_vrfy_auxdisplay_brightness_set(const struct device *dev,
uint8_t brightness)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_backlight_get(dev, backlight);
}
#include <syscalls/auxdisplay_brightness_set_mrsh.c>

static inline int z_vrfy_auxdisplay_brightness_set(const struct device *dev,
uint8_t brightness)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_backlight_get(dev, backlight);
}
#include <syscalls/auxdisplay_brightness_set_mrsh.c>

static inline int z_vrfy_auxdisplay_backlight_set(const struct device *dev,
uint8_t backlight)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_backlight_set(dev, backlight);
}
#include <syscalls/auxdisplay_backlight_set_mrsh.c>

static inline bool z_vrfy_auxdisplay_is_busy(const struct device *dev)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_is_busy(dev);
}
#include <syscalls/auxdisplay_is_busy_mrsh.c>

static inline int z_vrfy_auxdisplay_custom_character_set(const struct device *dev,
struct auxdisplay_character *character)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_custom_character_set(dev, character);
}
#include <syscalls/auxdisplay_custom_character_set_mrsh.c>

static inline int z_vrfy_auxdisplay_write(const struct device *dev, const uint8_t *data,
uint16_t len)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_write(dev, data, len);
}
#include <syscalls/auxdisplay_write_mrsh.c>

static inline int z_vrfy_auxdisplay_custom_command(const struct device *dev,
struct auxdisplay_custom_data *data)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_custom_command(dev, data);
}
#include <syscalls/auxdisplay_custom_command_mrsh.c>
Loading
Loading