2023-10-21 20:27:23 +03:00
|
|
|
|
/**
|
|
|
|
|
* fb.h
|
|
|
|
|
* Заголовок с функциями фреймбуффера
|
|
|
|
|
*
|
|
|
|
|
* Данный заголовочный файл содержит определения которые используются для работы
|
|
|
|
|
* с экранным буффером(фреймбуффером)
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef FB_H
|
|
|
|
|
#define FB_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,
|
|
|
|
|
};
|
|
|
|
|
|
2023-10-29 16:12:00 +03:00
|
|
|
|
#define GET_TICK_BIG arch_get_tick_b( )
|
|
|
|
|
#define GET_TICK_lOW arch_get_tick_l( )
|
|
|
|
|
|
2023-10-31 19:07:15 +03:00
|
|
|
|
#define SCREEN_WIDTH width
|
|
|
|
|
#define SCREEN_HEIGHT height
|
|
|
|
|
#define SCREEN_BUFFER fb_addr
|
|
|
|
|
|
2023-11-18 15:26:04 +03:00
|
|
|
|
#ifndef NO_DEBUG
|
2023-12-12 21:11:06 +03:00
|
|
|
|
#define LOG(...) \
|
2023-12-17 15:21:27 +03:00
|
|
|
|
fb_printf("[%4u]%s() (%s:%d) ", GET_TICK_BIG, __func__, __FILE__, __LINE__); \
|
2023-10-29 16:12:00 +03:00
|
|
|
|
fb_printf(__VA_ARGS__)
|
2023-11-18 15:26:04 +03:00
|
|
|
|
#else
|
|
|
|
|
#define LOG(...)
|
|
|
|
|
#endif
|
2023-10-07 18:28:48 +03:00
|
|
|
|
|
2023-10-31 19:07:15 +03:00
|
|
|
|
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, ...);
|
2023-10-07 18:28:48 +03:00
|
|
|
|
|
2023-10-21 20:27:23 +03:00
|
|
|
|
#endif // fb.h
|