1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
#ifndef __MTK_FB_CONSOLE_H__
#define __MTK_FB_CONSOLE_H__
#ifdef __cplusplus
extern "C" {
#endif
#define MFC_CHECK_RET(expr) \
do { \
MFC_STATUS ret = (expr); \
ASSERT(MFC_STATUS_OK == ret); \
} while (0)
typedef enum
{
MFC_STATUS_OK = 0,
MFC_STATUS_INVALID_ARGUMENT = -1,
MFC_STATUS_NOT_IMPLEMENTED = -2,
MFC_STATUS_OUT_OF_MEMORY = -3,
MFC_STATUS_LOCK_FAIL = -4,
MFC_STATUS_FATAL_ERROR = -5,
} MFC_STATUS;
typedef void* MFC_HANDLE;
// ---------------------------------------------------------------------------
typedef struct
{
struct semaphore sem;
UINT8 *fb_addr;
UINT32 fb_width;
UINT32 fb_height;
UINT32 fb_bpp;
UINT32 fg_color;
UINT32 bg_color;
UINT32 screen_color;
UINT32 rows;
UINT32 cols;
UINT32 cursor_row;
UINT32 cursor_col;
UINT32 font_width;
UINT32 font_height;
} MFC_CONTEXT;
/* MTK Framebuffer Console API */
MFC_STATUS MFC_Open(MFC_HANDLE *handle,
void *fb_addr,
unsigned int fb_width,
unsigned int fb_height,
unsigned int fb_bpp,
unsigned int fg_color,
unsigned int bg_color);
MFC_STATUS MFC_Open_Ex(MFC_HANDLE *handle,
void *fb_addr,
unsigned int fb_width,
unsigned int fb_height,
unsigned int fb_pitch,
unsigned int fb_bpp,
unsigned int fg_color,
unsigned int bg_color);
MFC_STATUS MFC_Close(MFC_HANDLE handle);
MFC_STATUS MFC_SetColor(MFC_HANDLE handle,
unsigned int fg_color,
unsigned int bg_color);
MFC_STATUS MFC_ResetCursor(MFC_HANDLE handle);
MFC_STATUS MFC_Print(MFC_HANDLE handle, const char *str);
MFC_STATUS MFC_LowMemory_Printf(MFC_HANDLE handle, const char *str, UINT32 fg_color, UINT32 bg_color);
MFC_STATUS MFC_SetMem(MFC_HANDLE handle, const char *str, UINT32 color);
UINT32 MFC_Get_Cursor_Offset(MFC_HANDLE handle);
#ifdef __cplusplus
}
#endif
#endif // __MTK_FB_CONSOLE_H__
|