0001
0002 #ifndef _MC6821_H_
0003 #define _MC6821_H_
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef PIA_REG_PADWIDTH
0021 #define PIA_REG_PADWIDTH 255
0022 #endif
0023
0024 struct pia {
0025 union {
0026 volatile u_char pra;
0027 volatile u_char ddra;
0028 } ua;
0029 u_char pad1[PIA_REG_PADWIDTH];
0030 volatile u_char cra;
0031 u_char pad2[PIA_REG_PADWIDTH];
0032 union {
0033 volatile u_char prb;
0034 volatile u_char ddrb;
0035 } ub;
0036 u_char pad3[PIA_REG_PADWIDTH];
0037 volatile u_char crb;
0038 u_char pad4[PIA_REG_PADWIDTH];
0039 };
0040
0041 #define ppra ua.pra
0042 #define pddra ua.ddra
0043 #define pprb ub.prb
0044 #define pddrb ub.ddrb
0045
0046 #define PIA_C1_ENABLE_IRQ (1<<0)
0047 #define PIA_C1_LOW_TO_HIGH (1<<1)
0048 #define PIA_DDR (1<<2)
0049 #define PIA_IRQ2 (1<<6)
0050 #define PIA_IRQ1 (1<<7)
0051
0052 #endif