366 CHAPTER 13 RTT
J-Link / J-Trace (UM08001) ©
2004-2017 SEGGER Microcontroller GmbH & Co. KG
Parameters
Return value
Additional information
With SEGGER_RTT_Write() all kinds of data, not only printable one can be sent.
13.4.1.11SEGGER_RTT_WaitKey()
Description
Waits until at least one character is avaible in SEGGER RTT buffer 0. Once a character
is available, it is read and returned.
Prototype
int SEGGER_RTT_WaitKey (void);
Return value
Example
int c = 0;
do {
c = SEGGER_RTT_WaitKey();
} while (c != ’c’);
13.4.1.12SEGGER_RTT_WriteString()
Description
Write a 0-terminated string to an up channel via RTT.
Prototype
int SEGGER_RTT_WriteSting (unsigned BufferIndex, const char* s);
Parameters
Return value
Example
SEGGER_RTT_WriteString(0, "Hello World from your target.\n");
Parameter Meaning
BufferIndex
Index of the up channel to send data to.
pBuffer Pointer to data to be sent.
NumBytes Number of bytes to send.
Table 13.7: SEGGER_RTT_Write() parameter list
>= 0 Number of bytes which have been sent.
>= 0 Character which has been read (0 - 255).
Parameter Meaning
BufferIndex
Index of the up channel to send string to.
s Pointer to 0-terminated string to be sent.
Table 13.8: SEGGER_RTT_WriteString() parameter list
>= 0 Number of bytes which have been sent.