1 /* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved.
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
14 Web : http://www.circuitsathome.com
15 e-mail : support@circuitsathome.com
18 #ifndef USB_HOST_SHIELD_SETTINGS_H
19 #define USB_HOST_SHIELD_SETTINGS_H
22 ////////////////////////////////////////////////////////////////////////////////
24 ////////////////////////////////////////////////////////////////////////////////
26 /* Set this to 1 to activate serial debugging */
27 #define ENABLE_UHS_DEBUGGING 0
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.
33 #ifndef USB_HOST_SERIAL
34 #define USB_HOST_SERIAL Serial
37 ////////////////////////////////////////////////////////////////////////////////
38 // Manual board activation
39 ////////////////////////////////////////////////////////////////////////////////
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
44 /* Set this to 1 if you are using a Black Widdow */
45 #define USE_UHS_BLACK_WIDDOW 0
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
50 ////////////////////////////////////////////////////////////////////////////////
52 ////////////////////////////////////////////////////////////////////////////////
54 /* Set this to 1 to activate code for the Wii IR camera */
55 #define ENABLE_WII_IR_CAMERA 0
57 ////////////////////////////////////////////////////////////////////////////////
59 ////////////////////////////////////////////////////////////////////////////////
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
67 ////////////////////////////////////////////////////////////////////////////////
68 // Set to 1 to use the faster spi4teensy3 driver.
69 ////////////////////////////////////////////////////////////////////////////////
70 #ifndef USE_SPI4TEENSY3
71 #define USE_SPI4TEENSY3 1
74 ////////////////////////////////////////////////////////////////////////////////
76 ////////////////////////////////////////////////////////////////////////////////
78 // No user serviceable parts below this line.
79 // DO NOT change anything below here unless you are a developer!
81 #include "version_helper.h"
83 #if defined(__GNUC__) && defined(__AVR__)
85 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
87 #if GCC_VERSION < 40602 // Test for GCC < 4.6.2
90 #define PROGMEM __attribute__((section(".progmem.data"))) // Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734#c4
93 #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];})) // Copied from pgmspace.h in avr-libc source
99 #if !defined(DEBUG_USB_HOST) && ENABLE_UHS_DEBUGGING
100 #define DEBUG_USB_HOST
103 #if !defined(WIICAMERA) && ENABLE_WII_IR_CAMERA
107 // To use some other locking (e.g. freertos),
108 // define XMEM_ACQUIRE_SPI and XMEM_RELEASE_SPI to point to your lock and unlock.
109 // NOTE: NO argument is passed. You have to do this within your routine for
110 // whatever you are using to lock and unlock.
111 #if !defined(XMEM_ACQUIRE_SPI)
112 #if USE_XMEM_SPI_LOCK || defined(USE_MULTIPLE_APP_API)
115 #define XMEM_ACQUIRE_SPI() (void(0))
116 #define XMEM_RELEASE_SPI() (void(0))
120 #if !defined(EXT_RAM) && defined(EXT_RAM_STACK) || defined(EXT_RAM_HEAP)
126 #if defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__))
127 #define USING_SPI4TEENSY3 USE_SPI4TEENSY3
129 #define USING_SPI4TEENSY3 0
132 #if ((defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)) || defined(RBL_NRF51822) || defined(__ARDUINO_X86__) || ARDUINO >= 10600) && !USING_SPI4TEENSY3
133 #include <SPI.h> // Use the Arduino SPI library for the Arduino Due, RedBearLab nRF51822, Intel Galileo 1 & 2, Intel Edison or if the SPI library with transaction is available
135 #if defined(__PIC32MX__) || defined(__PIC32MZ__)
136 #include <../../../../hardware/pic32/libraries/SPI/SPI.h> // Hack to use the SPI library
139 #endif /* SETTINGS_H */