-
Notifications
You must be signed in to change notification settings - Fork 0
/
SEGGER_RTT.h
113 lines (95 loc) · 4.68 KB
/
SEGGER_RTT.h
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*********************************************************************
* SEGGER MICROCONTROLLER SYSTEME GmbH *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996-2014 SEGGER Microcontroller Systeme GmbH *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
----------------------------------------------------------------------
File : SEGGER_RTT.h
Date : 17 Dec 2014
Purpose : Implementation of SEGGER real-time terminal which allows
real-time terminal communication on targets which support
debugger memory accesses while the CPU is running.
---------------------------END-OF-HEADER------------------------------
*/
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define SEGGER_RTT_MODE_MASK (3 << 0)
#define SEGGER_RTT_MODE_NO_BLOCK_SKIP (0)
#define SEGGER_RTT_MODE_NO_BLOCK_TRIM (1 << 0)
#define SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL (1 << 1)
#define RTT_CTRL_RESET "[0m"
#define RTT_CTRL_CLEAR "[2J"
#define RTT_CTRL_TEXT_BLACK "[2;30m"
#define RTT_CTRL_TEXT_RED "[2;31m"
#define RTT_CTRL_TEXT_GREEN "[2;32m"
#define RTT_CTRL_TEXT_YELLOW "[2;33m"
#define RTT_CTRL_TEXT_BLUE "[2;34m"
#define RTT_CTRL_TEXT_MAGENTA "[2;35m"
#define RTT_CTRL_TEXT_CYAN "[2;36m"
#define RTT_CTRL_TEXT_WHITE "[2;37m"
#define RTT_CTRL_TEXT_BRIGHT_BLACK "[1;30m"
#define RTT_CTRL_TEXT_BRIGHT_RED "[1;31m"
#define RTT_CTRL_TEXT_BRIGHT_GREEN "[1;32m"
#define RTT_CTRL_TEXT_BRIGHT_YELLOW "[1;33m"
#define RTT_CTRL_TEXT_BRIGHT_BLUE "[1;34m"
#define RTT_CTRL_TEXT_BRIGHT_MAGENTA "[1;35m"
#define RTT_CTRL_TEXT_BRIGHT_CYAN "[1;36m"
#define RTT_CTRL_TEXT_BRIGHT_WHITE "[1;37m"
#define RTT_CTRL_BG_BLACK "[24;40m"
#define RTT_CTRL_BG_RED "[24;41m"
#define RTT_CTRL_BG_GREEN "[24;42m"
#define RTT_CTRL_BG_YELLOW "[24;43m"
#define RTT_CTRL_BG_BLUE "[24;44m"
#define RTT_CTRL_BG_MAGENTA "[24;45m"
#define RTT_CTRL_BG_CYAN "[24;46m"
#define RTT_CTRL_BG_WHITE "[24;47m"
#define RTT_CTRL_BG_BRIGHT_BLACK "[4;40m"
#define RTT_CTRL_BG_BRIGHT_RED "[4;41m"
#define RTT_CTRL_BG_BRIGHT_GREEN "[4;42m"
#define RTT_CTRL_BG_BRIGHT_YELLOW "[4;43m"
#define RTT_CTRL_BG_BRIGHT_BLUE "[4;44m"
#define RTT_CTRL_BG_BRIGHT_MAGENTA "[4;45m"
#define RTT_CTRL_BG_BRIGHT_CYAN "[4;46m"
#define RTT_CTRL_BG_BRIGHT_WHITE "[4;47m"
/*********************************************************************
*
* RTT API functions
*
**********************************************************************
*/
extern "C" {
int SEGGER_RTT_Read (unsigned BufferIndex, char* pBuffer, unsigned BufferSize);
int SEGGER_RTT_Write (unsigned BufferIndex, const char* pBuffer, unsigned NumBytes);
int SEGGER_RTT_WriteString (unsigned BufferIndex, const char* s);
int SEGGER_RTT_GetKey (void);
int SEGGER_RTT_WaitKey (void);
int SEGGER_RTT_HasKey (void);
int SEGGER_RTT_ConfigUpBuffer (unsigned BufferIndex, const char* sName, char* pBuffer, int BufferSize, int Flags);
int SEGGER_RTT_ConfigDownBuffer (unsigned BufferIndex, const char* sName, char* pBuffer, int BufferSize, int Flags);
void SEGGER_RTT_Init (void);
/*********************************************************************
*
* RTT "Terminal" API functions
*
**********************************************************************
*/
void SEGGER_RTT_SetTerminal (char TerminalId);
int SEGGER_RTT_TerminalOut (char TerminalId, const char* s);
/*********************************************************************
*
* RTT printf functions (require SEGGER_RTT_printf.c)
*
**********************************************************************
*/
int SEGGER_RTT_printf(unsigned BufferIndex, const char * sFormat, ...);
}
/*************************** End of file ****************************/