Miscellaneous HD44780 auxdisplay driver enhancements #149873
Annotations
1 error, 1 warning, and 2 notices
Run Compliance Tests
Process completed with exit code 1.
|
check-warns:
ClangFormat.txt#L1
See https://docs.zephyrproject.org/latest/contribute/guidelines.html#clang-format for more details.
You may want to run clang-format on this change:
-static void auxdisplay_hd44780_command(const struct device *dev, bool rs,
- uint8_t cmd, uint8_t mode)
+static void auxdisplay_hd44780_command(const struct device *dev, bool rs, uint8_t cmd, uint8_t mode)
{
int rc;
const struct auxdisplay_hd44780_config *config = dev->config;
int8_t i = 7;
const int lsb_line = (mode == AUXDISPLAY_HD44780_MODE_8_BIT) ? 0 : 4;
int ncommands = (mode == AUXDISPLAY_HD44780_MODE_4_BIT) ? 2 : 1;
- const bool check_busy_flag = (!config->rw_gpio.port ||
- (mode == AUXDISPLAY_HD44780_MODE_4_BIT_ONCE)) ?
- false : true;
+ const bool check_busy_flag =
+ (!config->rw_gpio.port || (mode == AUXDISPLAY_HD44780_MODE_4_BIT_ONCE)) ? false
+ : true;
File:drivers/auxdisplay/auxdisplay_hd44780.c
Line:130
You may want to run clang-format on this change:
-#define AUXDISPLAY_HD44780_DEVICE(inst) \
- static struct auxdisplay_hd44780_data auxdisplay_hd44780_data_##inst; \
- static const struct auxdisplay_hd44780_config auxdisplay_hd44780_config_##inst = { \
- .capabilities = { \
- .columns = DT_INST_PROP(inst, columns), \
- .rows = DT_INST_PROP(inst, rows), \
- .mode = DT_INST_ENUM_IDX(inst, mode), \
- .brightness.minimum = AUXDISPLAY_LIGHT_NOT_SUPPORTED, \
- .brightness.maximum = AUXDISPLAY_LIGHT_NOT_SUPPORTED, \
- .backlight.minimum = BACKLIGHT_CHECK(inst, \
- AUXDISPLAY_HD44780_BACKLIGHT_MIN), \
- .backlight.maximum = BACKLIGHT_CHECK(inst, \
- AUXDISPLAY_HD44780_BACKLIGHT_MAX), \
- .custom_characters = AUXDISPLAY_HD44780_CUSTOM_CHARACTERS, \
- .custom_character_width = AUXDISPLAY_HD44780_CUSTOM_CHARACTER_WIDTH, \
- .custom_character_height = AUXDISPLAY_HD44780_CUSTOM_CHARACTER_HEIGHT, \
- }, \
- .rs_gpio = GPIO_DT_SPEC_INST_GET(inst, register_select_gpios), \
- .rw_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, read_write_gpios, {0}), \
- .e_gpio = GPIO_DT_SPEC_INST_GET(inst, enable_gpios), \
- .db_gpios[0] = GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, data_bus_gpios, 0, {0}), \
- .db_gpios[1] = GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, data_bus_gpios, 1, {0}), \
- .db_gpios[2] = GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, data_bus_gpios, 2, {0}), \
- .db_gpios[3] = GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, data_bus_gpios, 3, {0}), \
- .db_gpios[4] = GPIO_DT_SPEC_INST_GET_BY_IDX(inst, data_bus_gpios, 4), \
- .db_gpios[5] = GPIO_DT_SPEC_INST_GET_BY_IDX(inst, data_bus_gpios, 5), \
- .db_gpios[6] = GPIO_DT_SPEC_INST_GET_BY_IDX(inst, data_bus_gpios, 6), \
- .db_gpios[7] = GPIO_DT_SPEC_INST_GET_BY_IDX(inst, data_bus_gpios, 7), \
- .line_addresses[0] = DT_INST_PROP_BY_IDX(inst, line_addresses, 0), \
- .line_addresses[1] = DT_INST_PROP_BY_IDX(inst, line_addresses, 1), \
- .line_addresses[2] = DT_INST_PROP_BY_IDX(inst, line_addresses, 2), \
- .line_addresses[3] = DT_INST_PROP_BY_IDX(inst, line_addresses, 3), \
- .backlight_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, backlight_gpios, {0}), \
- .enable_line_rise_delay = DT_INST_PROP(inst, enable_line_rise_delay_ns), \
- .enable_line_fall_delay = DT_INST_PROP(inst, enable_line_fall_delay_ns), \
- .rs_line_delay = DT_INST_PROP(inst, rs_line_delay_ns), \
- .clear_delay = DT_INST_PROP(inst, clear_command_delay_us), \
- .boot_delay = DT_INST_PROP(inst, boot_delay_ms), \
- }; \
- DEVICE_DT_INST_DEFINE(inst, \
- &auxdisplay_hd44780_init, \
- NULL, \
- &auxdisplay_hd44780_data_##inst, \
- &auxdisplay_hd44780_config_##inst, \
- POST_KERNEL, \
- CONFIG_AUXDISPLAY_INIT_PRIORITY, \
- &auxdisplay_hd44780_auxdisplay_api);
+#define AUXDISPLAY_HD44780_DEVICE(inst) \
+ static struct auxdisplay_hd44780_data auxdisplay_hd44780_data_##inst; \
+ static const struct auxdisplay_hd44780_config auxdisplay_hd44780_config_##inst = { \
+ .capabilit
|
Run Compliance Tests:
drivers/auxdisplay/auxdisplay_hd44780.c#L130
drivers/auxdisplay/auxdisplay_hd44780.c:130
-static void auxdisplay_hd44780_command(const struct device *dev, bool rs,
- uint8_t cmd, uint8_t mode)
+static void auxdisplay_hd44780_command(const struct device *dev, bool rs, uint8_t cmd, uint8_t mode)
{
int rc;
const struct auxdisplay_hd44780_config *config = dev->config;
int8_t i = 7;
const int lsb_line = (mode == AUXDISPLAY_HD44780_MODE_8_BIT) ? 0 : 4;
int ncommands = (mode == AUXDISPLAY_HD44780_MODE_4_BIT) ? 2 : 1;
- const bool check_busy_flag = (!config->rw_gpio.port ||
- (mode == AUXDISPLAY_HD44780_MODE_4_BIT_ONCE)) ?
- false : true;
+ const bool check_busy_flag =
+ (!config->rw_gpio.port || (mode == AUXDISPLAY_HD44780_MODE_4_BIT_ONCE)) ? false
+ : true;
|
Run Compliance Tests:
drivers/auxdisplay/auxdisplay_hd44780.c#L677
drivers/auxdisplay/auxdisplay_hd44780.c:677
-#define AUXDISPLAY_HD44780_DEVICE(inst) \
- static struct auxdisplay_hd44780_data auxdisplay_hd44780_data_##inst; \
- static const struct auxdisplay_hd44780_config auxdisplay_hd44780_config_##inst = { \
- .capabilities = { \
- .columns = DT_INST_PROP(inst, columns), \
- .rows = DT_INST_PROP(inst, rows), \
- .mode = DT_INST_ENUM_IDX(inst, mode), \
- .brightness.minimum = AUXDISPLAY_LIGHT_NOT_SUPPORTED, \
- .brightness.maximum = AUXDISPLAY_LIGHT_NOT_SUPPORTED, \
- .backlight.minimum = BACKLIGHT_CHECK(inst, \
- AUXDISPLAY_HD44780_BACKLIGHT_MIN), \
- .backlight.maximum = BACKLIGHT_CHECK(inst, \
- AUXDISPLAY_HD44780_BACKLIGHT_MAX), \
- .custom_characters = AUXDISPLAY_HD44780_CUSTOM_CHARACTERS, \
- .custom_character_width = AUXDISPLAY_HD44780_CUSTOM_CHARACTER_WIDTH, \
- .custom_character_height = AUXDISPLAY_HD44780_CUSTOM_CHARACTER_HEIGHT, \
- }, \
- .rs_gpio = GPIO_DT_SPEC_INST_GET(inst, register_select_gpios), \
- .rw_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, read_write_gpios, {0}), \
- .e_gpio = GPIO_DT_SPEC_INST_GET(inst, enable_gpios), \
- .db_gpios[0] = GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, data_bus_gpios, 0, {0}), \
- .db_gpios[1] = GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, data_bus_gpios, 1, {0}), \
- .db_gpios[2] = GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, data_bus_gpios, 2, {0}), \
- .db_gpios[3] = GPIO_DT_SPEC_INST_GET_BY_IDX_OR(inst, data_bus_gpios, 3, {0}), \
- .db_gpios[4] = GPIO_DT_SPEC_INST_GET_BY_IDX(inst, data_bus_gpios, 4), \
- .db_gpios[5] = GPIO_DT_SPEC_INST_GET_BY_IDX(inst, data_bus_gpios, 5), \
- .db_gpios[6] = GPIO_DT_SPEC_INST_GET_BY_IDX(inst, data_bus_gpios, 6), \
- .db_gpios[7] = GPIO_DT_SPEC_INST_GET_BY_IDX(inst, data_bus_gpios, 7), \
- .line_addresses[0] = DT_INST_PROP_BY_IDX(inst, line_addresses, 0), \
- .line_addresses[1] = DT_INST_PROP_BY_IDX(inst, line_addresses, 1), \
- .line_addresses[2] = DT_INST_PROP_BY_IDX(inst, line_addresses, 2), \
- .line_addresses[3] = DT_INST_PROP_BY_IDX(inst, line_addresses, 3), \
- .backlight_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, backlight_gpios, {0}), \
- .enable_line_rise_delay = DT_INST_PROP(inst, enable_line_rise_delay_ns), \
- .enable_line_fall_delay = DT_INST_PROP(inst, enable_line_fall_delay_ns), \
- .rs_line_delay = DT_INST_PROP(inst, rs_line_delay_ns), \
- .clear_delay = DT_INST_PROP(inst, clear_command_delay_us), \
- .boot_delay = DT_INST_PROP(inst, boot_delay_ms), \
- }; \
- DEVICE_DT_INST_DEFINE(inst, \
- &auxdisplay_hd44780_init, \
- NULL, \
- &auxdisplay_hd44780_data_##inst, \
- &auxdisplay_hd44780_config_##inst, \
- POST_KERNEL, \
- CONFIG_AUXDISPLAY_INIT_PRIORITY, \
- &auxdisplay_hd44780_auxdisplay_api);
+#define AUXDISPLAY_HD44780_DEVICE(inst) \
+ static struct auxdisplay_hd44780_data auxdisplay_hd44780_data_##inst; \
+ static const struct auxdisplay_hd44780_config auxdisplay_hd44780_config_##inst = { \
+ .capabilities = \
+ { \
+ .columns = DT_INST_PROP(inst, columns), \
+ .rows = DT_INST_PROP(inst, rows), \
+ .mode = DT_INST_ENUM_IDX(inst, mode), \
+ .brightness.minimum = AUXDISPLAY_LIGHT_NOT_SUPPORTED, \
+ .brightness.maximum = AUXDISPLAY_LIGHT_NOT_SUPPORTED, \
+ .backlight.minimum = \
+ BACKLIGHT_CHECK(inst, AUXDISPLAY_HD44780_BACKLIGHT_MIN), \
+ .backlight.maximum = \
+ BACKLIGHT_CHECK(inst, AUXDISPLAY_HD44780_BACKLIGHT_MAX), \
+ .custom_characters = AUXDISPLAY_HD44780_CUSTOM_CHARACTERS, \
+ .custom_character_width =
|
Loading