blob: abbe3561201a70fe62d1b060f094ad49f5f85228 [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001/*
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
17#include <types.h>
18
19int console_init(uintptr_t base_addr,
20 unsigned int uart_clk, unsigned int baud_rate);
21int console_putc(int c);
22int console_getc(void);
23int console_try_getc(void);
24int console_flush(void);
25
26#endif /* __ASSEMBLY__ */
27
28#endif /* __CONSOLE_H__ */