The Serial Input/Output (I/O) library provides commonly used I/O functions like printf(), putchar() and getchar().
It uses stream abstraction to allow reading and writing data in an uniform way. There are three standard streams allocated automatically that are associated with physical serial ports (one per UART module).
For the serial library usage example, refer to FNET demo application source code.
NOTE: The HW serial ports associated with I/O streams are not initialized by the serial library and should be initialized by the application. It can be inialized by the fnet_cpu_serial_init() function.
Configuration parameters:
|
void | fnet_serial_putchar (fnet_serial_stream_t stream, fnet_char_t character) |
| Writes character to the stream. More...
|
|
fnet_int32_t | fnet_serial_getchar (fnet_serial_stream_t stream) |
| Reads character from the stream. More...
|
|
void | fnet_serial_flush (fnet_serial_stream_t stream) |
| Sends data from the internal stream buffer to the stream client. More...
|
|
void | fnet_putchar (fnet_char_t character) |
| Writes character to the default stream. More...
|
|
fnet_int32_t | fnet_getchar (void) |
| Reads character from the default stream. More...
|
|
fnet_size_t | fnet_serial_printf (fnet_serial_stream_t stream, const fnet_char_t *format,...) |
| Prints formatted text to the stream. More...
|
|
fnet_size_t | fnet_serial_vprintf (fnet_serial_stream_t stream, const fnet_char_t *format, va_list arg) |
| Prints formatted variable argument list to the stream. More...
|
|
fnet_size_t | fnet_printf (const fnet_char_t *format,...) |
| Prints formatted text to the default stream. More...
|
|
fnet_size_t | fnet_println (const fnet_char_t *format,...) |
| Prints formatted text to the default stream and terminates the printed text by the line separator string. More...
|
|
fnet_size_t | fnet_sprintf (fnet_char_t *str, const fnet_char_t *format,...) |
| Prints formatted text to the buffer. More...
|
|
fnet_size_t | fnet_snprintf (fnet_char_t *str, fnet_size_t size, const fnet_char_t *format,...) |
| Prints formatted text to the buffer. The length of the buffer is given, that prevents the buffer overflows. More...
|
|