aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/serialport.h
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-25 14:57:00 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-25 14:57:00 +0100
commit1889bd9353b309ea54f3543f5d609015fec5b73c (patch)
treef203dac446435aa395cadbd34ea4d347efdaacd6 /qtmips_machine/serialport.h
parentca242e325d823bc627ca4e6ff8eca24b888a6113 (diff)
downloadqtmips-1889bd9353b309ea54f3543f5d609015fec5b73c.tar.gz
qtmips-1889bd9353b309ea54f3543f5d609015fec5b73c.tar.bz2
qtmips-1889bd9353b309ea54f3543f5d609015fec5b73c.zip
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 <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine/serialport.h')
-rw-r--r--qtmips_machine/serialport.h5
1 files changed, 4 insertions, 1 deletions
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;
};