diff --git a/drivers/lcd/Kconfig b/drivers/lcd/Kconfig index 488a73efd9c..44b9bf55bdd 100644 --- a/drivers/lcd/Kconfig +++ b/drivers/lcd/Kconfig @@ -25,12 +25,12 @@ config LCD_PACKEDMSFIRST comment "Common Graphic LCD Settings" config LCD_DEV - bool "LCD character device" - default n - ---help--- - This option enables support for a character driver which exposes - LCD operations to userspace via ioctl() commands. This is useful when - not using NXGraphics but an alternative graphics library such as LVGL. + bool "LCD character device" + default n + ---help--- + This option enables support for a character driver which exposes + LCD operations to userspace via ioctl() commands. This is useful when + not using NXGraphics but an alternative graphics library such as LVGL. config LCD_FRAMEBUFFER bool "LCD framebuffer front end" diff --git a/drivers/lcd/lcd_dev.c b/drivers/lcd/lcd_dev.c index e3fade6110d..35cb98c1363 100644 --- a/drivers/lcd/lcd_dev.c +++ b/drivers/lcd/lcd_dev.c @@ -280,6 +280,16 @@ static int lcddev_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } break; #endif + case LCDDEVIO_SETFRAMERATE: + { + ret = priv->lcd_ptr->setframerate(priv->lcd_ptr, (int)arg); + } + break; + case LCDDEVIO_GETFRAMERATE: + { + *((FAR int *)arg) = priv->lcd_ptr->getframerate(priv->lcd_ptr); + } + break; default: ret = -EINVAL; break; diff --git a/include/nuttx/lcd/lcd.h b/include/nuttx/lcd/lcd.h index a0856a32318..3ca7d92ff1c 100644 --- a/include/nuttx/lcd/lcd.h +++ b/include/nuttx/lcd/lcd.h @@ -204,6 +204,14 @@ struct lcd_dev_s /* Set LCD panel contrast (0-CONFIG_LCD_MAXCONTRAST) */ int (*setcontrast)(struct lcd_dev_s *dev, unsigned int contrast); + + /* Set LCD panel frame rate (0: disable refresh) */ + + int (*setframerate)(struct lcd_dev_s *dev, int rate); + + /* Get LCD panel frame rate (0: disable refresh) */ + + int (*getframerate)(struct lcd_dev_s *dev); }; /**************************************************************************** diff --git a/include/nuttx/lcd/lcd_dev.h b/include/nuttx/lcd/lcd_dev.h index f460b9d2473..abc25fa5505 100644 --- a/include/nuttx/lcd/lcd_dev.h +++ b/include/nuttx/lcd/lcd_dev.h @@ -59,6 +59,9 @@ #define LCDDEVIO_SETCURSOR _LCDIOC(12) /* Arg: struct fb_setcursor_s* */ #endif +#define LCDDEVIO_SETFRAMERATE _LCDIOC(13) /* Arg: int */ +#define LCDDEVIO_GETFRAMERATE _LCDIOC(14) /* Arg: int* */ + /**************************************************************************** * Public Data ****************************************************************************/