summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2019-04-23 10:53:45 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2019-04-23 10:53:45 +0100
commit3da9cb1fcad88d5c7ca60141c067ad5559cdb399 (patch)
tree03dea16e67cb32994050580fd74a0fb5cb9c9994 /include
parent5394feaf2190cb0a80ff0b633d2702a9add337a2 (diff)
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 <antonio.ninodiaz@arm.com>
Diffstat (limited to 'include')
-rw-r--r--include/drivers/console.h30
1 files changed, 29 insertions, 1 deletions
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 <stdint.h>
+/*
+ * 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__ */