SEGGER_RTT.h 4.68 KB
Newer Older
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
/* clang-format off */
/*********************************************************************
*              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                ""

#define RTT_CTRL_CLEAR                ""

#define RTT_CTRL_TEXT_BLACK           ""
#define RTT_CTRL_TEXT_RED             ""
#define RTT_CTRL_TEXT_GREEN           ""
#define RTT_CTRL_TEXT_YELLOW          ""
#define RTT_CTRL_TEXT_BLUE            ""
#define RTT_CTRL_TEXT_MAGENTA         ""
#define RTT_CTRL_TEXT_CYAN            ""
#define RTT_CTRL_TEXT_WHITE           ""

#define RTT_CTRL_TEXT_BRIGHT_BLACK    ""
#define RTT_CTRL_TEXT_BRIGHT_RED      ""
#define RTT_CTRL_TEXT_BRIGHT_GREEN    ""
#define RTT_CTRL_TEXT_BRIGHT_YELLOW   ""
#define RTT_CTRL_TEXT_BRIGHT_BLUE     ""
#define RTT_CTRL_TEXT_BRIGHT_MAGENTA  ""
#define RTT_CTRL_TEXT_BRIGHT_CYAN     ""
#define RTT_CTRL_TEXT_BRIGHT_WHITE    ""

#define RTT_CTRL_BG_BLACK             ""
#define RTT_CTRL_BG_RED               ""
#define RTT_CTRL_BG_GREEN             ""
#define RTT_CTRL_BG_YELLOW            ""
#define RTT_CTRL_BG_BLUE              ""
#define RTT_CTRL_BG_MAGENTA           ""
#define RTT_CTRL_BG_CYAN              ""
#define RTT_CTRL_BG_WHITE             ""

#define RTT_CTRL_BG_BRIGHT_BLACK      ""
#define RTT_CTRL_BG_BRIGHT_RED        ""
#define RTT_CTRL_BG_BRIGHT_GREEN      ""
#define RTT_CTRL_BG_BRIGHT_YELLOW     ""
#define RTT_CTRL_BG_BRIGHT_BLUE       ""
#define RTT_CTRL_BG_BRIGHT_MAGENTA    ""
#define RTT_CTRL_BG_BRIGHT_CYAN       ""
#define RTT_CTRL_BG_BRIGHT_WHITE      ""


/*********************************************************************
*
*       RTT API functions
*
**********************************************************************
*/

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 ****************************/