feature: driver: add interface for lcd dev driver
add get and set framerate interface for lcd dev driver. Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
This commit is contained in:
parent
3183251de0
commit
fdcd1228b2
@ -25,12 +25,12 @@ config LCD_PACKEDMSFIRST
|
|||||||
comment "Common Graphic LCD Settings"
|
comment "Common Graphic LCD Settings"
|
||||||
|
|
||||||
config LCD_DEV
|
config LCD_DEV
|
||||||
bool "LCD character device"
|
bool "LCD character device"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
This option enables support for a character driver which exposes
|
This option enables support for a character driver which exposes
|
||||||
LCD operations to userspace via ioctl() commands. This is useful when
|
LCD operations to userspace via ioctl() commands. This is useful when
|
||||||
not using NXGraphics but an alternative graphics library such as LVGL.
|
not using NXGraphics but an alternative graphics library such as LVGL.
|
||||||
|
|
||||||
config LCD_FRAMEBUFFER
|
config LCD_FRAMEBUFFER
|
||||||
bool "LCD framebuffer front end"
|
bool "LCD framebuffer front end"
|
||||||
|
@ -280,6 +280,16 @@ static int lcddev_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#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:
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
break;
|
break;
|
||||||
|
@ -204,6 +204,14 @@ struct lcd_dev_s
|
|||||||
/* Set LCD panel contrast (0-CONFIG_LCD_MAXCONTRAST) */
|
/* Set LCD panel contrast (0-CONFIG_LCD_MAXCONTRAST) */
|
||||||
|
|
||||||
int (*setcontrast)(struct lcd_dev_s *dev, unsigned int contrast);
|
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);
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -59,6 +59,9 @@
|
|||||||
#define LCDDEVIO_SETCURSOR _LCDIOC(12) /* Arg: struct fb_setcursor_s* */
|
#define LCDDEVIO_SETCURSOR _LCDIOC(12) /* Arg: struct fb_setcursor_s* */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define LCDDEVIO_SETFRAMERATE _LCDIOC(13) /* Arg: int */
|
||||||
|
#define LCDDEVIO_GETFRAMERATE _LCDIOC(14) /* Arg: int* */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user