The font existence is checked at the time of linking,
The check at initialization is no longer necessary.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
Fix the wrong calculation for inverting implemented by
commit 7068587505
("fb: cfb: support inverting with coordinates that do not align
with the tile")
Remove the cfb_invert_area() calling.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Fix the wrong calculation for inverting implemented by
commit 7068587505
("fb: cfb: support inverting with coordinates that do not align
with the tile")
Fixed not enough consideration when the drawing area height
is eight lines or less.
Simplify to XOR calculation.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add the `draw rect` command to execute the `cfb_draw_rect()` API.
This command render rectangle.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
Add the `draw point` command to execute the `cfb_draw_point()` API.
This command render single dot.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
MISRA Rule 5.7 requires uniqueness of tag identifiers. Shell is
frequently problematic because many code uses `const struct shell
*shell`. This causes CI noise every time one of these shell files is
edited, so let's update all of them with `const struct shell *sh`
instead.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Extend the invert command to run cfb_invert_area when given four arguments.
Make a change to invert the screen immediately in case of run invert
without arguments.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
Add the `draw text` command to execute the `cfb_draw_text()` API.
The command is similar to the `print` command. The difference is
`draw text` can render to coordinate that is not on tile boundaries.
The command is not run `cfb_framebuffer_clear()`,
So it allows rendering appendiceal with keeping already drawn image.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
Add cfb_draw_text() API for rendering text.
It is similar to cfb_print(), the difference is cfb_draw_text() accepts
coordinate that is not on tile boundaries and don't wrap the line.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
Implements dot-by-dot font rendering to make cfb_print() able to
draw text even at a coordinate that is not on tile boundaries.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
cfb_print does not modify either address and contents of
the pointer that is pointing drawing text.
Thus, it can add a const modifier.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
cfb_framebuffer_finalize() invert the framebuffer, and it still
leave as inverted after executing the function.
It restores the framebuffer at the end of the cfb_framebuffer_finalize()
for the continued drawing.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
dev and clear_display parameter are unused and only
the framebuffer was cleared. A condition which calls
cfb_framebuffer_fanalize when clear_display is
true is implemented. Then not only the buffer,
but buffer and display are cleared.
Signed-off-by: Dölker Kim <KDoelker@baumer.com>
Using `struct shell *shell` would be more consistent but triggers CI
check on MISRA rule 5.7 "A Tag name shall be a unique identifier"
Signed-off-by: Simon Frank <simon.frank@lohmega.com>
Font kerning was used but it was not possible to change it.
Also, font_idx was set to zero twice in init.
Signed-off-by: Simon Frank <simon.frank@lohmega.com>
Turn off display_blanking to make it able to refresh on a device
even when blanking default off.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.
The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.
NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
In order to bring consistency in-tree, migrate all subsystems code to
the new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The HPACKED fonts are already declared in header.
Extend drawing routine to allow HPACKED fonts
along with VPACKED fonts.
Signed-off-by: Karol Duda <karol.duda@grinn-global.com>
Signed-off-by: Maciej Zagrabski <maciej.zagrabski@grinn-global.com>
Rework samples to use DEVICE_DT_GET and DT_CHOSEN
to get default display controller device.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Font capabilities currently indicate whether font data is packed
horizontally or vertically, and this is used to control frame buffer
updates. The font bit ordering should likewise be recorded in the font
description, and any reversal to match the display applied when text is
being set in the frame buffer.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
ftpr assignment is being done before checking fb->fonts pointer.
Just changing assignment position.
Fixes 23299 [1]
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.
There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.
The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).
Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.
Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.
Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.
The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.
(Everything above is true for choices, menus, and comments as well.)
Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Use this short header style in all Kconfig files:
# <description>
# <copyright>
# <license>
...
Also change all <description>s from
# Kconfig[.extension] - Foo-related options
to just
# Foo-related options
It's clear enough that it's about Kconfig.
The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)
git ls-files '*Kconfig*' | \
xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The content of subsys/fb/cfb_fonts cannot be replicated by the existing
script due to lack of positioning options and use of a full-color frame
buffer, which affects the generated bitmap. Switch to the solution used
in the original script, add the required options, and document the
process of regenerating the fonts.
This commit also determines the required bounding box for the glyphs to
be sure that the user-provided value is sufficient to avoid partial
characters. Ideally the calculated width and height would be used for
font characters, but this would require significant restructuring of the
script to make calculated values available at the point where the
arguments are used to produce output.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The specified order of fields wastes space when the cfb_font_caps enum
isn't packed. Reorder to avoid this behavior.
Also remove the unnecessary array size on the extern symbol declaration,
lest the compiler misinterpret the properties as being zero-length
arrays rather than pointers. (The idiom is already technically
using undefined behavior since we're relying on the linker rather than
the language to produce an array from the individual declarations.)
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
It is planned to deprecate SHELL_CREATE_STATIC_SUBCMD_SET macro
which is replaced by SHELL_STATIC_SUBCMD_SET_CREATE.
Additionally, removed irrelevant comments about alphabetical
ordering which is no longer needed.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>