| EVShield v1.3 EVShield Library Reference by mindsensors.com

SHDefines.h
Go to the documentation of this file.
1
5 /*
6 * EVShield interface library
7 * Copyright (C) 2015 mindsensors.com
8 *
9 * This file is part of EVShield 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_EVSHIELD_D
31 #else
32 #define MODEL_EVSHIELD_M
33 #endif
34
35 #elif defined(__PIC32MX__)
36
37 #if defined(_BOARD_UNO_)
38 #define MODEL_EVSHIELD_D
39 #elif defined(_BOARD_MEGA_)
40 #define MODEL_EVSHIELD_M
41 #endif
42
43 #endif
44 #if defined(ARDUINO_ARC32_TOOLS)
45 #define MODEL_EVSHIELD_D
46 #endif
47
48
52 typedef enum {
53 SH_BAS1 = 0x01,
54 SH_BAS2 = 0x02,
55 SH_BBS1 = 0x03,
56 SH_BBS2 = 0x04
57 } SH_BankPort;
58
60
63 typedef enum {
64 SH_HardwareI2C = 0,
65 SH_SoftwareI2C,
66 } SH_Protocols;
67
68 #if defined(MODEL_EVSHIELD_D)
69 // Arduino Duemilanove, Uno
70 #define SCL_BAS1 A5
71 #define SDA_BAS1 A4
72 #define SCL_BAS2 2
73 #define SDA_BAS2 A0
74 #define SCL_BBS1 4
75 #define SDA_BBS1 A1
76 #define SCL_BBS2 7
77 #define SDA_BBS2 A2
78
79 // deepak
80 #define BTN_RIGHT 4
81 #define BTN_LEFT 1
82 // deepak end
83
84 #define BTN_GO 2
85 #define LED_RED 8
86 #define LED_GREEN A3
87 #define LED_BLUE 12
88
89 #else
90 // Arduino mega, 2560
91 #define SCL_BAS1 21
92 #define SDA_BAS1 20
93 #define SCL_BAS2 19
94 #define SDA_BAS2 A13
95 #define SCL_BBS1 17
96 #define SDA_BBS1 A14
97 #define SCL_BBS2 18
98 #define SDA_BBS2 A15
99
100 #define BTN_LEFT 16
101 #define BTN_GO 15
102 #define BTN_RIGHT 14
103 #define LED_RED 16
104 #define LED_GREEN 15
105 #define LED_BLUE 14
106
107 #endif
108
109 #endif
SH_HardwareI2C
Definition: SHDefines.h:64
SH_BBS2
Definition: SHDefines.h:56
SH_SoftwareI2C
Definition: SHDefines.h:65
SH_Protocols
SH_Protocols
Protocols supported by EVShield.
Definition: SHDefines.h:63
SH_BAS2
Definition: SHDefines.h:54
SH_BankPort
SH_BankPort
Definition: SHDefines.h:52
SH_BBS1
Definition: SHDefines.h:55
SH_BAS1
Definition: SHDefines.h:53