|  | 
|  | 1 | +/* | 
|  | 2 | +  Copyright (c) 2014-2015 Arduino LLC.  All right reserved. | 
|  | 3 | +  Copyright (c) 2016 Sandeep Mistry All right reserved. | 
|  | 4 | +  This library is free software; you can redistribute it and/or | 
|  | 5 | +  modify it under the terms of the GNU Lesser General Public | 
|  | 6 | +  License as published by the Free Software Foundation; either | 
|  | 7 | +  version 2.1 of the License, or (at your option) any later version. | 
|  | 8 | +  This library is distributed in the hope that it will be useful, | 
|  | 9 | +  but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|  | 10 | +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 
|  | 11 | +  See the GNU Lesser General Public License for more details. | 
|  | 12 | +  You should have received a copy of the GNU Lesser General Public | 
|  | 13 | +  License along with this library; if not, write to the Free Software | 
|  | 14 | +  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA | 
|  | 15 | +*/ | 
|  | 16 | + | 
|  | 17 | +#ifndef _VARIANT_ELECTRONUT_HACKABLE_V2_ | 
|  | 18 | +#define _VARIANT_ELECTRONUT_HACKABLE_V2_ | 
|  | 19 | + | 
|  | 20 | +/** Master clock frequency */ | 
|  | 21 | +#define VARIANT_MCK       (64000000ul) | 
|  | 22 | + | 
|  | 23 | +/*---------------------------------------------------------------------------- | 
|  | 24 | + *        Headers | 
|  | 25 | + *----------------------------------------------------------------------------*/ | 
|  | 26 | + | 
|  | 27 | +#include "WVariant.h" | 
|  | 28 | + | 
|  | 29 | +#ifdef __cplusplus | 
|  | 30 | +extern "C" | 
|  | 31 | +{ | 
|  | 32 | +#endif // __cplusplus | 
|  | 33 | + | 
|  | 34 | +// Number of pins defined in PinDescription array | 
|  | 35 | +#define PINS_COUNT           (32u) | 
|  | 36 | +#define NUM_DIGITAL_PINS     (32u) | 
|  | 37 | +#define NUM_ANALOG_INPUTS    (8u) | 
|  | 38 | +#define NUM_ANALOG_OUTPUTS   (0u) | 
|  | 39 | + | 
|  | 40 | +// LEDs | 
|  | 41 | +#define PIN_LEDR               (19) | 
|  | 42 | +#define PIN_LEDG               (20) | 
|  | 43 | +#define PIN_LEDB               (17) | 
|  | 44 | +#define LED_BUILTIN            PIN_LEDB | 
|  | 45 | + | 
|  | 46 | +/* | 
|  | 47 | + * Analog pins | 
|  | 48 | + */ | 
|  | 49 | +#define PIN_A0               (2) | 
|  | 50 | +#define PIN_A1               (3) | 
|  | 51 | +#define PIN_A2               (4) | 
|  | 52 | +#define PIN_A3               (5) | 
|  | 53 | +#define PIN_A4               (28) | 
|  | 54 | +#define PIN_A5               (29) | 
|  | 55 | +#define PIN_A6               (30) | 
|  | 56 | +#define PIN_A7               (31) | 
|  | 57 | + | 
|  | 58 | +static const uint8_t A0  = PIN_A0 ; // AIN0 / AREF / P0.02 | 
|  | 59 | +static const uint8_t A1  = PIN_A1 ; // AIN1 | 
|  | 60 | +static const uint8_t A2  = PIN_A2 ; // AIN2 | 
|  | 61 | +static const uint8_t A3  = PIN_A3 ; // AIN3 | 
|  | 62 | +static const uint8_t A4  = PIN_A4 ; // AIN4 | 
|  | 63 | +static const uint8_t A5  = PIN_A5 ; // AIN5 | 
|  | 64 | +static const uint8_t A6  = PIN_A6 ; // AIN6 | 
|  | 65 | +static const uint8_t A7  = PIN_A7 ; // AIN7 | 
|  | 66 | +#define ADC_RESOLUTION    10 | 
|  | 67 | + | 
|  | 68 | +// Other pins | 
|  | 69 | +#define PIN_AREF           (PIN_A0) | 
|  | 70 | +static const uint8_t AREF = PIN_AREF; | 
|  | 71 | + | 
|  | 72 | +/* | 
|  | 73 | + * Serial interfaces | 
|  | 74 | + */ | 
|  | 75 | +// Serial | 
|  | 76 | +#define PIN_SERIAL_RX       (7) | 
|  | 77 | +#define PIN_SERIAL_TX       (8) | 
|  | 78 | + | 
|  | 79 | +/* | 
|  | 80 | + * SPI Interfaces | 
|  | 81 | + */ | 
|  | 82 | +#define SPI_INTERFACES_COUNT 1 | 
|  | 83 | + | 
|  | 84 | +#define PIN_SPI_MISO         (11) | 
|  | 85 | +#define PIN_SPI_MOSI         (12) | 
|  | 86 | +#define PIN_SPI_SCK          (13) | 
|  | 87 | +#define PIN_SPI_SS           (14) | 
|  | 88 | + | 
|  | 89 | +static const uint8_t SS   = PIN_SPI_SS ; | 
|  | 90 | +static const uint8_t MOSI = PIN_SPI_MOSI ; | 
|  | 91 | +static const uint8_t MISO = PIN_SPI_MISO ; | 
|  | 92 | +static const uint8_t SCK  = PIN_SPI_SCK ; | 
|  | 93 | + | 
|  | 94 | +/* | 
|  | 95 | + * Wire Interfaces | 
|  | 96 | + */ | 
|  | 97 | +#define WIRE_INTERFACES_COUNT 1 | 
|  | 98 | + | 
|  | 99 | +#define PIN_WIRE_SDA         (2) | 
|  | 100 | +#define PIN_WIRE_SCL         (3) | 
|  | 101 | + | 
|  | 102 | +/* | 
|  | 103 | + * Reset Button at P0.21 | 
|  | 104 | + */ | 
|  | 105 | +#define RESET_PIN            21 | 
|  | 106 | + | 
|  | 107 | +#ifdef __cplusplus | 
|  | 108 | +} | 
|  | 109 | +#endif | 
|  | 110 | + | 
|  | 111 | +/*---------------------------------------------------------------------------- | 
|  | 112 | + *        Arduino objects - C++ only | 
|  | 113 | + *----------------------------------------------------------------------------*/ | 
|  | 114 | + | 
|  | 115 | +#endif | 
0 commit comments