Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
cfb.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 PHYTEC Messtechnik GmbH
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12#ifndef __CFB_H__
13#define __CFB_H__
14
15#include <device.h>
16#include <drivers/display.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
42};
43
48};
49
50struct cfb_font {
51 const void *data;
57};
58
70#define FONT_ENTRY_DEFINE(_name, _width, _height, _caps, _data, _fc, _lc) \
71 static const STRUCT_SECTION_ITERABLE(cfb_font, _name) = { \
72 .data = _data, \
73 .caps = _caps, \
74 .width = _width, \
75 .height = _height, \
76 .first_char = _fc, \
77 .last_char = _lc, \
78 }
79
90int cfb_print(const struct device *dev, char *str, uint16_t x, uint16_t y);
91
100int cfb_framebuffer_clear(const struct device *dev, bool clear_display);
101
109int cfb_framebuffer_invert(const struct device *dev);
110
119int cfb_framebuffer_finalize(const struct device *dev);
120
129int cfb_get_display_parameter(const struct device *dev,
130 enum cfb_display_param);
131
140int cfb_framebuffer_set_font(const struct device *dev, uint8_t idx);
141
152int cfb_get_font_size(const struct device *dev, uint8_t idx, uint8_t *width,
153 uint8_t *height);
154
162int cfb_get_numof_fonts(const struct device *dev);
163
171int cfb_framebuffer_init(const struct device *dev);
172
173#ifdef __cplusplus
174}
175#endif
176
181#endif /* __CFB_H__ */
Public API for display drivers and applications.
int cfb_framebuffer_set_font(const struct device *dev, uint8_t idx)
Set font.
int cfb_framebuffer_init(const struct device *dev)
Initialize Character Framebuffer.
cfb_display_param
Definition: cfb.h:36
int cfb_get_numof_fonts(const struct device *dev)
Get number of fonts.
int cfb_get_font_size(const struct device *dev, uint8_t idx, uint8_t *width, uint8_t *height)
Get font size.
int cfb_framebuffer_invert(const struct device *dev)
Invert Pixels.
int cfb_framebuffer_finalize(const struct device *dev)
Finalize framebuffer and write it to display RAM, invert or reorder pixels if necessary.
int cfb_framebuffer_clear(const struct device *dev, bool clear_display)
Clear framebuffer.
int cfb_print(const struct device *dev, char *str, uint16_t x, uint16_t y)
Print a string into the framebuffer.
cfb_font_caps
Definition: cfb.h:44
int cfb_get_display_parameter(const struct device *dev, enum cfb_display_param)
Get display parameter.
@ CFB_DISPLAY_PPT
Definition: cfb.h:39
@ CFB_DISPLAY_ROWS
Definition: cfb.h:40
@ CFB_DISPLAY_HEIGH
Definition: cfb.h:37
@ CFB_DISPLAY_COLS
Definition: cfb.h:41
@ CFB_DISPLAY_WIDTH
Definition: cfb.h:38
@ CFB_FONT_MONO_HPACKED
Definition: cfb.h:46
@ CFB_FONT_MONO_VPACKED
Definition: cfb.h:45
@ CFB_FONT_MSB_FIRST
Definition: cfb.h:47
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition: util_macro.h:44
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
Definition: cfb.h:50
uint8_t first_char
Definition: cfb.h:55
enum cfb_font_caps caps
Definition: cfb.h:52
uint8_t last_char
Definition: cfb.h:56
uint8_t width
Definition: cfb.h:53
const void * data
Definition: cfb.h:51
uint8_t height
Definition: cfb.h:54
Runtime device structure (in ROM) per driver instance.
Definition: device.h:367