diff options
author | Nao Pross <naopross@thearcway.org> | 2018-05-04 20:47:39 +0200 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-05-04 20:47:39 +0200 |
commit | e82789253b7c915270cfdc126e8e000924d90444 (patch) | |
tree | a58d4194d22e507afe506159b12c0cb2d182be7f /hal/uart.hpp | |
parent | Implement uart TX features (diff) | |
download | SAMLiquidSmoke-e82789253b7c915270cfdc126e8e000924d90444.tar.gz SAMLiquidSmoke-e82789253b7c915270cfdc126e8e000924d90444.zip |
Implement TX read(n) and readline() (not working yet)
Diffstat (limited to 'hal/uart.hpp')
-rw-r--r-- | hal/uart.hpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/hal/uart.hpp b/hal/uart.hpp index 0be5835..60dd5bb 100644 --- a/hal/uart.hpp +++ b/hal/uart.hpp @@ -13,10 +13,10 @@ #include <queue> extern "C" { -void usart_1_isr(); -void usart_2_isr(); -void usart_3_isr(); -void usart_4_isr(); + void usart_1_isr(); + void usart_2_isr(); + void usart_3_isr(); + void usart_4_isr(); } namespace uart @@ -52,8 +52,16 @@ namespace uart template<unsigned dev> uint8_t read(); +#if 0 + template<unsigned dev> + std::string read(const unsigned len); + + template<unsigned dev> + std::string readline(const std::string &eol = "\n\r"); + template<unsigned dev> unsigned read(uint8_t *buffer, const unsigned numbytes); +#endif template<unsigned dev> void write(const uint8_t byte); |