POK(kernelpart)
cons.h
Go to the documentation of this file.
1 /*
2  * POK header
3  *
4  * The following file is a part of the POK project. Any modification should
5  * made according to the POK licence. You CANNOT use this file or a part of
6  * this file is this part of a file for your own project
7  *
8  * For more information on the POK licence, please see our LICENCE FILE
9  *
10  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
11  *
12  * Copyright (c) 2007-2009 POK team
13  *
14  * Created by julien on Thu Jan 15 23:34:13 2009
15  */
16 
17 
18 #ifndef __POK_CONS_H__
19 #define __POK_CONS_H__
20 
21 #if defined (POK_NEEDS_DEBUG) || defined (POK_NEEDS_CONSOLE) || defined (POK_NEEDS_INSTRUMENTATION) || defined (POK_NEEDS_COVERAGE_INFOS)
22 #include <arch.h>
23 #include <errno.h>
24 #include <types.h>
25 
26 #define CONS_ESCAPE 255
27 #define CONS_CLEAR 1
28 #define CONS_COLOR 2
29 #define CONS_SETX 3
30 #define CONS_SETY 4
31 
32 #define CONS_BLACK 0x0
33 #define CONS_BLUE 0x1
34 #define CONS_GREEN 0x2
35 #define CONS_CYAN 0x3
36 #define CONS_RED 0x4
37 #define CONS_MAGENTA 0x5
38 #define CONS_YELLOW 0x6
39 #define CONS_WHITE 0x7
40 
41 #define CONS_BLINK (1 << 7)
42 #define CONS_LIGHT (1 << 3)
43 
44 #define CONS_FRONT(Color) (Color)
45 #define CONS_BACK(Color) (Color << 4)
46 
47 
48 struct s_cons
49 {
50  char row;
51  char col;
52  char cur_attr;
53 };
54 
55 void pok_cons_print_char(const char c);
56 void pok_cons_attr(uint8_t attr);
57 void pok_cons_disable_cursor(void);
58 pok_bool_t pok_cons_write(const char *s, size_t length);
59 void pok_cons_clear(void);
60 #endif
61 
62 int pok_cons_init(void);
63 
64 #endif