feature: driver: add interface for lcd dev driver

CHAMPION-100

add get and set framerate interface for lcd dev driver.

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
Change-Id: I42584fa2adde9783fac9ac31bfe0b29b426a82e1
This commit is contained in:
liushuai25
2021-09-04 14:37:31 +08:00
parent f70bc7c5f1
commit 193e898b51
4 changed files with 27 additions and 6 deletions
+6 -6
View File
@@ -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"
+10
View File
@@ -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;
+8
View File
@@ -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);
};
/****************************************************************************
+3
View File
@@ -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
****************************************************************************/