1 /* 2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef _PICO_STDIO_RTT_H 8 #define _PICO_STDIO_RTT_H 9 10 #include "pico/stdio.h" 11 12 /** \brief Support for stdin/stdout using SEGGER RTT 13 * \defgroup pico_stdio_rtt pico_stdio_rtt 14 * \ingroup pico_stdio 15 * 16 * Linking this library or calling `pico_enable_stdio_rtt(TARGET)` in the CMake (which 17 * achieves the same thing) will add RTT to the drivers used for standard output 18 */ 19 20 // PICO_CONFIG: PICO_STDIO_RTT_DEFAULT_CRLF, Default state of CR/LF translation for rtt output, type=bool, default=PICO_STDIO_DEFAULT_CRLF, group=pico_stdio_rtt 21 #ifndef PICO_STDIO_RTT_DEFAULT_CRLF 22 #define PICO_STDIO_RTT_DEFAULT_CRLF PICO_STDIO_DEFAULT_CRLF 23 #endif 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 extern stdio_driver_t stdio_rtt; 30 31 /*! \brief Explicitly initialize stdin/stdout over RTT and add it to the current set of stdin/stdout drivers 32 * \ingroup pico_stdio_rtt 33 * 34 * \note this method is automatically called by \ref stdio_init_all() if `pico_stdio_rtt` is included in the build 35 */ 36 void stdio_rtt_init(void); 37 38 /*! \brief Explicitly deinitialize stdin/stdout over RTT and remove it from the current set of stdin/stdout drivers 39 * \ingroup pico_stdio_rtt 40 * 41 * \note this method is automatically called by \ref stdio_deinit_all() if `pico_stdio_rtt` is included in the build 42 */ 43 void stdio_rtt_deinit(void); 44 45 #ifdef __cplusplus 46 } 47 #endif 48 49 #endif 50