blob: 72decb9daa42c7304f18f845b388a39b94558ee2 [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
Ambroise Vincent602b7f52019-02-11 14:13:43 +000017#include <stdint.h>
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020018
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__ */