SEGGER RTT stdio

stdio init/read/write functions for SEGGER RTT. More...

Detailed Description

This is designed to shadow the functions in uart_stdio

Files

file  rtt_stdio.h
 

Functions

void uart_stdio_init (void)
 initialize the module. More...
 
int uart_stdio_read (char *buffer, int len)
 read len bytes from stdio uart into buffer More...
 
int uart_stdio_write (const char *buffer, int len)
 write len bytes from buffer into uart More...
 
void rtt_stdio_enable_stdin (void)
 enable stdin polling, at a power consumption cost. More...
 
void rtt_stdio_enable_blocking_stdout (void)
 enable stdout blocking and free space polling. More...
 

Function Documentation

◆ rtt_stdio_enable_blocking_stdout()

void rtt_stdio_enable_blocking_stdout ( void  )

This must be done with caution because if there is no RTT client attached, all writes to stdout will block indefinitely. This can be enabled automatically by defining RTT_STDIO_ENABLE_BLOCKING_STDOUT

◆ rtt_stdio_enable_stdin()

void rtt_stdio_enable_stdin ( void  )

This is enabled by default unless RTT_STDIO_DISABLE_STDIN is defined.

◆ uart_stdio_init()

void uart_stdio_init ( void  )

This is a noop.

◆ uart_stdio_read()

int uart_stdio_read ( char *  buffer,
int  len 
)
Parameters
[out]bufferbuffer to read into
[in]lennr of bytes to read
Returns
nr of bytes read
<0 on error

◆ uart_stdio_write()

int uart_stdio_write ( const char *  buffer,
int  len 
)
Parameters
[in]bufferbuffer to read from
[in]lennr of bytes to write
Returns
nr of bytes written
<0 on error