NXShield  v1.07
NXShield Library Reference by OpenElectrons.com
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
SHDefines.h
Go to the documentation of this file.
1 
5 /*
6  * NXShield interface library
7  * Copyright (C) 2011 mindsensors.com
8  *
9  * This file is part of NXShield interface library.
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 2.1 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24 
25 #ifndef SHDEFINES_H
26 #define SHDEFINES_H
27 
28 #if defined(__AVR__)
29  #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega328P__)
30  #define MODEL_NXSHIELD_D
31  #else
32  #define MODEL_NXSHIELD_M
33  #endif
34 
35 #elif defined(__PIC32MX__)
36 
37  #if defined(_BOARD_UNO_)
38  #define MODEL_NXSHIELD_D
39  #elif defined(_BOARD_MEGA_)
40  #define MODEL_NXSHIELD_M
41  #endif
42 
43 #endif
44 
45 
49 typedef enum {
50  SH_BAS1 = 0x01,
51  SH_BAS2 = 0x02,
52  SH_BBS1 = 0x03,
53  SH_BBS2 = 0x04
54 } SH_BankPort;
55 
57 
60 typedef enum {
63 } SH_Protocols;
64 
65 #if defined(MODEL_NXSHIELD_D)
66  // Arduino Duemilanove, Uno
67  #define SCL_BAS1 A5
68  #define SDA_BAS1 A4
69  #define SCL_BAS2 2
70  #define SDA_BAS2 A0
71  #define SCL_BBS1 4
72  #define SDA_BBS1 A1
73  #define SCL_BBS2 7
74  #define SDA_BBS2 A2
75 
76  #define BTN_LEFT 8
77  #define BTN_RIGHT 12
78  #define BTN_GO A3
79  #define LED_RED 8
80  #define LED_GREEN A3
81  #define LED_BLUE 12
82 
83 #else
84  // Arduino mega, 2560
85  #define SCL_BAS1 21
86  #define SDA_BAS1 20
87  #define SCL_BAS2 19
88  #define SDA_BAS2 A13
89  #define SCL_BBS1 17
90  #define SDA_BBS1 A14
91  #define SCL_BBS2 18
92  #define SDA_BBS2 A15
93 
94  #define BTN_LEFT 16
95  #define BTN_GO 15
96  #define BTN_RIGHT 14
97  #define LED_RED 16
98  #define LED_GREEN 15
99  #define LED_BLUE 14
100 
101 #endif
102 
103 #endif
104 
Definition: SHDefines.h:61
Definition: SHDefines.h:53
Definition: SHDefines.h:62
SH_Protocols
Protocols supported by NXShield.
Definition: SHDefines.h:60
Definition: SHDefines.h:51
SH_BankPort
Definition: SHDefines.h:49
Definition: SHDefines.h:52
Definition: SHDefines.h:50