summaryrefslogtreecommitdiff
path: root/digital/ucoolib/ucoolib/hal/uart/uart.stm32.hh
diff options
context:
space:
mode:
authorNicolas Schodet2013-02-24 23:43:23 +0100
committerNicolas Schodet2013-03-01 22:58:04 +0100
commit3a4bd5948939030b960c3363c04a33032d517fc7 (patch)
tree00fed9e08ae4640f0738f690e6ba735c62891802 /digital/ucoolib/ucoolib/hal/uart/uart.stm32.hh
parent54848f43e39e38ca31cfa4e95b93baa60e1cb20b (diff)
digital/ucoolib/ucoolib: change setup to enable/disable
Diffstat (limited to 'digital/ucoolib/ucoolib/hal/uart/uart.stm32.hh')
-rw-r--r--digital/ucoolib/ucoolib/hal/uart/uart.stm32.hh12
1 files changed, 8 insertions, 4 deletions
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<char, UCOO_CONFIG_HAL_UART_TX_BUFFER> tx_fifo_;
/// Error character, inserted in case of error.
char error_char_;
+ /// Is it enabled?
+ bool enabled_;
};
} // namespace ucoo