lcd: add optional putarea()/getarea() operations

This commit is contained in:
Matias N
2020-11-02 12:56:10 -03:00
committed by Xiang Xiao
parent b54f0edff4
commit 9266c54bc2
6 changed files with 324 additions and 118 deletions
+47 -4
View File
@@ -70,6 +70,7 @@
struct lcd_planeinfo_s
{
/* LCD Data Transfer ******************************************************/
/* This method can be used to write a partial raster line to the LCD:
*
* row - Starting row to write to (range: 0 <= row < yres)
@@ -82,10 +83,29 @@ struct lcd_planeinfo_s
int (*putrun)(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer,
size_t npixels);
/* This method can be used to write a rectangular area to the LCD:
*
* row_start - Starting row to write to (range: 0 <= row < yres)
* row_end - Ending row to write to (range: row_start <= row < yres)
* col_start - Starting column to write to (range: 0 <= col <= xres)
* col_end - Ending column to write to
* (range: col_start <= col_end < xres)
* buffer - The buffer containing the area to be written to the LCD
*
* NOTE: this operation may not be supported by the device, in which case
* the callback pointer will be NULL. In that case, putrun() should be
* used.
*/
int (*putarea)(fb_coord_t row_start, fb_coord_t row_end,
fb_coord_t col_start, fb_coord_t col_end,
FAR const uint8_t *buffer);
/* This method can be used to read a partial raster line from the LCD:
*
* row - Starting row to read from (range: 0 <= row < yres)
* col - Starting column to read read (range: 0 <= col <= xres-npixels)
* col - Starting column to read read
* (range: 0 <= col <= xres-npixels)
* buffer - The buffer in which to return the run read from the LCD
* npixels - The number of pixels to read from the LCD
* (range: 0 < npixels <= xres-col)
@@ -94,17 +114,36 @@ struct lcd_planeinfo_s
int (*getrun)(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
size_t npixels);
/* This method can be used to read a rectangular area from the LCD:
*
* row_start - Starting row to read from (range: 0 <= row < yres)
* row_end - Ending row to read from (range: row_start <= row < yres)
* col_start - Starting column to read from (range: 0 <= col <= xres)
* col_end - Ending column to read from
* (range: col_start <= col_end < xres)
* buffer - The buffer where the data will be written
*
* NOTE: this operation may not be supported by the device, in which case
* the callback pointer will be NULL. In that case, getrun() should be
* used.
*/
int (*getarea)(fb_coord_t row_start, fb_coord_t row_end,
fb_coord_t col_start, fb_coord_t col_end,
FAR uint8_t *buffer);
/* Plane color characteristics ********************************************/
/* This is working memory allocated by the LCD driver for each LCD device
* and for each color plane. This memory will hold one raster line of data.
* The size of the allocated run buffer must therefore be at least
* and for each color plane. This memory will hold one raster line of
* data. The size of the allocated run buffer must therefore be at least
* (bpp * xres / 8). Actual alignment of the buffer must conform to the
* bitwidth of the underlying pixel type.
*
* If there are multiple planes, they may share the same working buffer
* because different planes will not be operate on concurrently. However,
* if there are multiple LCD devices, they must each have unique run buffers.
* if there are multiple LCD devices, they must each have unique run
* buffers.
*/
uint8_t *buffer;
@@ -122,6 +161,7 @@ struct lcd_planeinfo_s
struct lcd_dev_s
{
/* LCD Configuration ******************************************************/
/* Get information about the LCD video controller configuration and the
* configuration of each LCD color plane.
*/
@@ -132,6 +172,7 @@ struct lcd_dev_s
FAR struct lcd_planeinfo_s *pinfo);
/* LCD RGB Mapping ********************************************************/
/* The following are provided only if the video hardware supports RGB color
* mapping
*/
@@ -143,6 +184,7 @@ struct lcd_dev_s
#endif
/* Cursor Controls ********************************************************/
/* The following are provided only if the video hardware supports a
* hardware cursor
*/
@@ -155,6 +197,7 @@ struct lcd_dev_s
#endif
/* LCD Specific Controls **************************************************/
/* Get the LCD panel power status (0: full off - CONFIG_LCD_MAXPOWER: full
* on). On backlit LCDs, this setting may correspond to the backlight
* setting.
+18 -9
View File
@@ -37,15 +37,17 @@
* Type Definitions
****************************************************************************/
#define LCDDEVIO_PUTRUN _LCDIOC(0) /* Arg: const struct lcddev_putrun_s* */
#define LCDDEVIO_GETRUN _LCDIOC(1) /* Arg: struct lcddev_putrun_s* */
#define LCDDEVIO_GETPOWER _LCDIOC(2) /* Arg: int* */
#define LCDDEVIO_SETPOWER _LCDIOC(3) /* Arg: int */
#define LCDDEVIO_GETCONTRAST _LCDIOC(4) /* Arg: int* */
#define LCDDEVIO_SETCONTRAST _LCDIOC(5) /* Arg: unsigned int */
#define LCDDEVIO_GETPLANEINFO _LCDIOC(6) /* Arg: struct lcd_planeinfo_s* */
#define LCDDEVIO_GETVIDEOINFO _LCDIOC(7) /* Arg: struct fb_videoinfo_s* */
#define LCDDEVIO_SETPLANENO _LCDIOC(8) /* Arg: int */
#define LCDDEVIO_PUTRUN _LCDIOC(0) /* Arg: const struct lcddev_run_s* */
#define LCDDEVIO_PUTAREA _LCDIOC(1) /* Arg: const struct lcddev_area_s* */
#define LCDDEVIO_GETRUN _LCDIOC(2) /* Arg: struct lcddev_run_s* */
#define LCDDEVIO_GETAREA _LCDIOC(3) /* Arg: struct lcddev_area_s* */
#define LCDDEVIO_GETPOWER _LCDIOC(4) /* Arg: int* */
#define LCDDEVIO_SETPOWER _LCDIOC(5) /* Arg: int */
#define LCDDEVIO_GETCONTRAST _LCDIOC(6) /* Arg: int* */
#define LCDDEVIO_SETCONTRAST _LCDIOC(7) /* Arg: unsigned int */
#define LCDDEVIO_GETPLANEINFO _LCDIOC(8) /* Arg: struct lcd_planeinfo_s* */
#define LCDDEVIO_GETVIDEOINFO _LCDIOC(9) /* Arg: struct fb_videoinfo_s* */
#define LCDDEVIO_SETPLANENO _LCDIOC(10) /* Arg: int */
#ifdef CONFIG_FB_CMAP
#define LCDDEVIO_GETCMAP _LCDIOC(9) /* Arg: struct fb_cmap_s* */
@@ -76,6 +78,13 @@ struct lcddev_run_s
size_t npixels;
};
struct lcddev_area_s
{
fb_coord_t row_start, row_end;
fb_coord_t col_start, col_end;
FAR uint8_t *data;
};
/****************************************************************************
* Public Function Prototypes
****************************************************************************/