PatchworkOS
c9fea19
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
fb.h
Go to the documentation of this file.
1
#ifndef _SYS_FB_H
2
#define _SYS_FB_H 1
3
4
#include <
stdint.h
>
5
#include <
sys/io.h
>
6
7
/**
8
* @brief Framebuffer device header.
9
* @ingroup libstd
10
* @defgroup libstd_sys_fb Framebuffer device
11
*
12
* The `sys/fb.h` header defines structs and constants used by framebuffer devices, for example `/dev/fb0`. The primary
13
* way to use a framebuffer device is to first use `IOCTL_FB_INFO` to retrieve its width and height, then factoring in
14
* its format to get the total size in bytes of the framebuffer and finally using `mmap` to map it to the currently
15
* running processes address space.
16
*
17
* @{
18
*/
19
20
/**
21
* @brief Framebuffer format enum.
22
*
23
* The `fb_format_t` enum specified the format of the pixel data in a framebuffer. All byte orders are specified in
24
* little-endian.
25
*
26
*/
27
typedef
enum
28
{
29
FB_ARGB32
,
30
}
fb_format_t
;
31
32
/**
33
* @brief Framebuffer info struct.
34
*
35
* The `fb_info_t` struct stores information about a framebuffer and is retrieved by reading a `/dev/fb/[id]/info` file.
36
*
37
*/
38
typedef
struct
39
{
40
uint64_t
width
;
41
uint64_t
height
;
42
uint64_t
stride
;
43
fb_format_t
format
;
44
char
name[
MAX_NAME
];
45
}
fb_info_t
;
46
47
#endif
48
49
/** @} */
MAX_NAME
#define MAX_NAME
Maximum length of names.
Definition
MAX_NAME.h:11
fb_format_t
fb_format_t
Framebuffer format enum.
Definition
fb.h:28
FB_ARGB32
@ FB_ARGB32
Definition
fb.h:29
io.h
stdint.h
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
fb_info_t
Framebuffer info struct.
Definition
fb.h:39
fb_info_t::width
uint64_t width
Definition
fb.h:40
fb_info_t::format
fb_format_t format
Definition
fb.h:43
fb_info_t::stride
uint64_t stride
Definition
fb.h:42
fb_info_t::height
uint64_t height
Definition
fb.h:41
include
libstd
sys
fb.h
Generated on Mon Dec 15 2025 05:10:34 for PatchworkOS by
1.9.8