USB Host Shield 2.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
settings.h
Go to the documentation of this file.
1 /*
2  * File: settings.h
3  * Author: xxxajk
4  *
5  * Created on September 23, 2013, 12:00 AM
6  */
7 
8 #ifndef USB_HOST_SHIELD_SETTINGS_H
9 #define USB_HOST_SHIELD_SETTINGS_H
10 #include "macros.h"
11 
13 // DEBUGGING
15 
16 /* Set this to 1 to activate serial debugging */
17 #define ENABLE_UHS_DEBUGGING 0
18 
19 /* This can be used to select which serial port to use for debugging if
20  * multiple serial ports are available.
21  * For example Serial3.
22  */
23 #ifndef USB_HOST_SERIAL
24 #define USB_HOST_SERIAL Serial
25 #endif
26 
28 // Manual board activation
30 
31 /* Set this to 1 if you are using an Arduino Mega ADK board with MAX3421e built-in */
32 #define USE_UHS_MEGA_ADK 0 // If you are using Arduino 1.5.5 or newer there is no need to do this manually
33 
34 /* Set this to 1 if you are using a Black Widdow */
35 #define USE_UHS_BLACK_WIDDOW 0
36 
37 /* Set this to a one to use the xmem2 lock. This is needed for multitasking and threading */
38 #define USE_XMEM_SPI_LOCK 0
39 
41 // Wii IR camera
43 
44 /* Set this to 1 to activate code for the Wii IR camera */
45 #define ENABLE_WII_IR_CAMERA 0
46 
48 // MASS STORAGE
50 // <<<<<<<<<<<<<<<< IMPORTANT >>>>>>>>>>>>>>>
51 // Set this to 1 to support single LUN devices, and save RAM. -- I.E. thumb drives.
52 // Each LUN needs ~13 bytes to be able to track the state of each unit.
53 #ifndef MASS_MAX_SUPPORTED_LUN
54 #define MASS_MAX_SUPPORTED_LUN 8
55 #endif
56 
58 // Set to 1 to use the faster spi4teensy3 driver.
60 #ifndef USE_SPI4TEENSY3
61 #define USE_SPI4TEENSY3 1
62 #endif
63 
65 // AUTOMATIC Settings
67 
68 // No user serviceable parts below this line.
69 // DO NOT change anything below here unless you are a developer!
70 
71 // When will we drop support for the older bug-ridden stuff?
72 #if defined(ARDUINO) && ARDUINO >=100
73 #include <Arduino.h>
74 #else
75 #include <WProgram.h>
76 #include <pins_arduino.h>
77 #include <avr/pgmspace.h>
78 #include <avr/io.h>
79 #define F(str) (str)
80 #endif
81 
82 #ifdef __GNUC__
83 #ifndef GCC_VERSION
84 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
85 #endif
86 #if GCC_VERSION < 40602 // Test for GCC < 4.6.2
87 #ifdef PROGMEM
88 #undef PROGMEM
89 #define PROGMEM __attribute__((section(".progmem.data"))) // Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734#c4
90 #ifdef PSTR
91 #undef PSTR
92 #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];})) // Copied from pgmspace.h in avr-libc source
93 #endif
94 #endif
95 #endif
96 #endif
97 
98 #if !defined(DEBUG_USB_HOST) && ENABLE_UHS_DEBUGGING
99 #define DEBUG_USB_HOST
100 #endif
101 
102 #if !defined(WIICAMERA) && ENABLE_WII_IR_CAMERA
103 #define WIICAMERA
104 #endif
105 
106 #if USE_XMEM_SPI_LOCK | defined(USE_MULTIPLE_APP_API)
107 #include <xmem.h>
108 #else
109 #define XMEM_ACQUIRE_SPI() (void(0))
110 #define XMEM_RELEASE_SPI() (void(0))
111 #endif
112 
113 #if defined(__MK20DX128__) || defined(__MK20DX256__)
114 #define USING_SPI4TEENSY3 USE_SPI4TEENSY3
115 #else
116 #define USING_SPI4TEENSY3 0
117 #endif
118 
119 #endif /* SETTINGS_H */