summaryrefslogtreecommitdiff
path: root/include/uart.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2019-02-06 12:49:44 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-02-08 06:03:47 -0800
commitb937f5c5b2bd54323b91f38be9650c975b00618c (patch)
treee1edd2b24f7f3da8e478d89a6ea9c16d0ca8e99d /include/uart.h
parentb2ec2a5eb56f9f6bb769ed0200fe11bcc075167d (diff)
downloadchrome-ec-b937f5c5b2bd54323b91f38be9650c975b00618c.tar.gz
UART: Add uart_put API
The uart_puts API takes a null-terminated string. This patch adds the uart_put API, which works like uart_puts but allows the caller to specify the data size. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/119329144 BRANCH=none TEST=buildall Change-Id: I18b2625f9a2339b68ca586b6f1b3c36511cb725c Reviewed-on: https://chromium-review.googlesource.com/1457576 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/uart.h')
-rw-r--r--include/uart.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/uart.h b/include/uart.h
index e40b0e866f..9fdc3e8dec 100644
--- a/include/uart.h
+++ b/include/uart.h
@@ -48,6 +48,15 @@ int uart_putc(int c);
int uart_puts(const char *outstr);
/**
+ * Put byte stream to the UART
+ *
+ * @param out Pointer to data to send
+ * @param len Length of transfer in bytes
+ * @return EC_SUCCESS, or non-zero if output was truncated.
+ */
+int uart_put(const char *out, int len);
+
+/**
* Print formatted output to the UART, like printf().
*
* See printf.h for valid formatting codes.