|
| 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_SINOBIT_ |
| 18 | +#define _VARIANT_SINOBIT_ |
| 19 | + |
| 20 | +/** Master clock frequency */ |
| 21 | +#define VARIANT_MCK (16000000ul) |
| 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 (33u) |
| 36 | +#define NUM_DIGITAL_PINS (20u) |
| 37 | +#define NUM_ANALOG_INPUTS (6u) |
| 38 | +#define NUM_ANALOG_OUTPUTS (0u) |
| 39 | + |
| 40 | +// LEDs |
| 41 | +#define PIN_LED (13) |
| 42 | +#define LED_BUILTIN PIN_LED |
| 43 | + |
| 44 | +// Buttons |
| 45 | +#define PIN_BUTTON_A (5) |
| 46 | +#define PIN_BUTTON_B (11) |
| 47 | + |
| 48 | +/* |
| 49 | + * Analog pins |
| 50 | + */ |
| 51 | +#define PIN_A0 (0) |
| 52 | +#define PIN_A1 (1) |
| 53 | +#define PIN_A2 (2) |
| 54 | +#define PIN_A3 (3) |
| 55 | +#define PIN_A4 (4) |
| 56 | +#define PIN_A5 (10) |
| 57 | + |
| 58 | + |
| 59 | +static const uint8_t A0 = PIN_A0 ; |
| 60 | +static const uint8_t A1 = PIN_A1 ; |
| 61 | +static const uint8_t A2 = PIN_A2 ; |
| 62 | +static const uint8_t A3 = PIN_A3 ; |
| 63 | +static const uint8_t A4 = PIN_A4 ; |
| 64 | +static const uint8_t A5 = PIN_A5 ; |
| 65 | +#define ADC_RESOLUTION 10 |
| 66 | + |
| 67 | +/* |
| 68 | + * Serial interfaces |
| 69 | + */ |
| 70 | +// Serial |
| 71 | +#define PIN_SERIAL_RX (21) |
| 72 | +#define PIN_SERIAL_TX (22) |
| 73 | + |
| 74 | +/* |
| 75 | + * SPI Interfaces |
| 76 | + */ |
| 77 | +#define SPI_INTERFACES_COUNT 1 |
| 78 | + |
| 79 | +#define PIN_SPI_MISO (14) |
| 80 | +#define PIN_SPI_MOSI (15) |
| 81 | +#define PIN_SPI_SCK (13) |
| 82 | + |
| 83 | +static const uint8_t SS = 16 ; |
| 84 | +static const uint8_t MOSI = PIN_SPI_MOSI ; |
| 85 | +static const uint8_t MISO = PIN_SPI_MISO ; |
| 86 | +static const uint8_t SCK = PIN_SPI_SCK ; |
| 87 | + |
| 88 | +/* |
| 89 | + * Wire Interfaces |
| 90 | + */ |
| 91 | +#define WIRE_INTERFACES_COUNT 1 |
| 92 | + |
| 93 | +#define PIN_WIRE_SDA (20u) |
| 94 | +#define PIN_WIRE_SCL (19u) |
| 95 | + |
| 96 | +static const uint8_t SDA = PIN_WIRE_SDA; |
| 97 | +static const uint8_t SCL = PIN_WIRE_SCL; |
| 98 | + |
| 99 | +#ifdef __cplusplus |
| 100 | +} |
| 101 | +#endif |
| 102 | + |
| 103 | +#endif |
0 commit comments