drivers: auxdisplay: Fix text direction handling

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é <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé 2023-06-08 20:10:19 +02:00 committed by Anas Nashif
commit 3b181641d2

View file

@ -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);