2023-10-21 20:27:23 +03:00
|
|
|
|
/**
|
|
|
|
|
* fb.h
|
|
|
|
|
* Заголовок с функциями фреймбуффера
|
|
|
|
|
*
|
|
|
|
|
* Данный заголовочный файл содержит определения которые используются для работы
|
|
|
|
|
* с экранным буффером(фреймбуффером)
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef FB_H
|
|
|
|
|
#define FB_H
|
|
|
|
|
|
2024-01-13 00:00:11 +03:00
|
|
|
|
#include <6x8_slim_font.h>
|
2023-10-31 19:07:15 +03:00
|
|
|
|
#include <arch.h>
|
2023-10-07 18:28:48 +03:00
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <stdint.h>
|
2023-10-29 16:12:00 +03:00
|
|
|
|
#include <tool.h>
|
|
|
|
|
|
2023-10-31 19:07:15 +03:00
|
|
|
|
enum colors {
|
|
|
|
|
WHITE = 0xFFFFFF,
|
|
|
|
|
BLACK = 0x000000,
|
|
|
|
|
RED = 0xFF0000,
|
|
|
|
|
GREEN = 0x00D000,
|
|
|
|
|
PRIMA_GREEN = 0x00FF00,
|
|
|
|
|
BLUE = 0x0000FF,
|
|
|
|
|
DARK_GREEN = 0x013220,
|
|
|
|
|
};
|
|
|
|
|
|
2024-01-13 00:00:11 +03:00
|
|
|
|
extern int fb_init_status;
|
|
|
|
|
extern uint32_t *fb_addr;
|
|
|
|
|
extern uint64_t width;
|
|
|
|
|
extern uint64_t height;
|
2023-10-29 16:12:00 +03:00
|
|
|
|
|
2023-10-31 19:07:15 +03:00
|
|
|
|
#define SCREEN_WIDTH width
|
|
|
|
|
#define SCREEN_HEIGHT height
|
|
|
|
|
#define SCREEN_BUFFER fb_addr
|
|
|
|
|
|
|
|
|
|
void fb_set_text_color(uint32_t color);
|
2023-12-14 11:25:53 +03:00
|
|
|
|
uint32_t fb_get_text_color( );
|
2023-10-21 20:27:23 +03:00
|
|
|
|
void fb_init( );
|
|
|
|
|
void fb_print_buf(size_t x, size_t y, size_t h, size_t w, uint32_t *buf);
|
|
|
|
|
void fb_printf(char *str, ...);
|
|
|
|
|
void fb_printf_at(size_t x, size_t y, char *str, ...);
|
2024-01-13 00:00:11 +03:00
|
|
|
|
void fb_print_bits(size_t x, size_t y, uint8_t num);
|
2023-10-07 18:28:48 +03:00
|
|
|
|
|
2023-10-21 20:27:23 +03:00
|
|
|
|
#endif // fb.h
|