Skip to content

Commit ed0c18c

Browse files
TimJTiAlan C. Assis
authored andcommitted
drivers/video/fb.c: Add startup splashscreen option
Adds Kconfig-selected splashscreen options used when the driver is first registered * Includes a new Python script in ./tools to create RLE bitmap files * Includes default NS logo btimaps in 320x320, 160x160 and 80x80 resolutions along with their PNG files Signed-off-by: Tim Hardisty [email protected]>
1 parent b333ad3 commit ed0c18c

File tree

14 files changed

+614428
-69
lines changed

14 files changed

+614428
-69
lines changed

drivers/video/Kconfig

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,102 @@ config VIDEO_FB_NPOLLWAITERS
5656
depends on VIDEO_FB
5757
default 2
5858

59+
config VIDEO_FB_SPLASHSCREEN
60+
bool "Enable Splashscreen when Framebuffer Driver is registered"
61+
depends on VIDEO_FB
62+
default n
63+
---help---
64+
This feature allows a splashscreen image to be displayed during the
65+
Framebuffer device driver register function. It provides the following
66+
functionality:
67+
- Choice of 80x80, 160x160 or 320x320 default "NX" logos
68+
- Alternative "out-of-tree" image as splashscreen
69+
- Configurable background colour (default black)
70+
- Bit-per-pixel choice (32/24/16/8/Greyscale/Mono) to suit the LCD used
71+
- Splashscreen can be set to remain displayed for 'n' seconds ('n' can be 0)
72+
- Splashscreen can be cleared (to black) once framebuffer device register is
73+
complete
74+
- Python "splashscreen_converter.py" tool (in NuttX tools directory) can be used
75+
to create custom splashscreens - note the tool restricts the number of colours
76+
to 256.
77+
78+
79+
if VIDEO_FB_SPLASHSCREEN
80+
81+
menu "Splashscreen Image Selection and Configuration"
82+
83+
choice
84+
prompt "Select Splashscreen Image Source"
85+
default VIDEO_FB_SPLASHSCREEN_NXLOGO
86+
87+
config VIDEO_FB_SPLASHSCREEN_NXLOGO
88+
bool "Use default NuttX NX Logo"
89+
90+
config VIDEO_FB_SPLASHSCREEN_CUSTOM
91+
bool "Use Custom file as splashscreen"
92+
---help---
93+
This must be a compiled C source file, such as fb_splash.o, created
94+
as a c src file using the splashscreen_converter.py Python script,
95+
available in the nuttx/tools directory, and compiled as part of the
96+
build.
97+
Typically this would be a source file of an out-of-tree custom board.
98+
99+
endchoice
100+
101+
choice
102+
prompt "Select NXlogo bitmap size to use"
103+
default VIDEO_FB_SPLASHSCREEN_NXLOGO_160
104+
depends on VIDEO_FB_SPLASHSCREEN_NXLOGO
105+
106+
config VIDEO_FB_SPLASHSCREEN_NXLOGO_320
107+
bool "320x320 pixels"
108+
109+
config VIDEO_FB_SPLASHSCREEN_NXLOGO_160
110+
bool "160x160 pixels"
111+
112+
config VIDEO_FB_SPLASHSCREEN_NXLOGO_80
113+
bool "80x80 pixels"
114+
endchoice
115+
116+
choice
117+
prompt "Select Splashscreen Bits-per-pixel (BPP)"
118+
default VIDEO_FB_SPLASHSCREEN_BPP32
119+
120+
config VIDEO_FB_SPLASHSCREEN_BPP32
121+
bool "32BPP (ARGB)"
122+
123+
config VIDEO_FB_SPLASHSCREEN_BPP24
124+
bool "24BPP (RGB)"
125+
126+
config VIDEO_FB_SPLASHSCREEN_BPP16
127+
bool "16BPP (RGB565)"
128+
129+
config VIDEO_FB_SPLASHSCREEN_MONO
130+
bool "Monochrome"
131+
132+
config VIDEO_FB_SPLASHSCREEN_GREY
133+
bool "Greyscale (8BPP)"
134+
135+
endchoice
136+
137+
config VIDEO_FB_SPLASHSCREEN_BG_COLOUR
138+
hex "Hex (A)RGB background colour for splashscreen"
139+
default 0
140+
---help---
141+
default is black
142+
143+
config VIDEO_FB_SPLASHSCREEN_DISP_TIME
144+
int "Time to sleep once Splashscreen displayed"
145+
default 1
146+
147+
config VIDEO_FB_SPLASHSCREEN_CLR_ON_EXIT
148+
bool "Clear Framebuffer memory when driver registration is complete"
149+
default y
150+
151+
endmenu # "Splashscreen Image Selection and Configuration"
152+
153+
endif # VIDEO_FB_SPLASHSCREEN
154+
59155
config VIDEO_STREAM
60156
bool "Video Stream Support"
61157
default n

drivers/video/Make.defs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ ifeq ($(CONFIG_VIDEO_STREAM),y)
3232
CSRCS += v4l2_core.c video_framebuff.c v4l2_cap.c v4l2_m2m.c
3333
endif
3434

35+
ifeq ($(CONFIG_VIDEO_FB_SPLASHSCREEN),y)
36+
ifeq ($(CONFIG_VIDEO_FB_SPLASHSCREEN_NXLOGO),y)
37+
ifeq ($(CONFIG_VIDEO_FB_SPLASHSCREEN_NXLOGO_320),y)
38+
CSRCS += nxlogo320.c
39+
else ifeq ($(CONFIG_VIDEO_FB_SPLASHSCREEN_NXLOGO_160),y)
40+
CSRCS += nxlogo160.c
41+
else
42+
CSRCS += nxlogo80.c
43+
endif
44+
endif
45+
endif
46+
3547
# These video drivers depend on I2C support
3648

3749
ifeq ($(CONFIG_I2C),y)

0 commit comments

Comments
 (0)