]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_FreedomStudio/freedom-metal/metal/tty.h
Update RISCC-V-RV32-SiFive_HiFive1_FreedomStudio project to latest tools and metal...
[freertos] / FreeRTOS / Demo / RISC-V_RV32_SiFive_HiFive1_FreedomStudio / freedom-metal / metal / tty.h
1 /* Copyright 2018 SiFive, Inc */
2 /* SPDX-License-Identifier: Apache-2.0 */
3
4 #ifndef METAL__TTY_H
5 #define METAL__TTY_H
6
7 /*!
8  * @file tty.h
9  * @brief API for emulated serial teriminals
10  */
11
12 /*!
13  * @brief Write a character to the default output device
14  *
15  * Write a character to the default output device, which for most
16  * targets is the UART serial port.
17  *
18  * putc() does CR/LF mapping.
19  * putc_raw() does not.
20  *
21  * @param c The character to write to the terminal
22  * @return 0 on success, or -1 on failure.
23  */
24 int metal_tty_putc(int c);
25
26 /*!
27  * @brief Write a raw character to the default output device
28  *
29  * Write a character to the default output device, which for most
30  * targets is the UART serial port.
31  *
32  * putc() does CR/LF mapping.
33  * putc_raw() does not.
34  *
35  * @param c The character to write to the terminal
36  * @return 0 on success, or -1 on failure.
37  */
38 int metal_tty_putc_raw(int c);
39
40 /*!
41  * @brief Get a byte from the default output device
42  *
43  * The default output device, is typically the UART serial port.
44  *
45  * This call is non-blocking, if nothing is ready c==-1
46  * if something is ready, then c=[0x00 to 0xff] byte value.
47  *
48  * @return 0 on success, or -1 on failure.
49  */
50 int metal_tty_getc(int *c);
51
52 #endif