Add lcd_dev_s pointer to lcd_planeinfo_s

In order to support multiple LCD instances per board, add a pointer from
lcd_planeinfo_s to the lcd_dev_s which it belongs to.  Also enhance the
putrun, getrun, putarea and getarea methods to pass through the
lcd_dev_s pointer to the respective device driver.

Port all LCD device drivers to this lcd_planeinfo_s extension.

Enhance SSD1306 driver to support multiple LCDs.

Signed-off-by: Michael Jung <michael.jung@secore.ly>
This commit is contained in:
Michael Jung 2022-06-17 12:17:18 +02:00 committed by Xiang Xiao
parent f68a5f0913
commit 9140693567
47 changed files with 589 additions and 629 deletions

View file

@ -92,7 +92,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
pinfo->buffer,
remainder,
ncols);
pinfo->putrun(row, dest->pt1.x, pinfo->buffer, ncols);
pinfo->putrun(pinfo->dev, row, dest->pt1.x, pinfo->buffer, ncols);
}
else
#endif
@ -101,7 +101,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
* Copy the image data directly from the image memory.
*/
pinfo->putrun(row, dest->pt1.x, sline, ncols);
pinfo->putrun(pinfo->dev, row, dest->pt1.x, sline, ncols);
}
/* Then adjust the source pointer to refer to the next line in

View file

@ -78,6 +78,6 @@ void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX)
{
/* Draw the raster line at this row */
pinfo->putrun(row, rect->pt1.x, pinfo->buffer, ncols);
pinfo->putrun(pinfo->dev, row, rect->pt1.x, pinfo->buffer, ncols);
}
}

View file

@ -220,7 +220,7 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)
/* Then draw the run from ix1 to ix2 at row */
ncols = ix2 - ix1 + 1;
pinfo->putrun(row, ix1, pinfo->buffer, ncols);
pinfo->putrun(pinfo->dev, row, ix1, pinfo->buffer, ncols);
}
/* Add the dx/dy value to get the run positions on the next row */

View file

@ -66,7 +66,7 @@ void NXGL_FUNCNAME(nxgl_getrectangle, NXGLIB_SUFFIX)
for (srcrow = rect->pt1.y; srcrow <= rect->pt2.y; srcrow++)
{
pinfo->getrun(srcrow, rect->pt1.x, dline, ncols);
pinfo->getrun(pinfo->dev, srcrow, rect->pt1.x, dline, ncols);
dline += deststride;
}
}

View file

@ -72,8 +72,10 @@ void NXGL_FUNCNAME(nxgl_moverectangle, NXGLIB_SUFFIX)
srcrow <= rect->pt2.y;
srcrow++, destrow++)
{
pinfo->getrun(srcrow, rect->pt1.x, pinfo->buffer, ncols);
pinfo->putrun(destrow, offset->x, pinfo->buffer, ncols);
pinfo->getrun(pinfo->dev, srcrow, rect->pt1.x, pinfo->buffer,
ncols);
pinfo->putrun(pinfo->dev, destrow, offset->x, pinfo->buffer,
ncols);
}
}
@ -91,8 +93,10 @@ void NXGL_FUNCNAME(nxgl_moverectangle, NXGLIB_SUFFIX)
srcrow >= rect->pt1.y;
srcrow--, destrow--)
{
pinfo->getrun(srcrow, rect->pt1.x, pinfo->buffer, ncols);
pinfo->putrun(destrow, offset->x, pinfo->buffer, ncols);
pinfo->getrun(pinfo->dev, srcrow, rect->pt1.x, pinfo->buffer,
ncols);
pinfo->putrun(pinfo->dev, destrow, offset->x, pinfo->buffer,
ncols);
}
}
}

View file

@ -67,7 +67,7 @@ void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX)
/* Read the byte that contains the pixel to be changed */
pinfo->getrun(pos->y, pos->x, &pixel, 8 / NXGLIB_BITSPERPIXEL);
pinfo->getrun(pinfo->dev, pos->y, pos->x, &pixel, 8 / NXGLIB_BITSPERPIXEL);
/* Shift the color into the proper position */
@ -114,13 +114,14 @@ void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX)
/* Write the modified byte back to graphics memory */
pinfo->putrun(pos->y,
pinfo->putrun(pinfo->dev,
pos->y,
pos->x,
(FAR uint8_t *)&pixel,
8 / NXGLIB_BITSPERPIXEL);
#else
/* Draw a single pixel at this position raster line at this row */
pinfo->putrun(pos->y, pos->x, (FAR uint8_t *)&color, 1);
pinfo->putrun(pinfo->dev, pos->y, pos->x, (FAR uint8_t *)&color, 1);
#endif
}