From 3da9cb1fcad88d5c7ca60141c067ad5559cdb399 Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Tue, 23 Apr 2019 10:53:45 +0100 Subject: drivers: console: pl011: Move comments to header Rather than having the description of each function in the implementation, move it to the header so that it isn't needed to copy it in each file that implements a console driver. Change-Id: I1b437ae3d3ccff10979466727353bc1fa1d5b188 Signed-off-by: Antonio Nino Diaz --- include/drivers/console.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/drivers/console.h b/include/drivers/console.h index 72decb9..4c22a99 100644 --- a/include/drivers/console.h +++ b/include/drivers/console.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Arm Limited. All rights reserved. + * Copyright (c) 2018-2019, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -16,11 +16,39 @@ #include +/* + * Function to initialize the console without a C Runtime to print debug + * information. It saves the console base to the data section. Returns 1 on + * success, 0 on error. + */ int console_init(uintptr_t base_addr, unsigned int uart_clk, unsigned int baud_rate); + +/* + * Function to output a character over the console. It returns the character + * printed on success or an error code. + */ int console_putc(int c); + +/* + * Function to get a character from the console. It returns the character + * grabbed on success or an error code on error. This function is blocking, it + * waits until there is an available character to return. Returns a character or + * error code. + */ int console_getc(void); + +/* + * Function to get a character from the console. It returns the character + * grabbed on success or an error code on error. This function is non-blocking, + * it returns immediately. + */ int console_try_getc(void); + +/* + * Function to force a write of all buffered data that hasn't been output. It + * returns 0 upon successful completion, otherwise it returns an error code. + */ int console_flush(void); #endif /* __ASSEMBLY__ */ -- cgit v1.2.3