summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/isa/eis_twib.h
blob: 03aa10b5544ca53238d7d554bf21202537fb72fa (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
// license:BSD-3-Clause
// copyright-holders: Joakim Larsson Edstrom
#ifndef MAME_BUS_ISA_EIS_TWIB_H
#define MAME_BUS_ISA_EIS_TWIB_H

#pragma once

#include "isa.h"
#include "machine/z80sio.h"
#include "machine/timer.h"
#include "machine/sdlc.h"

class isa8_eistwib_device :
		public device_t,
		public device_isa8_card_interface
{
public:
	// construction/destruction
	isa8_eistwib_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

	uint8_t twib_r(offs_t offset);
	void twib_w(offs_t offset, uint8_t data);

protected:
	// device-level overrides
	virtual void device_start() override;
	virtual void device_reset() override;

	// devices
	required_device<i8274_device> m_uart8274;
	required_device<sdlc_logger_device> m_sdlclogger;

	// optional information overrides
	virtual void device_add_mconfig(machine_config &config) override;
	virtual ioport_constructor device_input_ports() const override;

	// Timers
	TIMER_DEVICE_CALLBACK_MEMBER(tick_bitclock);
	bool m_bitclock;
	bool m_rts;
	bool m_txd;

	// helpers
	required_ioport m_sw1;
	required_ioport m_isairq;
	bool m_installed;
};

// device type definition
DECLARE_DEVICE_TYPE(ISA8_EIS_TWIB, isa8_eistwib_device)

#endif  // MAME_BUS_ISA_EIS_TWIB_H