From 3a4bd5948939030b960c3363c04a33032d517fc7 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 24 Feb 2013 23:43:23 +0100 Subject: digital/ucoolib/ucoolib: change setup to enable/disable --- digital/ucoolib/ucoolib/hal/uart/uart.stm32.hh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'digital/ucoolib/ucoolib/hal/uart/uart.stm32.hh') diff --git a/digital/ucoolib/ucoolib/hal/uart/uart.stm32.hh b/digital/ucoolib/ucoolib/hal/uart/uart.stm32.hh index e807e9e9..1bfbcdb3 100644 --- a/digital/ucoolib/ucoolib/hal/uart/uart.stm32.hh +++ b/digital/ucoolib/ucoolib/hal/uart/uart.stm32.hh @@ -42,12 +42,14 @@ class Uart : public Stream /// Default error character. static const char default_error_char = '~'; public: - /// Initialise the Nth UART with given parameters. - Uart (int n, int speed = 0, Parity parity = NONE, int stop_bits = 1); + /// Constructor for the Nth UART. + Uart (int n); /// Shutdown UART. ~Uart (); - /// Change UART settings, use speed 0 to stop UART. - void setup (int speed, Parity parity = NONE, int stop_bits = 1); + /// Enable and setup UART. + void enable (int speed, Parity parity = NONE, int stop_bits = 1); + /// Disable. + void disable (); /// Change the error character. void set_error_char (char c); /// See Stream::read. @@ -67,6 +69,8 @@ class Uart : public Stream Fifo tx_fifo_; /// Error character, inserted in case of error. char error_char_; + /// Is it enabled? + bool enabled_; }; } // namespace ucoo -- cgit v1.2.3