summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/includes/mc68328.h
blob: 7726583378974ef680ac7ec186026d98116caf49 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/**********************************************************************

    Motorola 68328 ("DragonBall") System-on-a-Chip implementation

    By MooglyGuy
    contact mooglyguy@gmail.com with licensing and usage questions.

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

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

                                                             P P P P P P P   P P P P P P P
                                                             E E E E E E E   J J J J J J J
                                                             1 2 3 4 5 6 7   0 1 2 3 4 5 6
                   D   D D D D                               / / / / / / /   / / / / / / /
                   3   4 5 6 7                             ! ! ! ! ! ! ! !   ! ! ! ! ! ! !
                   /   / / / /                       ! !   C C C C C C C C   C C C C C C C
                   P V P P P P     D D G D D D D T T L U V S S S S S S S S G S S S S S S S
                   B C B B B B D D 1 1 N 1 1 1 1 M C W W C A A A A B B B B N C C C C D D D
                   3 C 4 5 6 7 8 9 0 1 D 2 3 4 5 S K E E C 0 1 2 3 0 1 2 3 D 0 1 2 3 0 1 2
                   | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
              +-------------------------------------------------------------------------------+
              |                                                                               |
              |                                                                               |
              |                                                                               |
              |                                                                               |
              |                                                                               |
      D2/PB2--|                                                                               |--PJ7/!CSD3
      D1/PB1--|                                                                               |--VCC
      D0/PB0--|                                                                               |--PD0/!KBD0/!INT0
         TDO--|                                                                               |--PD1/!KBD1/!INT1
         TDI--|                                                                               |--PD2/!KBD2/!INT2
         GND--|                                                                               |--PD3/!KBD3/!INT3
         !OE--|                                                                               |--PD4/!KBD4/!INT4
    !UDS/PC1--|                                                                               |--PD5/!KBD5/!INT5
         !AS--|                                                                               |--PD6/!KBD6/!INT6
          A0--|                                                                               |--PD7/!KBD7/!INT7
        !LDS--|                                                                               |--GND
        R/!W--|                                                                               |--LD0
  !DTACK/PC5--|                                                                               |--LD1
      !RESET--|                                                                               |--LD2
         VCC--|                                                                               |--LD3
     !WE/PC6--|                                                                               |--LFRM
    !JTAGRST--|                                                                               |--LLP
       BBUSW--|                                  MC68328PV                                    |--LCLK
          A1--|                                   TOP VIEW                                    |--LACD
          A2--|                                                                               |--VCC
          A3--|                                                                               |--PK0/SPMTXD0
          A4--|                                                                               |--PK1/SPMRXD0
          A5--|                                                                               |--PK2/SPMCLK0
          A6--|                                                                               |--PK3/SPSEN
         GND--|                                                                               |--PK4/SPSRXD1
          A7--|                                                                               |--PK5/SPSCLK1
          A8--|                                                                               |--PK6/!CE2
          A9--|                                                                               |--PK7/!CE1
         A10--|                                                                               |--GND
         A11--|                                                                               |--PM0/!CTS
         A12--|                                                                               |--PM1/!RTS
         A13--|                                                                               |--PM2/!IRQ6
         A14--|                                                                               |--PM3/!IRQ3
         VCC--|                                                                               |--PM4/!IRQ2
         A15--|                                                                               |--PM5/!IRQ1
     A16/PA0--|                                                                               |--PM6/!PENIRQ
              |                                                                               |
              |   _                                                                           |
              |  (_)                                                                          |
              |\                                                                              |
              | \                                                                             |
              +-------------------------------------------------------------------------------+
                   | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
                   P P P P P G P P P P P P P P V P P P P P P P P G P P P V C G P P P E X P
                   A A A A A N A A F F F F F F C F F G G G G G G N G G C C L N C M L X T L
                   1 2 3 4 5 D 6 7 0 1 2 3 4 5 C 6 7 7 6 5 4 3 2 D 1 0 0 C K D 4 7 L T A L
                   / / / / /   / / / / / / / /   / / / / / / / /   / / /   O   / / G A L V
                   A A A A A   A A A A A A A A   A A R T ! T ! P   R T M       ! U N L   C
                   1 1 1 2 2   2 2 2 2 2 2 2 2   3 3 T I T I T W   X X O       I A D     C
                   7 8 9 0 1   2 3 4 5 6 7 8 9   0 1 C N O N O M   D D C       R R
                                                     O 1 U 2 U O       L       Q T
                                                         T   T         K       7 G
                                                         1   2                   P
                                                                                 I
                                                                                 O

                   Figure 12-1. MC68328 144-Lead Plastic Thin-Quad Flat Pack Pin Assignment

                      Source: MC68328 (DragonBall)(tm) Integrated Processor User's Manual

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

#ifndef __MC68328_H_
#define __MC68328_H_

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

typedef struct _mc68328_interface mc68328_interface;
struct _mc68328_interface
{
    const char *m68k_cpu_tag;

    write8_device_func  out_port_a_func;    /* 8-bit output */
    write8_device_func  out_port_b_func;    /* 8-bit output */
    write8_device_func  out_port_c_func;    /* 8-bit output */
    write8_device_func  out_port_d_func;    /* 8-bit output */
    write8_device_func  out_port_e_func;    /* 8-bit output */
    write8_device_func  out_port_f_func;    /* 8-bit output */
    write8_device_func  out_port_g_func;    /* 8-bit output */
    write8_device_func  out_port_j_func;    /* 8-bit output */
    write8_device_func  out_port_k_func;    /* 8-bit output */
    write8_device_func  out_port_m_func;    /* 8-bit output */

    read8_device_func   in_port_a_func;     /* 8-bit input */
    read8_device_func   in_port_b_func;     /* 8-bit input */
    read8_device_func   in_port_c_func;     /* 8-bit input */
    read8_device_func   in_port_d_func;     /* 8-bit input */
    read8_device_func   in_port_e_func;     /* 8-bit input */
    read8_device_func   in_port_f_func;     /* 8-bit input */
    read8_device_func   in_port_g_func;     /* 8-bit input */
    read8_device_func   in_port_j_func;     /* 8-bit input */
    read8_device_func   in_port_k_func;     /* 8-bit input */
    read8_device_func   in_port_m_func;     /* 8-bit input */

    write8_device_func  out_pwm_func;       /* 1-bit output */

    write16_device_func out_spim_func;      /* 16-bit output */
    read16_device_func  in_spim_func;       /* 16-bit input */
    void (*spim_xch_trigger)( device_t *device );    /* SPIM exchange trigger */
};
#define MC68328_INTERFACE(name) const mc68328_interface (name)=

#define MC68328_TAG "dragonball"

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

#define MCFG_MC68328_ADD(_intrf) \
    MCFG_DEVICE_ADD("dragonball", MC68328, 0) \
    MCFG_DEVICE_CONFIG(_intrf)

/*----------- defined in machine/mc68328.c -----------*/

/***************************************************************************
    READ/WRITE HANDLERS
***************************************************************************/

WRITE16_DEVICE_HANDLER( mc68328_w );
READ16_DEVICE_HANDLER(  mc68328_r );


/***************************************************************************
    EXTERNAL I/O LINES
***************************************************************************/

void mc68328_set_penirq_line(device_t *device, int state);
void mc68328_set_port_d_lines(device_t *device, UINT8 state, int bit);

/***************************************************************************
    DEVICE INTERFACE
***************************************************************************/

DECLARE_LEGACY_DEVICE(MC68328, mc68328);

/*----------- defined in video/mc68328.c -----------*/

/***************************************************************************
    VIDEO INTERFACE
***************************************************************************/

PALETTE_INIT( mc68328 );
VIDEO_START( mc68328 );
SCREEN_UPDATE_IND16( mc68328 );

#endif // __MC68328_H_