Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef __CONSOLE_H__ |
| 8 | #define __CONSOLE_H__ |
| 9 | |
| 10 | /* Returned by getc callbacks when receive FIFO is empty. */ |
| 11 | #define ERROR_NO_PENDING_CHAR -1 |
| 12 | /* Returned by console_xxx() if the registered console doesn't implement xxx. */ |
| 13 | #define ERROR_NO_VALID_CONSOLE (-128) |
| 14 | |
| 15 | #ifndef __ASSEMBLY__ |
| 16 | |
Ambroise Vincent | 602b7f5 | 2019-02-11 14:13:43 +0000 | [diff] [blame^] | 17 | #include <stdint.h> |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 18 | |
| 19 | int console_init(uintptr_t base_addr, |
| 20 | unsigned int uart_clk, unsigned int baud_rate); |
| 21 | int console_putc(int c); |
| 22 | int console_getc(void); |
| 23 | int console_try_getc(void); |
| 24 | int console_flush(void); |
| 25 | |
| 26 | #endif /* __ASSEMBLY__ */ |
| 27 | |
| 28 | #endif /* __CONSOLE_H__ */ |