2 * Copyright (C) 2007 Anton Blad
3 * Copyright (C) 2007 Fredrik Kuivinen
4 * Copyright (C) 2007 Jakob Rosén
6 * This file is licensed under GPL v2.
14 // Pin definitions for C64 and TAPE interfaces.
24 // RSIG on PC7 (Multiplexed input of TAPEREAD and C64WRITE)
25 // RSIGSEL on PB5 (Control signal for RSIG multiplexer)
33 #define DDR_MOTOR DDRB
34 #define PORT_MOTOR PORTB
35 #define PIN_MOTOR PINB
38 #define DDR_C64READ DDRC
39 #define PORT_C64READ PORTC
40 #define PIN_C64READ PINC
43 #define DDR_C64WRITE DDRD
44 #define PORT_C64WRITE PORTD
45 #define PIN_C64WRITE PIND
48 #define DDR_C64SENSE DDRC
49 #define PORT_C64SENSE PORTC
50 #define PIN_C64SENSE PINC
53 #define DDR_TAPEREAD DDRD
54 #define PORT_TAPEREAD PORTD
55 #define PIN_TAPEREAD PIND
58 #define DDR_TAPEWRITE DDRC
59 #define PORT_TAPEWRITE PORTC
60 #define PIN_TAPEWRITE PINC
63 #define DDR_TAPESENSE DDRC
64 #define PORT_TAPESENSE PORTC
65 #define PIN_TAPESENSE PINC
68 #define DDR_RSIGSEL DDRB
69 #define PORT_RSIGSEL PORTB
70 #define PIN_RSIGSEL PINB
73 #else /* HWBOARD==DEVTRUT */
75 #define DDR_MOTOR DDRB
76 #define PORT_MOTOR PORTB
77 #define PIN_MOTOR PINB
80 #define DDR_C64READ DDRB
81 #define PORT_C64READ PORTB
82 #define PIN_C64READ PINB
93 static inline void c64read_on() { PORT_C64READ
|= _BV(P_C64READ
); }
94 static inline void c64read_off() { PORT_C64READ
&= ~(_BV(P_C64READ
)); }
96 static inline void c64sense_on() { PORT_C64SENSE
&= ~(1 << P_C64SENSE
); }
97 static inline void c64sense_off() { PORT_C64SENSE
|= (1 << P_C64SENSE
); }
99 static inline uint8_t c64write_ison()
101 return (PIN_C64WRITE
& _BV(P_C64WRITE
));
104 static inline uint8_t taperead_ison()
106 return (PIN_TAPEREAD
& _BV(P_TAPEREAD
));
109 static inline uint8_t tapesense_ison()
111 return !(PIN_TAPESENSE
& _BV(P_TAPESENSE
));
114 static inline void tapewrite_on() { PORT_TAPEWRITE
|= _BV(P_TAPEWRITE
); }
115 static inline void tapewrite_off() { PORT_TAPEWRITE
&= ~(_BV(P_TAPEWRITE
)); }
118 static inline void rsig(uint8_t sel
)
121 PORT_RSIGSEL
&= ~(_BV(P_RSIGSEL
));
123 PORT_RSIGSEL
|= _BV(P_RSIGSEL
);
127 static inline void c64sense_on() { }
128 static inline void c64sense_off() { }