summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/vtech/memexp/rs232.h
blob: 272ef41e2d6c07aaaa7799f888ca394eceb752f4 (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
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************

    Dick Smith VZ-200/300 RS-232 Cartridge (K-6317)

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

#ifndef MAME_BUS_VTECH_MEMEXP_RS232_H
#define MAME_BUS_VTECH_MEMEXP_RS232_H

#pragma once

#include "memexp.h"
#include "bus/rs232/rs232.h"


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

// ======================> vtech_rs232_interface_device

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

protected:
	virtual const tiny_rom_entry *device_rom_region() const override;
	virtual void device_add_mconfig(machine_config &config) override;
	virtual void device_start() override;
	virtual void device_reset() override;

private:
	DECLARE_WRITE_LINE_MEMBER( rs232_rx_w );
	DECLARE_READ8_MEMBER( receive_data_r );
	DECLARE_WRITE8_MEMBER( transmit_data_w );

	required_device<rs232_port_device> m_rs232;

	int m_rx;
};

// device type definition
DECLARE_DEVICE_TYPE(VTECH_RS232_INTERFACE, vtech_rs232_interface_device)

#endif // MAME_BUS_VTECH_MEMEXP_RS232_H