mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
diserial: Added some information getters for future use. (nw)
This commit is contained in:
parent
88e7355999
commit
189678f296
@ -7,18 +7,6 @@
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
|
||||
/* receive is waiting for start bit. The transition from high-low indicates
|
||||
start of start bit. This is used to synchronise with the data being transfered */
|
||||
#define RECEIVE_REGISTER_WAITING_FOR_START_BIT 0x01
|
||||
/* receive is synchronised with data, data bits will be clocked in */
|
||||
#define RECEIVE_REGISTER_SYNCHRONISED 0x02
|
||||
/* set if receive register has been filled */
|
||||
#define RECEIVE_REGISTER_FULL 0x04
|
||||
|
||||
/* register is empty and ready to be filled with data */
|
||||
#define TRANSMIT_REGISTER_EMPTY 0x0001
|
||||
|
||||
device_serial_interface::device_serial_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_interface(device),
|
||||
m_input_state(0),
|
||||
|
@ -18,6 +18,25 @@
|
||||
class device_serial_interface : public device_interface
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
/* receive is waiting for start bit. The transition from high-low indicates
|
||||
start of start bit. This is used to synchronise with the data being transfered */
|
||||
RECEIVE_REGISTER_WAITING_FOR_START_BIT = 0x01,
|
||||
|
||||
/* receive is synchronised with data, data bits will be clocked in */
|
||||
RECEIVE_REGISTER_SYNCHRONISED = 0x02,
|
||||
|
||||
/* set if receive register has been filled */
|
||||
RECEIVE_REGISTER_FULL = 0x04
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
/* register is empty and ready to be filled with data */
|
||||
TRANSMIT_REGISTER_EMPTY = 0x0001
|
||||
};
|
||||
|
||||
/* parity selections */
|
||||
/* if all the bits are added in a byte, if the result is:
|
||||
even -> parity is even
|
||||
@ -95,6 +114,8 @@ protected:
|
||||
|
||||
bool is_receive_register_full();
|
||||
bool is_transmit_register_empty();
|
||||
bool is_receive_register_synchronized() { return m_rcv_flags & RECEIVE_REGISTER_SYNCHRONISED; }
|
||||
bool is_receive_register_shifting() { return m_rcv_bit_count_received > 0; }
|
||||
|
||||
UINT8 get_received_char() { return m_rcv_byte_received; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user