|
20 | 20 | * along with SIO2Arduino; if not, write to the Free Software
|
21 | 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
22 | 22 | */
|
| 23 | +#ifndef CONFIG_H |
| 24 | +#define CONFIG_H |
23 | 25 |
|
24 |
| -/* |
| 26 | +/** |
25 | 27 | * These are SIO2Arduino feature definitions.
|
26 | 28 | */
|
27 | 29 |
|
28 |
| -// uncomment to use an LCD display |
| 30 | +// These are the Arduino devices that can be used. I'm sure others would work, |
| 31 | +// but these are the only ones I have to test with. Only one of these should |
| 32 | +// be uncommented. |
| 33 | +#define ARDUINO_UNO // Arduino Uno board |
| 34 | +//#define ARDUINO_MEGA // Arduino Mega 2560/ADK board |
| 35 | + |
| 36 | +// Uncomment this line if you are using an LCD display |
29 | 37 | //#define LCD_DISPLAY
|
30 | 38 |
|
31 |
| -// uncomment to use a selector button |
| 39 | +// Uncomment this line if you are using a hardware button for image selection |
32 | 40 | #define SELECTOR_BUTTON
|
33 | 41 |
|
34 |
| -// uncomment (and name appropriately) to use a hardware UART for serial communication (e.g. Arduino Mega) |
35 |
| -//#define HARDWARE_UART Serial1 |
| 42 | +// uncomment if using an Ethernet sheild for SD capabilities |
| 43 | +//#define ETHERNET_SHIELD |
| 44 | + |
| 45 | +// uncomment this to enable debug logging -- make sure the HARDWARE_UART isn't the same as |
| 46 | +// the LOGGING_UART defined at the bottom of the file |
| 47 | +#define DEBUG |
36 | 48 |
|
37 | 49 | /*
|
38 | 50 | * These are the Arduino pin definitions.
|
39 | 51 | */
|
40 | 52 |
|
41 |
| -#define PIN_ATARI_CMD 2 // the Atari SIO command line |
42 |
| -#define PIN_SD_CARD 4 // the SD card pin |
| 53 | +#define PIN_ATARI_CMD 2 // the Atari SIO command line - usually the purple wire on the SIO cable |
43 | 54 |
|
44 |
| -#ifndef HARDWARE_UART |
45 |
| -#define PIN_SERIAL_RX 5 |
46 |
| -#define PIN_SERIAL_TX 6 |
| 55 | +#ifdef ETHERNET_SHIELD |
| 56 | + #define PIN_SD_CS 4 // the SD CS line |
| 57 | +#else |
| 58 | + #ifdef ARDUINO_MEGA |
| 59 | + #define PIN_SD_CS 53 // the SD breakout board's CD (card detect) pin |
| 60 | + #define PIN_SD_DI 52 // the SD breakout board's DI pin |
| 61 | + #define PIN_SD_DO 51 // the SD breakout board's DO pin |
| 62 | + #define PIN_SD_CLK 50 // the SD breakout board's CLK pin |
| 63 | + #else |
| 64 | + #define PIN_SD_CS 10 // the SD breakout board's CD (card detect) pin |
| 65 | + #define PIN_SD_DI 11 // the SD breakout board's DI pin |
| 66 | + #define PIN_SD_DO 12 // the SD breakout board's DO pin |
| 67 | + #define PIN_SD_CLK 13 // the SD breakout board's CLK pin |
| 68 | + #endif |
47 | 69 | #endif
|
48 | 70 |
|
49 | 71 | #ifdef SELECTOR_BUTTON
|
50 |
| -#define PIN_SELECTOR 8 // the selector button pin |
| 72 | + #define PIN_SELECTOR 3 // the selector button pin |
51 | 73 | #endif
|
52 | 74 |
|
53 | 75 | #ifdef LCD_DISPLAY
|
54 |
| -#define PIN_LCD_RD 30 // * |
55 |
| -#define PIN_LCD_ENABLE 32 // * |
56 |
| -#define PIN_LCD_DB4 40 // * LCD display pins |
57 |
| -#define PIN_LCD_DB5 38 // * |
58 |
| -#define PIN_LCD_DB6 36 // * |
59 |
| -#define PIN_LCD_DB7 34 // * |
| 76 | + #define PIN_LCD_RD 4 // * |
| 77 | + #define PIN_LCD_ENABLE 5 // * |
| 78 | + #define PIN_LCD_DB4 9 // * LCD display pins |
| 79 | + #define PIN_LCD_DB5 8 // * |
| 80 | + #define PIN_LCD_DB6 7 // * |
| 81 | + #define PIN_LCD_DB7 6 // * |
| 82 | +#endif |
| 83 | + |
| 84 | +// the hardware UART to use for SIO bus communication |
| 85 | +#ifdef ARDUINO_MEGA |
| 86 | + #define SIO_UART Serial1 |
| 87 | + #define SIO_CALLBACK serialEvent1 |
| 88 | +#else |
| 89 | + #define SIO_UART Serial |
| 90 | + #define SIO_CALLBACK serialEvent |
| 91 | +#endif |
| 92 | + |
| 93 | +/** |
| 94 | + * Logging/debug config |
| 95 | + */ |
| 96 | +#ifdef DEBUG |
| 97 | + #define LOGGING_UART Serial |
| 98 | + #define LOG_MSG(...) LOGGING_UART.print(__VA_ARGS__) |
| 99 | + #define LOG_MSG_CR(...) LOGGING_UART.println(__VA_ARGS__) |
| 100 | +#else |
| 101 | + #define LOG_MSG(...) |
| 102 | + #define LOG_MSG_CR(...) |
| 103 | +#endif |
| 104 | + |
60 | 105 | #endif
|
0 commit comments