From d7c09684d73c4831a0240ce1fcbe7644bc3ab6e7 Mon Sep 17 00:00:00 2001 From: Patrice Chotard Date: Fri, 3 Aug 2018 15:07:41 +0200 Subject: sandbox: Add serial test Signed-off-by: Patrice Chotard Reviewed-by: Simon Glass --- include/common.h | 1 + include/serial.h | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/common.h b/include/common.h index 940161f1758..5c952af5e31 100644 --- a/include/common.h +++ b/include/common.h @@ -359,6 +359,7 @@ void serial_putc_raw(const char); void serial_puts (const char *); int serial_getc (void); int serial_tstc (void); +int serial_setconfig(uint config); /* $(CPU)/speed.c */ int get_clocks (void); diff --git a/include/serial.h b/include/serial.h index ffda48a1410..020cd392e88 100644 --- a/include/serial.h +++ b/include/serial.h @@ -102,6 +102,11 @@ enum serial_stop { #define SERIAL_GET_STOP(config) \ ((config & SERIAL_STOP_MASK) >> SERIAL_STOP_SHIFT) +#define SERIAL_CONFIG(par, bits, stop) \ + (par << SERIAL_PAR_SHIFT | \ + bits << SERIAL_BITS_SHIFT | \ + stop << SERIAL_STOP_SHIFT) + #define SERIAL_DEFAULT_CONFIG SERIAL_PAR_NONE << SERIAL_PAR_SHIFT | \ SERIAL_8_BITS << SERIAL_BITS_SHIFT | \ SERIAL_ONE_STOP << SERIAL_STOP_SHIFT -- cgit v1.3.1