mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:22:18 +08:00
drivers/lcd/max7219.c: Add support for MAX7219 vertically organized display.
This commit is contained in:
committed by
Gregory Nutt
parent
b076ff36cb
commit
7c5f329294
+15
-8
@@ -96,12 +96,6 @@
|
|||||||
# define CONFIG_MAX7219_NVERTICALBLKS 1
|
# define CONFIG_MAX7219_NVERTICALBLKS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Current driver is not prepared for multiples rows of LED Matrix */
|
|
||||||
|
|
||||||
#if CONFIG_MAX7219_NVERTICALBLKS > 1
|
|
||||||
# error "This driver doesn't support yet blocks in the vertical!"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CONFIG_LCD_MAXCONTRAST > 15
|
#if CONFIG_LCD_MAXCONTRAST > 15
|
||||||
# undef CONFIG_LCD_MAXCONTRAST
|
# undef CONFIG_LCD_MAXCONTRAST
|
||||||
# define CONFIG_LCD_MAXCONTRAST 15
|
# define CONFIG_LCD_MAXCONTRAST 15
|
||||||
@@ -433,6 +427,7 @@ static int max7219_putrun(fb_coord_t row, fb_coord_t col,
|
|||||||
uint8_t usrmask;
|
uint8_t usrmask;
|
||||||
int i;
|
int i;
|
||||||
int pixlen;
|
int pixlen;
|
||||||
|
int newrow;
|
||||||
|
|
||||||
ginfo("row: %d col: %d npixels: %d\n", row, col, npixels);
|
ginfo("row: %d col: %d npixels: %d\n", row, col, npixels);
|
||||||
DEBUGASSERT(buffer);
|
DEBUGASSERT(buffer);
|
||||||
@@ -452,6 +447,18 @@ static int max7219_putrun(fb_coord_t row, fb_coord_t col,
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get real row position in the strip */
|
||||||
|
|
||||||
|
newrow = (int) (row % 8);
|
||||||
|
|
||||||
|
/* Divide row by 8 */
|
||||||
|
|
||||||
|
row = (row >> 3);
|
||||||
|
|
||||||
|
col = col + (row * MAX7219_XRES);
|
||||||
|
|
||||||
|
row = newrow;
|
||||||
|
|
||||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||||
usrmask = MS_BIT;
|
usrmask = MS_BIT;
|
||||||
#else
|
#else
|
||||||
@@ -464,7 +471,7 @@ static int max7219_putrun(fb_coord_t row, fb_coord_t col,
|
|||||||
usrmask = LS_BIT;
|
usrmask = LS_BIT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fbptr = &priv->fb[row * MAX7219_XSTRIDE];
|
fbptr = &priv->fb[row * MAX7219_XSTRIDE * MAX7219_YSTRIDE];
|
||||||
ptr = fbptr + (col >> 3);
|
ptr = fbptr + (col >> 3);
|
||||||
|
|
||||||
for (i = 0; i < pixlen; i++)
|
for (i = 0; i < pixlen; i++)
|
||||||
@@ -507,7 +514,7 @@ static int max7219_putrun(fb_coord_t row, fb_coord_t col,
|
|||||||
|
|
||||||
/* We need to send last row/column first to avoid mirror image */
|
/* We need to send last row/column first to avoid mirror image */
|
||||||
|
|
||||||
for (i = MAX7219_XSTRIDE; i >= 0; i--)
|
for (i = (MAX7219_XSTRIDE * MAX7219_YSTRIDE) - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
/* Setup the row data */
|
/* Setup the row data */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user