From 3b181641d2605c56f9f61b00e159dff3933e5779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Thu, 8 Jun 2023 20:10:19 +0200 Subject: [PATCH] drivers: auxdisplay: Fix text direction handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed Input Set handling. Flag had misleading names: whether "entry" happens to the left or to the right is dependent on whether increment mode is active or not), so switched to just using a "SHIFT" y/n flag instead. It also reflects better the contents of the datasheet). Updated romance text direction accordingly ("increment, no shift"). Signed-off-by: Benjamin Cabé --- drivers/auxdisplay/auxdisplay_jhd1313.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/auxdisplay/auxdisplay_jhd1313.c b/drivers/auxdisplay/auxdisplay_jhd1313.c index e17c190d31c..59b378e6e4e 100644 --- a/drivers/auxdisplay/auxdisplay_jhd1313.c +++ b/drivers/auxdisplay/auxdisplay_jhd1313.c @@ -26,10 +26,9 @@ LOG_MODULE_REGISTER(auxdisplay_jhd1313, CONFIG_AUXDISPLAY_LOG_LEVEL); #define JHD1313_CS_RIGHT_SHIFT (1 << 2) /* Defines for the JHD1313_CMD_INPUT_SET to change text direction */ -#define JHD1313_IS_SHIFT_INCREMENT (1 << 1) -#define JHD1313_IS_SHIFT_DECREMENT (0 << 1) -#define JHD1313_IS_ENTRY_LEFT (1 << 0) -#define JHD1313_IS_ENTRY_RIGHT (0 << 0) +#define JHD1313_IS_INCREMENT (1 << 1) +#define JHD1313_IS_DECREMENT (0 << 1) +#define JHD1313_IS_SHIFT (1 << 0) /* Defines for the JHD1313_CMD_FUNCTION_SET */ #define JHD1313_FS_8BIT_MODE (1 << 4) @@ -287,8 +286,11 @@ static int auxdisplay_jhd1313_initialize(const struct device *dev) /* Clear the screen */ auxdisplay_jhd1313_clear(dev); - /* Initialize to the default text direction for romance languages */ - cmd = JHD1313_IS_ENTRY_LEFT | JHD1313_IS_SHIFT_DECREMENT; + /* + * Initialize to the default text direction for romance languages + * (increment, no shift) + */ + cmd = JHD1313_IS_INCREMENT; auxdisplay_jhd1313_input_state_set(dev, cmd);