summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/vtech/ioexp/printer.h
blob: be25c7fd614589ddf84a4a1d06af4dd22b93cf12 (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:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************

    VTech Laser/VZ Printer Interface

    Dick Smith Electronics X-7320

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

#ifndef MAME_BUS_VTECH_IOEXP_PRINTER_H
#define MAME_BUS_VTECH_IOEXP_PRINTER_H

#pragma once

#include "ioexp.h"
#include "bus/centronics/ctronics.h"


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

// ======================> vtech_printer_interface_device

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

protected:
	virtual void device_add_mconfig(machine_config &config) override;
	virtual void device_start() override;

	virtual void io_map(address_map &map) override;

private:
	required_device<centronics_device> m_centronics;
	required_device<output_latch_device> m_latch;

	DECLARE_WRITE_LINE_MEMBER( busy_w );
	uint8_t busy_r();
	void strobe_w(uint8_t data);

	int m_centronics_busy;
};

// device type definition
DECLARE_DEVICE_TYPE(VTECH_PRINTER_INTERFACE, vtech_printer_interface_device)

#endif // MAME_BUS_VTECH_IOEXP_PRINTER_H