summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/8255ppi.h
blob: 03439fe6799b07656703e34f78ab698da37d6bda (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
66
67
68
/*********************************************************************

    8255ppi.h

    Intel 8255 PPI I/O chip

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

#ifndef __8255PPI_H_
#define __8255PPI_H_

#include "devlegcy.h"


DECLARE_LEGACY_DEVICE(PPI8255, ppi8255);


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

typedef struct _ppi8255_interface ppi8255_interface;
struct _ppi8255_interface
{
	devcb_read8 port_a_read;
	devcb_read8 port_b_read;
	devcb_read8 port_c_read;
	devcb_write8 port_a_write;
	devcb_write8 port_b_write;
	devcb_write8 port_c_write;
};


/***************************************************************************
    DEVICE CONFIGURATION MACROS
***************************************************************************/

#define MDRV_PPI8255_ADD(_tag, _intrf) \
	MDRV_DEVICE_ADD(_tag, PPI8255, 0) \
	MDRV_DEVICE_CONFIG(_intrf)

#define MDRV_PPI8255_RECONFIG(_tag, _intrf) \
	MDRV_DEVICE_MODIFY(_tag) \
	MDRV_DEVICE_CONFIG(_intrf)



READ8_DEVICE_HANDLER( ppi8255_r );
WRITE8_DEVICE_HANDLER( ppi8255_w );


void ppi8255_set_port_a_read( running_device *device, const devcb_read8 *config );
void ppi8255_set_port_b_read( running_device *device, const devcb_read8 *config );
void ppi8255_set_port_c_read( running_device *device, const devcb_read8 *config );

void ppi8255_set_port_a_write( running_device *device, const devcb_write8 *config );
void ppi8255_set_port_b_write( running_device *device, const devcb_write8 *config );
void ppi8255_set_port_c_write( running_device *device, const devcb_write8 *config );

void ppi8255_set_port_a( running_device *device, UINT8 data );
void ppi8255_set_port_b( running_device *device, UINT8 data );
void ppi8255_set_port_c( running_device *device, UINT8 data );

UINT8 ppi8255_get_port_a( running_device *device );
UINT8 ppi8255_get_port_b( running_device *device );
UINT8 ppi8255_get_port_c( running_device *device );

#endif /* __8255PPI_H_ */