summaryrefslogtreecommitdiffstats
path: root/hal/uart.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hal/uart.hpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/hal/uart.hpp b/hal/uart.hpp
index 461f0fa..096ac7b 100644
--- a/hal/uart.hpp
+++ b/hal/uart.hpp
@@ -10,7 +10,7 @@
#include <cstdint>
#include <cstddef>
-#include <string>
+#include <queue>
extern "C" {
void usart_1_isr();
@@ -43,17 +43,14 @@ namespace uart
tx_empty = 1<<4,
};
- std::string rx_buffer[devices_count];
- std::string tx_buffer[devices_count];
+ std::queue<uint8_t> rx_buffer[devices_count];
+ std::queue<uint8_t> tx_buffer[devices_count];
template<unsigned dev>
void initialize();
template<unsigned dev>
- uint8_t peek(uint16_t offset);
-
- template<unsigned dev>
- uint8_t read(void);
+ uint8_t read();
template<unsigned dev>
unsigned read(uint8_t *buffer, const unsigned numbytes);
@@ -62,6 +59,9 @@ namespace uart
void write(const uint8_t byte);
template<unsigned dev>
+ void write(const std::string &str);
+
+ template<unsigned dev>
unsigned write(const uint8_t *buffer, const unsigned numbytes);
template<unsigned dev>