Skip to content

Commit 8d33afd

Browse files
committed
video: hm01b0: add VIDEO_PIX_FMT_Y4
added it to video.h added it to formats table Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
1 parent 503e7b1 commit 8d33afd

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

drivers/video/hm01b0.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ enum hm01b0_resolution {
5757
RESOLUTION_164x122,
5858
RESOLUTION_326x244,
5959
RESOLUTION_326x324,
60+
RESOLUTION_164x122_Y4,
61+
RESOLUTION_326x244_Y4,
62+
RESOLUTION_326x324_Y4,
6063
RESOLUTION_164x122_BAYER,
6164
RESOLUTION_326x244_BAYER,
6265
RESOLUTION_326x324_BAYER,
@@ -96,6 +99,9 @@ struct video_reg *hm01b0_init_regs[] = {
9699
[RESOLUTION_164x122] = hm01b0_160x120_regs,
97100
[RESOLUTION_326x244] = hm01b0_320x240_regs,
98101
[RESOLUTION_326x324] = hm01b0_320x320_regs,
102+
[RESOLUTION_164x122_Y4] = hm01b0_160x120_regs,
103+
[RESOLUTION_326x244_Y4] = hm01b0_320x240_regs,
104+
[RESOLUTION_326x324_Y4] = hm01b0_320x320_regs,
99105
[RESOLUTION_164x122_BAYER] = hm01b0_160x120_regs,
100106
[RESOLUTION_326x244_BAYER] = hm01b0_320x240_regs,
101107
[RESOLUTION_326x324_BAYER] = hm01b0_320x320_regs,
@@ -141,6 +147,9 @@ static const struct video_format_cap hm01b0_fmts[] = {
141147
HM01B0_VIDEO_FORMAT_CAP(164, 122, VIDEO_PIX_FMT_GREY),
142148
HM01B0_VIDEO_FORMAT_CAP(326, 244, VIDEO_PIX_FMT_GREY),
143149
HM01B0_VIDEO_FORMAT_CAP(326, 324, VIDEO_PIX_FMT_GREY),
150+
HM01B0_VIDEO_FORMAT_CAP(164, 122, VIDEO_PIX_FMT_Y4),
151+
HM01B0_VIDEO_FORMAT_CAP(326, 324, VIDEO_PIX_FMT_Y4),
152+
HM01B0_VIDEO_FORMAT_CAP(326, 244, VIDEO_PIX_FMT_Y4),
144153
HM01B0_VIDEO_FORMAT_CAP(164, 122, VIDEO_PIX_FMT_SBGGR8),
145154
HM01B0_VIDEO_FORMAT_CAP(326, 324, VIDEO_PIX_FMT_SBGGR8),
146155
HM01B0_VIDEO_FORMAT_CAP(326, 244, VIDEO_PIX_FMT_SBGGR8),

include/zephyr/drivers/video.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,15 @@ int video_estimate_fmt_size(struct video_format *fmt);
13381338
*/
13391339
#define VIDEO_PIX_FMT_GREY VIDEO_FOURCC('G', 'R', 'E', 'Y')
13401340

1341+
1342+
/**
1343+
* @code{.unparsed}
1344+
* 0 1 2 3 3 2 1 0
1345+
* | 0000Yyyy | 0000Yyyy | 0000Yyyy | 0000Yyyy | 0000Yyyy | ...
1346+
* @endcode
1347+
*/
1348+
#define VIDEO_PIX_FMT_Y4 VIDEO_FOURCC('Y', '0', '4', ' ') /* 4 Greyscale */
1349+
13411350
/**
13421351
* @code{.unparsed}
13431352
* 0 1 2 3 3 2 1 0
@@ -1853,6 +1862,7 @@ static inline unsigned int video_bits_per_pixel(uint32_t pixfmt)
18531862
case VIDEO_PIX_FMT_Y16:
18541863
case VIDEO_PIX_FMT_NV16:
18551864
case VIDEO_PIX_FMT_NV61:
1865+
case VIDEO_PIX_FMT_Y4:
18561866
return 16;
18571867
case VIDEO_PIX_FMT_BGR24:
18581868
case VIDEO_PIX_FMT_RGB24:

0 commit comments

Comments
 (0)