Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
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
11
12#ifndef ZEPHYR_INCLUDE_DISPLAY_CFB_H_
13#define ZEPHYR_INCLUDE_DISPLAY_CFB_H_
14
15#include <zephyr/device.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
31
39
45
54
61
73#define FONT_ENTRY_DEFINE(_name, _width, _height, _caps, _data, _fc, _lc) \
74 static const STRUCT_SECTION_ITERABLE(cfb_font, _name) = { \
75 .data = _data, \
76 .caps = _caps, \
77 .width = _width, \
78 .height = _height, \
79 .first_char = _fc, \
80 .last_char = _lc, \
81 }
82
93int cfb_print(const struct device *dev, const char *const str, int16_t x, int16_t y);
94
107int cfb_draw_text(const struct device *dev, const char *const str, int16_t x, int16_t y);
108
117int cfb_draw_point(const struct device *dev, const struct cfb_position *pos);
118
128int cfb_draw_line(const struct device *dev, const struct cfb_position *start,
129 const struct cfb_position *end);
130
140int cfb_draw_rect(const struct device *dev, const struct cfb_position *start,
141 const struct cfb_position *end);
142
152int cfb_draw_circle(const struct device *dev, const struct cfb_position *start, uint16_t radius);
153
162int cfb_framebuffer_clear(const struct device *dev, bool clear_display);
163
171int cfb_framebuffer_invert(const struct device *dev);
172
184int cfb_invert_area(const struct device *dev, int16_t x, int16_t y,
185 uint16_t width, uint16_t height);
186
195int cfb_framebuffer_finalize(const struct device *dev);
196
205int cfb_get_display_parameter(const struct device *dev,
206 enum cfb_display_param);
207
216int cfb_framebuffer_set_font(const struct device *dev, uint8_t idx);
217
226int cfb_set_kerning(const struct device *dev, int8_t kerning);
227
238int cfb_get_font_size(const struct device *dev, uint8_t idx, uint8_t *width,
239 uint8_t *height);
240
248int cfb_get_numof_fonts(const struct device *dev);
249
257int cfb_framebuffer_init(const struct device *dev);
258
264void cfb_framebuffer_deinit(const struct device *dev);
265
266#ifdef __cplusplus
267}
268#endif
269
273
274#endif /* ZEPHYR_INCLUDE_DISPLAY_CFB_H_ */
Main header file for display driver API.
int cfb_print(const struct device *dev, const char *const str, int16_t x, int16_t y)
Print a string into the framebuffer.
int cfb_invert_area(const struct device *dev, int16_t x, int16_t y, uint16_t width, uint16_t height)
Invert Pixels in selected area.
int cfb_draw_rect(const struct device *dev, const struct cfb_position *start, const struct cfb_position *end)
Draw a rectangle.
int cfb_framebuffer_set_font(const struct device *dev, uint8_t idx)
Set font.
int cfb_draw_circle(const struct device *dev, const struct cfb_position *start, uint16_t radius)
Draw a circle.
int cfb_framebuffer_init(const struct device *dev)
Initialize Character Framebuffer.
cfb_display_param
Definition cfb.h:32
int cfb_draw_text(const struct device *dev, const char *const str, int16_t x, int16_t y)
Print a string into the framebuffer.
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_draw_line(const struct device *dev, const struct cfb_position *start, const struct cfb_position *end)
Draw a line.
int cfb_framebuffer_invert(const struct device *dev)
Invert Pixels.
void cfb_framebuffer_deinit(const struct device *dev)
Deinitialize Character Framebuffer.
int cfb_framebuffer_finalize(const struct device *dev)
Finalize framebuffer and write it to display RAM, invert or reorder pixels if necessary.
int cfb_set_kerning(const struct device *dev, int8_t kerning)
Set font kerning (spacing between individual letters).
int cfb_framebuffer_clear(const struct device *dev, bool clear_display)
Clear framebuffer.
int cfb_draw_point(const struct device *dev, const struct cfb_position *pos)
Draw a point.
cfb_font_caps
Definition cfb.h:40
int cfb_get_display_parameter(const struct device *dev, enum cfb_display_param)
Get display parameter.
@ CFB_DISPLAY_PPT
Definition cfb.h:35
@ CFB_DISPLAY_ROWS
Definition cfb.h:36
@ CFB_DISPLAY_COLS
Definition cfb.h:37
@ CFB_DISPLAY_WIDTH
Definition cfb.h:34
@ CFB_DISPLAY_HEIGHT
Definition cfb.h:33
@ CFB_FONT_MONO_HPACKED
Definition cfb.h:42
@ CFB_FONT_MONO_VPACKED
Definition cfb.h:41
@ CFB_FONT_MSB_FIRST
Definition cfb.h:43
#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:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT8_TYPE__ int8_t
Definition stdint.h:72
__INT16_TYPE__ int16_t
Definition stdint.h:73
Definition cfb.h:46
uint8_t first_char
Definition cfb.h:51
enum cfb_font_caps caps
Definition cfb.h:48
uint8_t last_char
Definition cfb.h:52
uint8_t width
Definition cfb.h:49
const void * data
Definition cfb.h:47
uint8_t height
Definition cfb.h:50
Definition cfb.h:55
int16_t x
X position.
Definition cfb.h:57
int16_t y
Y position.
Definition cfb.h:59
Runtime device structure (in ROM) per driver instance.
Definition device.h:513