Skip to content

Commit

Permalink
fb: cfb: Changed library name to Compact framebuffer
Browse files Browse the repository at this point in the history
CFB was an abbreviation for Character Framebuffer.
However, it currently supports characters and graphic drawing,
so it has become far from actual.

However, since there are only a few API changes, I don't want to
change symbol names, etc.
Therefore, we will keep the abbreviation CFB and change the name
to `Compact Framebuffer`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
  • Loading branch information
soburi committed May 5, 2024
1 parent 351d041 commit 3cce0ea
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 81 deletions.
6 changes: 3 additions & 3 deletions doc/hardware/peripherals/display/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ BBC micro:bit Display

.. doxygengroup:: mb_display

Monochrome Character Framebuffer
================================
Compact Framebuffer APIs
========================

.. doxygengroup:: monochrome_character_framebuffer
.. doxygengroup:: compact_framebuffer_subsystem
7 changes: 4 additions & 3 deletions include/zephyr/display/cfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/**
* @file
* @brief Public Monochrome Character Framebuffer API
* @brief Compact FrameBuffer (CFB) API
*/

#ifndef __CFB_H__
Expand All @@ -22,8 +22,9 @@ extern "C" {
#endif

/**
* @brief Public Monochrome Character Framebuffer API
* @defgroup monochrome_character_framebuffer Monochrome Character Framebuffer
* @brief The Compact Framebuffer (CFB) subsystem provides fundamental graphics
* functionality with low memory consumption and footprint size.
* @defgroup compact_framebuffer_subsystem Compact FrameBuffer subsystem
* @ingroup utilities
* @{
*/
Expand Down
2 changes: 1 addition & 1 deletion samples/boards/reel_board/mesh_badge/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ CONFIG_SPI_ASYNC=y
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_DISPLAY=y

CONFIG_CHARACTER_FRAMEBUFFER=y
CONFIG_CFB=y

CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
Expand Down
2 changes: 1 addition & 1 deletion samples/subsys/display/cfb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

mainmenu "CFB Sample Application"

config CHARACTER_FRAMEBUFFER_SAMPLE_TRANSFER_BUFFER_SIZE
config CFB_SAMPLE_TRANSFER_BUFFER_SIZE
int "Buffer size for image transfer"
default 0
help
Expand Down
16 changes: 8 additions & 8 deletions samples/subsys/display/cfb/README.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.. zephyr:code-sample:: character-frame-buffer
:name: Character frame buffer
:relevant-api: monochrome_character_framebuffer
.. zephyr:code-sample:: cfb-sample
:name: Compact Framebuffer subsystem sample
:relevant-api: compact_framebuffer_subsystem

Display character strings using the Character Frame Buffer (CFB).
Display character strings using the Compact Framebuffer (CFB) subsystem.

Overview
********

This sample displays character strings using the Character Frame Buffer
(CFB) subsystem framework.
This sample displays character strings using the Compact Framebuffer
(CFB) subsystem.

Requirements
************

This sample requires a supported board and CFB-supporting
display, such as the :ref:`reel_board`.
This sample requires a board that have a display,
such as the :ref:`reel_board`.

Building and Running
********************
Expand Down
2 changes: 1 addition & 1 deletion samples/subsys/display/cfb/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ CONFIG_DISPLAY=y
CONFIG_LOG=y

CONFIG_CFB_LOG_LEVEL_DBG=y
CONFIG_CHARACTER_FRAMEBUFFER=y
CONFIG_CFB=y
2 changes: 1 addition & 1 deletion samples/subsys/display/cfb/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ common:
harness: display
tags: display
sample:
description: Character framebuffer test
description: Compact Framebuffer Subsystem test
name: cfb sample
tests:
sample.display.cfb.ssd1306:
Expand Down
8 changes: 4 additions & 4 deletions samples/subsys/display/cfb/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <zephyr/display/cfb.h>
#include <stdio.h>

#if CONFIG_CHARACTER_FRAMEBUFFER_SAMPLE_TRANSFER_BUFFER_SIZE != 0
static uint8_t transfer_buffer[CONFIG_CHARACTER_FRAMEBUFFER_SAMPLE_TRANSFER_BUFFER_SIZE];
#if CONFIG_CFB_SAMPLE_TRANSFER_BUFFER_SIZE != 0
static uint8_t transfer_buffer[CONFIG_CFB_SAMPLE_TRANSFER_BUFFER_SIZE];
#endif

int main(void)
Expand All @@ -24,7 +24,7 @@ int main(void)
uint8_t ppt;
uint8_t font_width;
uint8_t font_height;
#if CONFIG_CHARACTER_FRAMEBUFFER_SAMPLE_TRANSFER_BUFFER_SIZE != 0
#if CONFIG_CFB_SAMPLE_TRANSFER_BUFFER_SIZE != 0
static struct cfb_display display;
struct cfb_display_init_param param = {
.dev = dev,
Expand All @@ -40,7 +40,7 @@ int main(void)

printf("Initialized %s\n", dev->name);

#if CONFIG_CHARACTER_FRAMEBUFFER_SAMPLE_TRANSFER_BUFFER_SIZE != 0
#if CONFIG_CFB_SAMPLE_TRANSFER_BUFFER_SIZE != 0
disp = &display;
if (cfb_display_init(disp, &param)) {
printf("Framebuffer initialization failed!\n");
Expand Down
2 changes: 1 addition & 1 deletion samples/subsys/display/cfb_custom_font/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

mainmenu "CFB Custom Font Sample Application"

config CHARACTER_FRAMEBUFFER_CUSTOM_FONT_SAMPLE_TRANSFER_BUFFER_SIZE
config CFB_CUSTOM_FONT_SAMPLE_TRANSFER_BUFFER_SIZE
int "Buffer size for image transfer"
default 0

Expand Down
15 changes: 5 additions & 10 deletions samples/subsys/display/cfb_custom_font/README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.. zephyr:code-sample:: cfb-custom-fonts
:name: Custom fonts
:relevant-api: monochrome_character_framebuffer
:name: CFB Custom fonts
:relevant-api: compact_framebuffer_subsystem

Generate and use a custom font.

Overview
********
A simple example showing how to generate Character Framebuffer (CFB)
font headers automatically at build time.
A simple example showing how to generate Compact Framebuffer (CFB)
subsystem font headers automatically at build time.

This example generates a font with font elements for 6 sided dice from
a PNG image, and then uses the generated header (``cfb_font_dice.h``)
Expand All @@ -25,12 +25,7 @@ directory:
- :file:`prj.conf`
Generic config file, normally you should use this.

- :file:`boards/reel_board.conf`
This overlay config enables support for SSD16XX display controller
on the reel_board.


Example building for the reel_board with SSD16XX display support:
Example building for the reel_board:

.. zephyr-app-commands::
:zephyr-app: samples/subsys/display/cfb_custom_font
Expand Down
4 changes: 2 additions & 2 deletions samples/subsys/display/cfb_custom_font/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ CONFIG_HEAP_MEM_POOL_SIZE=16384

CONFIG_DISPLAY=y

CONFIG_CHARACTER_FRAMEBUFFER=y
CONFIG_CHARACTER_FRAMEBUFFER_USE_DEFAULT_FONTS=n
CONFIG_CFB=y
CONFIG_CFB_USE_DEFAULT_FONTS=n
4 changes: 2 additions & 2 deletions samples/subsys/display/cfb_custom_font/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ common:
harness: display
tags: display
sample:
description: Custom character framebuffer font example
name: cfb custom font sample
description: Compact Framebuffer subsystem font example
name: CFB custom font sample
tests:
sample.display.cfb_custom_font.ssd16xx:
platform_allow: reel_board
8 changes: 4 additions & 4 deletions samples/subsys/display/cfb_custom_font/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

#include "cfb_font_dice.h"

#if CONFIG_CHARACTER_FRAMEBUFFER_CUSTOM_FONT_SAMPLE_TRANSFER_BUFFER_SIZE != 0
static uint8_t transfer_buffer[CONFIG_CHARACTER_FRAMEBUFFER_CUSTOM_FONT_SAMPLE_TRANSFER_BUFFER_SIZE];
#if CONFIG_CFB_CUSTOM_FONT_SAMPLE_TRANSFER_BUFFER_SIZE != 0
static uint8_t transfer_buffer[CONFIG_CFB_CUSTOM_FONT_SAMPLE_TRANSFER_BUFFER_SIZE];
#endif

int main(void)
Expand All @@ -21,7 +21,7 @@ int main(void)
struct cfb_display *disp;
struct cfb_framebuffer *fb;
int err;
#if CONFIG_CHARACTER_FRAMEBUFFER_CUSTOM_FONT_SAMPLE_TRANSFER_BUFFER_SIZE != 0
#if CONFIG_CFB_CUSTOM_FONT_SAMPLE_TRANSFER_BUFFER_SIZE != 0
struct cfb_display display;
struct cfb_display_init_param param = {
.dev = dev,
Expand All @@ -39,7 +39,7 @@ int main(void)
return 0;
}

#if CONFIG_CHARACTER_FRAMEBUFFER_CUSTOM_FONT_SAMPLE_TRANSFER_BUFFER_SIZE != 0
#if CONFIG_CFB_CUSTOM_FONT_SAMPLE_TRANSFER_BUFFER_SIZE != 0
disp = &display;
err = cfb_display_init(disp, &param);
if (err) {
Expand Down
14 changes: 6 additions & 8 deletions samples/subsys/display/cfb_shell/README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.. zephyr:code-sample:: cfb-shell-sample
:name: Character Framebuffer shell module
:relevant-api: monochrome_character_framebuffer
:name: Compact Framebuffer Subsystem shell module
:relevant-api: compact_framebuffer_subsystem

Use the CFB shell module to interact with a monochrome display.
Use the CFB shell module to interact with a display.

Overview
********
This is a simple shell module that exercises displays using the Character
Framebuffer subsystem.
This is a simple shell module that exercises displays using the Compact
Framebuffer (CFB) subsystem.

Building and Running
********************
Expand All @@ -25,9 +25,7 @@ Shell Module Command Help

.. code-block:: console
cfb - Character Framebuffer shell commands
Options:
-h, --help :Show command help.
cfb - Compact Framebuffer Subsystem shell commands
Subcommands:
init :[none]
get_device :[none]
Expand Down
4 changes: 2 additions & 2 deletions samples/subsys/display/cfb_shell/prj.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CONFIG_BOOT_BANNER=n
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_DISPLAY=y
CONFIG_CHARACTER_FRAMEBUFFER=y
CONFIG_CFB=y
CONFIG_SHELL=y
CONFIG_CHARACTER_FRAMEBUFFER_SHELL=y
CONFIG_CFB_SHELL=y
4 changes: 2 additions & 2 deletions samples/subsys/display/cfb_shell/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ common:
harness: display
tags: display
sample:
description: Character framebuffer shell test
name: cfb shell sample
description: Compact Framebuffer subsystem shell test
name: CFB shell sample
tests:
sample.display.cfb_shell.ssd1306:
platform_allow: frdm_k64f
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/gen_cfb_font_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def parse_args():
"""Parse arguments"""
global args
parser = argparse.ArgumentParser(
description="Character Frame Buffer (CFB) font header file generator",
description="Compact Framebuffer (CFB) subsystem font header file generator",
formatter_class=argparse.RawDescriptionHelpFormatter, allow_abbrev=False)

parser.add_argument(
Expand Down
8 changes: 4 additions & 4 deletions subsys/fb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_sources_ifdef(CONFIG_CHARACTER_FRAMEBUFFER cfb.c)
zephyr_sources_ifdef(CONFIG_CHARACTER_FRAMEBUFFER_USE_DEFAULT_FONTS cfb_fonts.c)
zephyr_sources_ifdef(CONFIG_CHARACTER_FRAMEBUFFER_SHELL cfb_shell.c)
zephyr_sources_ifdef(CONFIG_CFB cfb.c)
zephyr_sources_ifdef(CONFIG_CFB_USE_DEFAULT_FONTS cfb_fonts.c)
zephyr_sources_ifdef(CONFIG_CFB_SHELL cfb_shell.c)

zephyr_linker_sources_ifdef(CONFIG_CHARACTER_FRAMEBUFFER DATA_SECTIONS check_cfb_fonts.ld)
zephyr_linker_sources_ifdef(CONFIG_CFB DATA_SECTIONS check_cfb_fonts.ld)
22 changes: 11 additions & 11 deletions subsys/fb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
# Copyright (c) 2018 Phytec Messtechnik GmbH
# SPDX-License-Identifier: Apache-2.0

menuconfig CHARACTER_FRAMEBUFFER
bool "Character framebuffer for dot matrix displays"
menuconfig CFB
bool "Compact framebuffer subsystem"
help
Character framebuffer for dot matrix displays.
Compact graphics subsystem for systems with tiny memory.

if CHARACTER_FRAMEBUFFER
if CFB

config CHARACTER_FRAMEBUFFER_USE_DEFAULT_FONTS
config CFB_USE_DEFAULT_FONTS
bool "Use default fonts"
default y
help
Use default fonts.

config CHARACTER_FRAMEBUFFER_SHELL
bool "Character Framebuffer shell"
config CFB_SHELL
bool "Compact Framebuffer shell"
depends on SHELL
help
Activate shell module that provides Framebuffer commands to the
console.

if CHARACTER_FRAMEBUFFER_SHELL
if CFB_SHELL

config CHARACTER_FRAMEBUFFER_SHELL_TRANSFER_BUFFER_SIZE
config CFB_SHELL_TRANSFER_BUFFER_SIZE
int "Set size of buffer for image transfer"
default 0
help
Dynamically allocate display object if set 0

config CHARACTER_FRAMEBUFFER_SHELL_COMMAND_BUFFER_SIZE
config CFB_SHELL_COMMAND_BUFFER_SIZE
int "Set size of buffer for store commands"
default 0

Expand All @@ -41,4 +41,4 @@ module = CFB
module-str = cfb
source "subsys/logging/Kconfig.template.log_config"

endif # CHARACTER_FRAMEBUFFER
endif # CFB
19 changes: 9 additions & 10 deletions subsys/fb/cfb_shell.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @file
* @brief Monochrome Character Framebuffer shell module
* @brief Compact Framebuffer Subsystem shell module
*
* Provide some Character Framebuffer shell commands that can be useful for
* testing.
* Provide some Compact Framebuffer Subsystem shell commands that can be
* useful for testing.
*/

/*
Expand Down Expand Up @@ -74,10 +74,10 @@ static const char * const param_name[] = {
static const char *const pixfmt_name[] = {"RGB_888", "MONO01", "MONO10",
"ARGB_8888", "RGB_565", "BGR_565"};

#if CONFIG_CHARACTER_FRAMEBUFFER_SHELL_TRANSFER_BUFFER_SIZE != 0
#if CONFIG_CFB_SHELL_TRANSFER_BUFFER_SIZE != 0
static struct cfb_display display;
static uint8_t transfer_buffer[CONFIG_CHARACTER_FRAMEBUFFER_SHELL_TRANSFER_BUFFER_SIZE];
static uint8_t command_buffer[CONFIG_CHARACTER_FRAMEBUFFER_SHELL_COMMAND_BUFFER_SIZE];
static uint8_t transfer_buffer[CONFIG_CFB_SHELL_TRANSFER_BUFFER_SIZE];
static uint8_t command_buffer[CONFIG_CFB_SHELL_COMMAND_BUFFER_SIZE];
#endif

static int cmd_clear(const struct shell *sh, size_t argc, char *argv[])
Expand Down Expand Up @@ -723,7 +723,7 @@ static int cmd_init(const struct shell *sh, size_t argc, char *argv[])
struct display_capabilities cfg;
int err;

#if CONFIG_CHARACTER_FRAMEBUFFER_SHELL_TRANSFER_BUFFER_SIZE != 0
#if CONFIG_CFB_SHELL_TRANSFER_BUFFER_SIZE != 0
struct cfb_display_init_param param = {
.dev = dev,
.transfer_buf = transfer_buffer,
Expand All @@ -744,7 +744,7 @@ static int cmd_init(const struct shell *sh, size_t argc, char *argv[])
return err;
}

#if CONFIG_CHARACTER_FRAMEBUFFER_SHELL_TRANSFER_BUFFER_SIZE != 0
#if CONFIG_CFB_SHELL_TRANSFER_BUFFER_SIZE != 0
disp = &display;
if (cfb_display_init(disp, &param)) {
printf("Framebuffer initialization failed!\n");
Expand Down Expand Up @@ -817,5 +817,4 @@ SHELL_STATIC_SUBCMD_SET_CREATE(cfb_cmds,
SHELL_SUBCMD_SET_END
);

SHELL_CMD_REGISTER(cfb, &cfb_cmds, "Character Framebuffer shell commands",
NULL);
SHELL_CMD_REGISTER(cfb, &cfb_cmds, "Compact Framebuffer Subsystem shell commands", NULL);
4 changes: 2 additions & 2 deletions tests/subsys/display/cfb/basic/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

CONFIG_ZTEST=y
CONFIG_DISPLAY=y
CONFIG_CHARACTER_FRAMEBUFFER=y
CONFIG_CHARACTER_FRAMEBUFFER_USE_DEFAULT_FONTS=n
CONFIG_CFB=y
CONFIG_CFB_USE_DEFAULT_FONTS=n

CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_LOG=y

0 comments on commit 3cce0ea

Please sign in to comment.