mirror of
https://github.com/jscrane/r65emu.git
synced 2024-12-30 09:30:46 +00:00
serial framing config
This commit is contained in:
parent
ad947c887c
commit
c4ee594a1c
30
acia.cpp
30
acia.cpp
@ -8,8 +8,36 @@ void acia::operator=(uint8_t b) {
|
||||
_device->write(b);
|
||||
return;
|
||||
}
|
||||
if ((b & cd_mask) == 0x03)
|
||||
if ((b & cd_mask) == reset) {
|
||||
_device->reset();
|
||||
return;
|
||||
}
|
||||
switch (b & ws_mask) {
|
||||
case ws7e2:
|
||||
_device->framing(7, 2, even);
|
||||
break;
|
||||
case ws7o2:
|
||||
_device->framing(7, 2, odd);
|
||||
break;
|
||||
case ws7e1:
|
||||
_device->framing(7, 1, even);
|
||||
break;
|
||||
case ws7o1:
|
||||
_device->framing(7, 1, odd);
|
||||
break;
|
||||
case ws8n2:
|
||||
_device->framing(8, 2, none);
|
||||
break;
|
||||
case ws8n1:
|
||||
_device->framing(8, 1, none);
|
||||
break;
|
||||
case ws8e1:
|
||||
_device->framing(8, 1, even);
|
||||
break;
|
||||
case ws8o1:
|
||||
_device->framing(8, 1, odd);
|
||||
break;
|
||||
};
|
||||
// FIXME: more
|
||||
}
|
||||
|
||||
|
9
acia.h
9
acia.h
@ -1,10 +1,19 @@
|
||||
#ifndef __ACIA_H__
|
||||
#define __ACIA_H__
|
||||
|
||||
enum parity {
|
||||
none,
|
||||
even,
|
||||
odd,
|
||||
};
|
||||
|
||||
class SerialDevice {
|
||||
public:
|
||||
virtual void reset() {}
|
||||
virtual void framing(unsigned data_bits, unsigned stop_bits, parity p) {}
|
||||
|
||||
virtual void write(uint8_t) {}
|
||||
|
||||
virtual uint8_t read() {}
|
||||
virtual bool more() { return false; }
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user