Statistics
| Branch: | Tag: | Revision:

mongoose / examples / nRF51 / http / rtt / RTT / SEGGER_RTT.h @ eaef5bd1

History | View | Annotate | Download (4.68 KB)

1
/* clang-format off */
2
/*********************************************************************
3
*              SEGGER MICROCONTROLLER SYSTEME GmbH                   *
4
*        Solutions for real time microcontroller applications        *
5
**********************************************************************
6
*                                                                    *
7
*        (c) 1996-2014 SEGGER Microcontroller Systeme GmbH           *
8
*                                                                    *
9
* Internet: www.segger.com Support: support@segger.com               *
10
*                                                                    *
11
**********************************************************************
12
----------------------------------------------------------------------
13
File    : SEGGER_RTT.h
14
Date    : 17 Dec 2014
15
Purpose : Implementation of SEGGER real-time terminal which allows
16
          real-time terminal communication on targets which support
17
          debugger memory accesses while the CPU is running.
18
---------------------------END-OF-HEADER------------------------------
19
*/
20

    
21
/*********************************************************************
22
*
23
*       Defines
24
*
25
**********************************************************************
26
*/
27
#define SEGGER_RTT_MODE_MASK                  (3 << 0)
28

    
29
#define SEGGER_RTT_MODE_NO_BLOCK_SKIP         (0)
30
#define SEGGER_RTT_MODE_NO_BLOCK_TRIM         (1 << 0)
31
#define SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL    (1 << 1)
32

    
33
#define RTT_CTRL_RESET                " [0m"
34

    
35
#define RTT_CTRL_CLEAR                " [2J"
36

    
37
#define RTT_CTRL_TEXT_BLACK           " [2;30m"
38
#define RTT_CTRL_TEXT_RED             " [2;31m"
39
#define RTT_CTRL_TEXT_GREEN           " [2;32m"
40
#define RTT_CTRL_TEXT_YELLOW          " [2;33m"
41
#define RTT_CTRL_TEXT_BLUE            " [2;34m"
42
#define RTT_CTRL_TEXT_MAGENTA         " [2;35m"
43
#define RTT_CTRL_TEXT_CYAN            " [2;36m"
44
#define RTT_CTRL_TEXT_WHITE           " [2;37m"
45

    
46
#define RTT_CTRL_TEXT_BRIGHT_BLACK    " [1;30m"
47
#define RTT_CTRL_TEXT_BRIGHT_RED      " [1;31m"
48
#define RTT_CTRL_TEXT_BRIGHT_GREEN    " [1;32m"
49
#define RTT_CTRL_TEXT_BRIGHT_YELLOW   " [1;33m"
50
#define RTT_CTRL_TEXT_BRIGHT_BLUE     " [1;34m"
51
#define RTT_CTRL_TEXT_BRIGHT_MAGENTA  " [1;35m"
52
#define RTT_CTRL_TEXT_BRIGHT_CYAN     " [1;36m"
53
#define RTT_CTRL_TEXT_BRIGHT_WHITE    " [1;37m"
54

    
55
#define RTT_CTRL_BG_BLACK             " [24;40m"
56
#define RTT_CTRL_BG_RED               " [24;41m"
57
#define RTT_CTRL_BG_GREEN             " [24;42m"
58
#define RTT_CTRL_BG_YELLOW            " [24;43m"
59
#define RTT_CTRL_BG_BLUE              " [24;44m"
60
#define RTT_CTRL_BG_MAGENTA           " [24;45m"
61
#define RTT_CTRL_BG_CYAN              " [24;46m"
62
#define RTT_CTRL_BG_WHITE             " [24;47m"
63

    
64
#define RTT_CTRL_BG_BRIGHT_BLACK      " [4;40m"
65
#define RTT_CTRL_BG_BRIGHT_RED        " [4;41m"
66
#define RTT_CTRL_BG_BRIGHT_GREEN      " [4;42m"
67
#define RTT_CTRL_BG_BRIGHT_YELLOW     " [4;43m"
68
#define RTT_CTRL_BG_BRIGHT_BLUE       " [4;44m"
69
#define RTT_CTRL_BG_BRIGHT_MAGENTA    " [4;45m"
70
#define RTT_CTRL_BG_BRIGHT_CYAN       " [4;46m"
71
#define RTT_CTRL_BG_BRIGHT_WHITE      " [4;47m"
72

    
73

    
74
/*********************************************************************
75
*
76
*       RTT API functions
77
*
78
**********************************************************************
79
*/
80

    
81
int     SEGGER_RTT_Read             (unsigned BufferIndex,       char* pBuffer, unsigned BufferSize);
82
int     SEGGER_RTT_Write            (unsigned BufferIndex, const char* pBuffer, unsigned NumBytes);
83
int     SEGGER_RTT_WriteString      (unsigned BufferIndex, const char* s);
84

    
85
int     SEGGER_RTT_GetKey           (void);
86
int     SEGGER_RTT_WaitKey          (void);
87
int     SEGGER_RTT_HasKey           (void);
88

    
89
int     SEGGER_RTT_ConfigUpBuffer   (unsigned BufferIndex, const char* sName, char* pBuffer, int BufferSize, int Flags);
90
int     SEGGER_RTT_ConfigDownBuffer (unsigned BufferIndex, const char* sName, char* pBuffer, int BufferSize, int Flags);
91

    
92
void    SEGGER_RTT_Init             (void);
93

    
94
/*********************************************************************
95
*
96
*       RTT "Terminal" API functions
97
*
98
**********************************************************************
99
*/
100
void    SEGGER_RTT_SetTerminal        (char TerminalId);
101
int     SEGGER_RTT_TerminalOut        (char TerminalId, const char* s);
102

    
103
/*********************************************************************
104
*
105
*       RTT printf functions (require SEGGER_RTT_printf.c)
106
*
107
**********************************************************************
108
*/
109
int SEGGER_RTT_printf(unsigned BufferIndex, const char * sFormat, ...);
110

    
111
/*************************** End of file ****************************/