summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/6551acia.h
blob: 9f3ccb30dd38eb0c0ba089c095d309333c09a0ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*********************************************************************

    6551.h

    MOS Technology 6551 Asynchronous Communications Interface Adapter

*********************************************************************/

#ifndef __6551_H__
#define __6551_H__

//**************************************************************************
//  INTERFACE CONFIGURATION MACROS
//**************************************************************************

#define MCFG_ACIA6551_ADD(_tag)	\
	MCFG_DEVICE_ADD((_tag), ACIA6551, 0)


/***************************************************************************
    TYPE DEFINITIONS
***************************************************************************/

// ======================> acia6551_device

class acia6551_device :  public device_t,
						 public device_serial_interface
{
public:
    // construction/destruction
    acia6551_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);

	/* read data register */
	DECLARE_READ8_MEMBER(read);
	
	/* write data register */
	DECLARE_WRITE8_MEMBER(write);
		
	void receive_character(UINT8 ch);
	
	void timer_callback();
	
	virtual void input_callback(UINT8 state);
protected:
    // device-level overrides
    virtual void device_start();
	
	void refresh_ints();
	void update_data_form();
	
private:
	UINT8 m_transmit_data_register;
	UINT8 m_receive_data_register;
	UINT8 m_status_register;
	UINT8 m_command_register;
	UINT8 m_control_register;

	/* internal baud rate timer */
	emu_timer	*m_timer;
};

// device type definition
extern const device_type ACIA6551;

#endif /* __6551_H__ */