|
| 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_BOARD_PCA20006_ |
| 18 | +#define _VARIANT_BOARD_PCA20006_ |
| 19 | + |
| 20 | +/** Master clock frequency */ |
| 21 | +#define VARIANT_MCK (16000000ul) |
| 22 | + |
| 23 | + |
| 24 | +/*---------------------------------------------------------------------------- |
| 25 | + * Headers |
| 26 | + *----------------------------------------------------------------------------*/ |
| 27 | + |
| 28 | +#include "WVariant.h" |
| 29 | + |
| 30 | +#ifdef __cplusplus |
| 31 | +extern "C" |
| 32 | +{ |
| 33 | +#endif // __cplusplus |
| 34 | + |
| 35 | +// Number of pins defined in PinDescription array |
| 36 | +#define PINS_COUNT (32u) |
| 37 | +#define NUM_DIGITAL_PINS (32u) |
| 38 | +#define NUM_ANALOG_INPUTS (6u) |
| 39 | +#define NUM_ANALOG_OUTPUTS (0u) |
| 40 | + |
| 41 | +// LEDs |
| 42 | +#define PIN_LED (15) |
| 43 | +#define PIN_LEDR (16) |
| 44 | +#define PIN_LEDG (12) |
| 45 | +#define PIN_LEDB (15) |
| 46 | +#define LED_BUILTIN PIN_LED |
| 47 | + |
| 48 | +// Buttons |
| 49 | +#define PIN_BUTTON (08) |
| 50 | +#define PIN_SW1 (08) |
| 51 | +#define PIN_SW2 (18) |
| 52 | + |
| 53 | +/* |
| 54 | + * Analog pins |
| 55 | + */ |
| 56 | +#define PIN_A0 (1) |
| 57 | +#define PIN_A1 (2) |
| 58 | +#define PIN_A2 (3) |
| 59 | +#define PIN_A3 (4) |
| 60 | +#define PIN_A4 (5) |
| 61 | +#define PIN_A5 (6) |
| 62 | + |
| 63 | +static const uint8_t A0 = PIN_A0 ; |
| 64 | +static const uint8_t A1 = PIN_A1 ; |
| 65 | +static const uint8_t A2 = PIN_A2 ; |
| 66 | +static const uint8_t A3 = PIN_A3 ; |
| 67 | +static const uint8_t A4 = PIN_A4 ; |
| 68 | +static const uint8_t A5 = PIN_A5 ; |
| 69 | + |
| 70 | +#define ADC_RESOLUTION 10 |
| 71 | + |
| 72 | +/* |
| 73 | + * Serial interfaces |
| 74 | + */ |
| 75 | +// Serial |
| 76 | +#define PIN_SERIAL_RX (11) |
| 77 | +#define PIN_SERIAL_TX (9) |
| 78 | + |
| 79 | +/* |
| 80 | + * SPI Interfaces |
| 81 | + */ |
| 82 | +#define SPI_INTERFACES_COUNT 1 |
| 83 | + |
| 84 | +#define PIN_SPI_MISO (0) |
| 85 | +#define PIN_SPI_MOSI (1) |
| 86 | +#define PIN_SPI_SCK (2) |
| 87 | + |
| 88 | +static const uint8_t SS = 3 ; |
| 89 | +static const uint8_t MOSI = PIN_SPI_MOSI ; |
| 90 | +static const uint8_t MISO = PIN_SPI_MISO ; |
| 91 | +static const uint8_t SCK = PIN_SPI_SCK ; |
| 92 | + |
| 93 | +/* |
| 94 | + * Wire Interfaces |
| 95 | + */ |
| 96 | +#define WIRE_INTERFACES_COUNT 1 |
| 97 | + |
| 98 | +#define PIN_WIRE_SDA (21u) |
| 99 | +#define PIN_WIRE_SCL (24u) |
| 100 | + |
| 101 | +static const uint8_t SDA = PIN_WIRE_SDA; |
| 102 | +static const uint8_t SCL = PIN_WIRE_SCL; |
| 103 | + |
| 104 | +#ifdef __cplusplus |
| 105 | +} |
| 106 | +#endif |
| 107 | + |
| 108 | +#endif |
0 commit comments