From 1889bd9353b309ea54f3543f5d609015fec5b73c Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Mon, 25 Feb 2019 14:57:00 +0100 Subject: Simple serial port receive implementation. Simple polled mode serial port input implemented for serial port peripheral and for read and readv system calls. When end of input character reserve is reached for read/readv, newline is automatically appended. Signed-off-by: Pavel Pisa --- qtmips_machine/serialport.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qtmips_machine/serialport.h') diff --git a/qtmips_machine/serialport.h b/qtmips_machine/serialport.h index add1fe6..5262720 100644 --- a/qtmips_machine/serialport.h +++ b/qtmips_machine/serialport.h @@ -52,6 +52,7 @@ public: signals: void tx_byte(unsigned int data); + void rx_byte_pool(int fd, unsigned int &data, bool &available) const; void write_notification(std::uint32_t address, std::uint32_t value); void read_notification(std::uint32_t address, std::uint32_t *value) const; @@ -59,7 +60,9 @@ public: bool wword(std::uint32_t address, std::uint32_t value); std::uint32_t rword(std::uint32_t address, bool debug_access = false) const; private: - std::uint32_t rx_st_reg; + void pool_rx_byte() const; + mutable std::uint32_t rx_st_reg; + mutable std::uint32_t rx_data_reg; std::uint32_t tx_st_reg; }; -- cgit v1.2.3