Skip to content

Commit c3aa94f

Browse files
VynDragonfabiobaltieri
authored andcommitted
drivers: display: Introduce Greyscale pixel format
This introduces greyscale Luminance 8 pixel format Signed-off-by: Camille BAUD <mail@massdriver.space>
1 parent ee9d6b7 commit c3aa94f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

include/zephyr/drivers/display.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ enum display_pixel_format {
4646
PIXEL_FORMAT_ARGB_8888 = BIT(3), /**< 32-bit ARGB */
4747
PIXEL_FORMAT_RGB_565 = BIT(4), /**< 16-bit RGB */
4848
PIXEL_FORMAT_BGR_565 = BIT(5), /**< 16-bit BGR */
49+
PIXEL_FORMAT_L_8 = BIT(6), /**< 8-bit Grayscale/Luminance, equivalent to */
50+
/**< GRAY, GREY, GRAY8, Y8, R8, etc... */
4951
};
5052

5153
/**
@@ -61,7 +63,8 @@ enum display_pixel_format {
6163
(((fmt & PIXEL_FORMAT_MONO10) >> 2) * 1U) + \
6264
(((fmt & PIXEL_FORMAT_ARGB_8888) >> 3) * 32U) + \
6365
(((fmt & PIXEL_FORMAT_RGB_565) >> 4) * 16U) + \
64-
(((fmt & PIXEL_FORMAT_BGR_565) >> 5) * 16U))
66+
(((fmt & PIXEL_FORMAT_BGR_565) >> 5) * 16U) + \
67+
(((fmt & PIXEL_FORMAT_L_8) >> 6) * 8U))
6568

6669
/**
6770
* @brief Display screen information

include/zephyr/dt-bindings/display/panel.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@
2323
* since enum definitions are not supported by devicetree tooling.
2424
*/
2525

26-
#define PANEL_PIXEL_FORMAT_RGB_888 (0x1 << 0)
27-
#define PANEL_PIXEL_FORMAT_MONO01 (0x1 << 1) /* 0=Black 1=White */
28-
#define PANEL_PIXEL_FORMAT_MONO10 (0x1 << 2) /* 1=Black 0=White */
29-
#define PANEL_PIXEL_FORMAT_ARGB_8888 (0x1 << 3)
30-
#define PANEL_PIXEL_FORMAT_RGB_565 (0x1 << 4)
31-
#define PANEL_PIXEL_FORMAT_BGR_565 (0x1 << 5)
26+
#define PANEL_PIXEL_FORMAT_RGB_888 (0x1 << 0)
27+
#define PANEL_PIXEL_FORMAT_MONO01 (0x1 << 1) /* 0=Black 1=White */
28+
#define PANEL_PIXEL_FORMAT_MONO10 (0x1 << 2) /* 1=Black 0=White */
29+
#define PANEL_PIXEL_FORMAT_ARGB_8888 (0x1 << 3)
30+
#define PANEL_PIXEL_FORMAT_RGB_565 (0x1 << 4)
31+
#define PANEL_PIXEL_FORMAT_BGR_565 (0x1 << 5)
32+
#define PANEL_PIXEL_FORMAT_L_8 (0x1 << 6)
3233

3334
/**
3435
* @}

0 commit comments

Comments
 (0)