-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathconfig.h
150 lines (131 loc) · 4.97 KB
/
config.h
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
/*
* config.h - Configuration for the SIO2Arduino build.
*
* Copyright (c) 2012 Whizzo Software LLC (Daniel Noguerol)
*
* This file is part of the SIO2Arduino project which emulates
* Atari 8-bit SIO devices on Arduino hardware.
*
* SIO2Arduino is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SIO2Arduino is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SIO2Arduino; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef CONFIG_H
#define CONFIG_H
/**
* These are SIO2Arduino feature definitions.
*/
// These are the Arduino devices that can be used. I'm sure others would work,
// but these are the only ones I have to test with. Only one of these should
// be uncommented.
#define ARDUINO_UNO // Arduino Uno board
//#define ARDUINO_MEGA // Arduino Mega 2560/ADK board
//#define ARDUINO_TEENSY // PJRC Teensy 2.0
// Uncomment this line if you are using an LCD display
//#define LCD_DISPLAY
// Uncomment this line if you are using a hardware button for image selection
#define SELECTOR_BUTTON
// Uncomment this line if you want a reset button (automatically mounts /AUTORUN.ATR) (deprecated, AUTORUN.ATR always mounted if it exists)
//#define RESET_BUTTON
// uncomment if using an Ethernet shield for SD capabilities
//#define ETHERNET_SHIELD
// uncomment for PRO image format support
//#define PRO_IMAGES
// uncomment for ATX image format support (Mega 2560 only)
//#define ATX_IMAGES
// uncomment for XEX "image" support
#define XEX_IMAGES
// uncomment this to enable debug logging -- make sure the HARDWARE_UART isn't the same as
// the LOGGING_UART defined at the bottom of the file
//#define DEBUG
/*
* These are the Arduino pin definitions.
*/
#ifdef ARDUINO_TEENSY
#define PIN_ATARI_CMD 4 // the Atari SIO command line - usually the purple wire on the SIO cable
#else
#define PIN_ATARI_CMD 2 // the Atari SIO command line - usually the purple wire on the SIO cable
#endif
// for now, you can't change these pin definitions
#ifdef ETHERNET_SHIELD
#define PIN_SD_CS 4 // the SD CS line
#else
#ifdef ARDUINO_MEGA
#define PIN_SD_CS 53 // the SD breakout board's CS (chip select) pin
#define PIN_SD_DI 51 // the SD breakout board's DI pin
#define PIN_SD_DO 50 // the SD breakout board's DO pin
#define PIN_SD_CLK 52 // the SD breakout board's CLK pin
#endif
#ifdef ARDUINO_UNO
#define PIN_SD_CS 10 // the SD breakout board's CS (chip select) pin
#define PIN_SD_DI 11 // the SD breakout board's DI pin
#define PIN_SD_DO 12 // the SD breakout board's DO pin
#define PIN_SD_CLK 13 // the SD breakout board's CLK pin
#endif
#ifdef ARDUINO_TEENSY
#define PIN_SD_CS 0 // the SD breakout board's CS (chip select) pin
#define PIN_SD_DI 1 // the SD breakout board's DI pin
#define PIN_SD_DO 2 // the SD breakout board's DO pin
#define PIN_SD_CLK 3 // the SD breakout board's CLK pin
#endif
#endif
#ifdef SELECTOR_BUTTON
#define PIN_SELECTOR 3 // the selector button pin
#endif
#ifdef RESET_BUTTON
#ifdef ARDUINO_TEENSY
#define PIN_RESET 5 // the reset button pin
#else
#define PIN_RESET 3 // the reset button pin
#endif
#endif
#ifdef LCD_DISPLAY
#ifdef ARDUINO_MEGA
#define PIN_LCD_RD 5 // *
#define PIN_LCD_ENABLE 6 // *
#define PIN_LCD_DB4 10 // * LCD display pins
#define PIN_LCD_DB5 9 // *
#define PIN_LCD_DB6 8 // *
#define PIN_LCD_DB7 7 // *
#else
#define PIN_LCD_RD 4 // *
#define PIN_LCD_ENABLE 5 // *
#define PIN_LCD_DB4 9 // * LCD display pins
#define PIN_LCD_DB5 8 // *
#define PIN_LCD_DB6 7 // *
#define PIN_LCD_DB7 6 // *
#endif
#endif
// the hardware UART to use for SIO bus communication
#if defined(ARDUINO_MEGA) || defined(ARDUINO_TEENSY)
#define SIO_UART Serial1
#define SIO_CALLBACK serialEvent1
#else
#define SIO_UART Serial
#define SIO_CALLBACK serialEvent
#endif
//#define DEBUG
/**
* Logging/debug config
*/
#ifdef DEBUG
#define LOGGING_UART Serial
#define LOG_MSG(...) LOGGING_UART.print(__VA_ARGS__)
#define LOG_MSG_CR(...) LOGGING_UART.println(__VA_ARGS__)
#define LOG_MSG_FLUSH() LOGGING_UART.flush()
#else
#define LOG_MSG(...)
#define LOG_MSG_CR(...)
#define LOG_MSG_FLUSH()
#endif
#endif