summaryrefslogtreecommitdiff
path: root/include/drivers/console.h
blob: 72decb9daa42c7304f18f845b388a39b94558ee2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * Copyright (c) 2018, Arm Limited. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef __CONSOLE_H__
#define __CONSOLE_H__

/* Returned by getc callbacks when receive FIFO is empty. */
#define ERROR_NO_PENDING_CHAR		-1
/* Returned by console_xxx() if the registered console doesn't implement xxx. */
#define ERROR_NO_VALID_CONSOLE		(-128)

#ifndef __ASSEMBLY__

#include <stdint.h>

int console_init(uintptr_t base_addr,
		unsigned int uart_clk, unsigned int baud_rate);
int console_putc(int c);
int console_getc(void);
int console_try_getc(void);
int console_flush(void);

#endif /* __ASSEMBLY__ */

#endif /* __CONSOLE_H__ */