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 /* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved.
2 
3 This software may be distributed and modified under the terms of the GNU
4 General Public License version 2 (GPL2) as published by the Free Software
5 Foundation and appearing in the file GPL2.TXT included in the packaging of
6 this file. Please note that GPL2 Section 2[b] requires that all works based
7 on this software must also be made publicly available under the terms of
8 the GPL2 ("Copyleft").
9 
10 Contact information
11 -------------------
12 
13 Circuits At Home, LTD
14 Web : http://www.circuitsathome.com
15 e-mail : support@circuitsathome.com
16  */
17 
18 #ifndef USB_HOST_SHIELD_SETTINGS_H
19 #define USB_HOST_SHIELD_SETTINGS_H
20 #include "macros.h"
21 
23 // DEBUGGING
25 
26 /* Set this to 1 to activate serial debugging */
27 #define ENABLE_UHS_DEBUGGING 0
28 
29 /* This can be used to select which serial port to use for debugging if
30  * multiple serial ports are available.
31  * For example Serial3.
32  */
33 #ifndef USB_HOST_SERIAL
34 #define USB_HOST_SERIAL Serial
35 #endif
36 
38 // Manual board activation
40 
41 /* Set this to 1 if you are using an Arduino Mega ADK board with MAX3421e built-in */
42 #define USE_UHS_MEGA_ADK 0 // If you are using Arduino 1.5.5 or newer there is no need to do this manually
43 
44 /* Set this to 1 if you are using a Black Widdow */
45 #define USE_UHS_BLACK_WIDDOW 0
46 
47 /* Set this to a one to use the xmem2 lock. This is needed for multitasking and threading */
48 #define USE_XMEM_SPI_LOCK 0
49 
51 // Wii IR camera
53 
54 /* Set this to 1 to activate code for the Wii IR camera */
55 #define ENABLE_WII_IR_CAMERA 0
56 
58 // MASS STORAGE
60 // <<<<<<<<<<<<<<<< IMPORTANT >>>>>>>>>>>>>>>
61 // Set this to 1 to support single LUN devices, and save RAM. -- I.E. thumb drives.
62 // Each LUN needs ~13 bytes to be able to track the state of each unit.
63 #ifndef MASS_MAX_SUPPORTED_LUN
64 #define MASS_MAX_SUPPORTED_LUN 8
65 #endif
66 
68 // Set to 1 to use the faster spi4teensy3 driver.
70 #ifndef USE_SPI4TEENSY3
71 #define USE_SPI4TEENSY3 1
72 #endif
73 
75 // AUTOMATIC Settings
77 
78 // No user serviceable parts below this line.
79 // DO NOT change anything below here unless you are a developer!
80 
81 #if defined(ARDUINO) && ARDUINO >=100
82 #include <Arduino.h>
83 #else
84 #include <WProgram.h>
85 #include <pins_arduino.h>
86 #include <avr/pgmspace.h>
87 #include <avr/io.h>
88 #define F(str) (str)
89 #endif
90 
91 #if defined(__GNUC__) && defined(__AVR__)
92 #ifndef GCC_VERSION
93 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
94 #endif
95 #if GCC_VERSION < 40602 // Test for GCC < 4.6.2
96 #ifdef PROGMEM
97 #undef PROGMEM
98 #define PROGMEM __attribute__((section(".progmem.data"))) // Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734#c4
99 #ifdef PSTR
100 #undef PSTR
101 #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];})) // Copied from pgmspace.h in avr-libc source
102 #endif
103 #endif
104 #endif
105 #endif
106 
107 #if !defined(DEBUG_USB_HOST) && ENABLE_UHS_DEBUGGING
108 #define DEBUG_USB_HOST
109 #endif
110 
111 #if !defined(WIICAMERA) && ENABLE_WII_IR_CAMERA
112 #define WIICAMERA
113 #endif
114 
115 // To use some other locking (e.g. freertos),
116 // define XMEM_ACQUIRE_SPI and XMEM_RELEASE_SPI to point to your lock and unlock.
117 // NOTE: NO argument is passed. You have to do this within your routine for
118 // whatever you are using to lock and unlock.
119 #if !defined(XMEM_ACQUIRE_SPI)
120 #if USE_XMEM_SPI_LOCK || defined(USE_MULTIPLE_APP_API)
121 #include <xmem.h>
122 #else
123 #define XMEM_ACQUIRE_SPI() (void(0))
124 #define XMEM_RELEASE_SPI() (void(0))
125 #endif
126 #endif
127 
128 #if !defined(EXT_RAM) && defined(EXT_RAM_STACK) || defined(EXT_RAM_HEAP)
129 #include <xmem.h>
130 #else
131 #define EXT_RAM 0
132 #endif
133 
134 #if defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__))
135 #define USING_SPI4TEENSY3 USE_SPI4TEENSY3
136 #else
137 #define USING_SPI4TEENSY3 0
138 #endif
139 
140 #if defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)
141 #include <SPI.h> // Use the Arduino SPI library for the Arduino Due
142 #endif
143 
144 #endif /* SETTINGS_H */