summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/cdp1863.h
blob: 31d0cf5329c366db9a49777dbdeb7f14398015a6 (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
/**********************************************************************

    RCA CDP1863 CMOS 8-Bit Programmable Frequency Generator emulation

    Copyright MESS Team.
    Visit http://mamedev.org for licensing and usage restrictions.

**********************************************************************
                            _____   _____
                _RESET   1 |*    \_/     | 16  Vdd
                 CLK 2   2 |             | 15  OE
                 CLK 1   3 |             | 14  OUT
                   STR   4 |   CDP1863   | 13  DO7
                   DI0   5 |             | 12  DI6
                   DI1   6 |             | 11  DI5
                   DI2   7 |             | 10  DI4
                   Vss   8 |_____________| 9   DI3

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

#ifndef __CDP1863__
#define __CDP1863__

/***************************************************************************
    MACROS / CONSTANTS
***************************************************************************/

#define CDP1863 DEVICE_GET_INFO_NAME(cdp1863)
#define SOUND_CDP1863 CDP1863

#define MDRV_CDP1863_ADD(_tag, _clock1, _clock2) \
	MDRV_DEVICE_ADD(_tag, SOUND, _clock1) \
	MDRV_DEVICE_CONFIG_DATAPTR(cdp1863_config, type, SOUND_CDP1863) \
	MDRV_DEVICE_CONFIG_DATA32(cdp1863_config, clock2, _clock2)

#define CDP1863_INTERFACE(name) \
	const cdp1863_interface (name) =

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

typedef struct _cdp1863_config cdp1863_config;
struct _cdp1863_config
{
	const sound_config *type;

	int clock2;				/* the clock 2 (pin 2) of the chip */
};

/***************************************************************************
    PROTOTYPES
***************************************************************************/

/* device interface */
DEVICE_GET_INFO( cdp1863 );

/* load tone latch */
WRITE8_DEVICE_HANDLER( cdp1863_str_w );

/* output enable */
WRITE_LINE_DEVICE_HANDLER( cdp1863_oe_w );

/* clock setters */
void cdp1863_set_clk1(const device_config *device, int frequency) ATTR_NONNULL(1);
void cdp1863_set_clk2(const device_config *device, int frequency) ATTR_NONNULL(1);

#endif