|  | 
|  | 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_DWM1001-DEV_ | 
|  | 18 | +#define _VARIANT_DWM1001-DEV_ | 
|  | 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           (29u) | 
|  | 36 | +#define NUM_DIGITAL_PINS     (13u) | 
|  | 37 | +#define NUM_ANALOG_INPUTS    (2u) | 
|  | 38 | +#define NUM_ANALOG_OUTPUTS   (0u) | 
|  | 39 | + | 
|  | 40 | +// LEDs | 
|  | 41 | +#define PIN_LEDRT            (24) | 
|  | 42 | +#define PIN_LEDRB            (25) | 
|  | 43 | +#define PIN_LEDG             (26) | 
|  | 44 | +#define PIN_LEDB             (27) | 
|  | 45 | +#define LED_BUILTIN          PIN_LEDRT | 
|  | 46 | +static const uint8_t LED_RED_TOP = PIN_LEDRT ; | 
|  | 47 | +static const uint8_t LED_RED_BOT = PIN_LEDRB ; | 
|  | 48 | +static const uint8_t LED_GREEN   = PIN_LEDG ; | 
|  | 49 | +static const uint8_t LED_BLUE    = PIN_LEDB ; | 
|  | 50 | + | 
|  | 51 | +// Button | 
|  | 52 | +#define PIN_BUTTON           (28) | 
|  | 53 | + | 
|  | 54 | +static const uint8_t BTN = PIN_BUTTON ; | 
|  | 55 | + | 
|  | 56 | +/* | 
|  | 57 | + * Analog pins | 
|  | 58 | + */ | 
|  | 59 | +#define PIN_A0               (11) | 
|  | 60 | +#define PIN_A1               (15) | 
|  | 61 | + | 
|  | 62 | +static const uint8_t A0  = PIN_A0 ; // AIN2 | 
|  | 63 | +static const uint8_t A1  = PIN_A1 ; // AIN1 | 
|  | 64 | +#define ADC_RESOLUTION    14 | 
|  | 65 | + | 
|  | 66 | +/* | 
|  | 67 | + * Serial interfaces | 
|  | 68 | + */ | 
|  | 69 | +// Serial | 
|  | 70 | +#define PIN_SERIAL_RX       (15) | 
|  | 71 | +#define PIN_SERIAL_TX       (16) | 
|  | 72 | + | 
|  | 73 | +/* | 
|  | 74 | + * SPI Interfaces | 
|  | 75 | + */ | 
|  | 76 | +#define SPI_INTERFACES_COUNT 2 | 
|  | 77 | + | 
|  | 78 | +#define PIN_SPI_MISO         (10) | 
|  | 79 | +#define PIN_SPI_MOSI         (9) | 
|  | 80 | +#define PIN_SPI_SCK          (PIN_A0) | 
|  | 81 | + | 
|  | 82 | +static const uint8_t SS   = PIN_A1 ; | 
|  | 83 | +static const uint8_t MOSI = PIN_SPI_MOSI ; | 
|  | 84 | +static const uint8_t MISO = PIN_SPI_MISO ; | 
|  | 85 | +static const uint8_t SCK  = PIN_SPI_SCK ; | 
|  | 86 | + | 
|  | 87 | +#define PIN_SPI1_SS          (17) | 
|  | 88 | +#define PIN_SPI1_MISO        (18) | 
|  | 89 | +#define PIN_SPI1_MOSI        (19) | 
|  | 90 | +#define PIN_SPI1_SCK         (20) | 
|  | 91 | + | 
|  | 92 | +static const uint8_t SS1   = PIN_SPI1_SS ; | 
|  | 93 | +static const uint8_t MOSI1 = PIN_SPI1_MOSI ; | 
|  | 94 | +static const uint8_t MISO1 = PIN_SPI1_MISO ; | 
|  | 95 | +static const uint8_t SCK1  = PIN_SPI1_SCK ; | 
|  | 96 | + | 
|  | 97 | +/* | 
|  | 98 | + * Wire Interfaces | 
|  | 99 | + */ | 
|  | 100 | +#define WIRE_INTERFACES_COUNT 1 | 
|  | 101 | + | 
|  | 102 | +#define PIN_WIRE_SDA         (13) | 
|  | 103 | +#define PIN_WIRE_SCL         (14) | 
|  | 104 | + | 
|  | 105 | +static const uint8_t SDA = PIN_WIRE_SDA; | 
|  | 106 | +static const uint8_t SCL = PIN_WIRE_SCL; | 
|  | 107 | + | 
|  | 108 | +/* | 
|  | 109 | + * Reset Button at P0.21 | 
|  | 110 | + */ | 
|  | 111 | +#define RESET_PIN            21 | 
|  | 112 | + | 
|  | 113 | +/* | 
|  | 114 | + * Other DWM1001 internal IOs | 
|  | 115 | + */ | 
|  | 116 | +#define PIN_DW_RST           (21) | 
|  | 117 | +#define PIN_DW_IRQ           (22) | 
|  | 118 | + | 
|  | 119 | +static const uint8_t DW_RST = PIN_DW_RST; | 
|  | 120 | +static const uint8_t DW_IRQ = PIN_DW_IRQ; | 
|  | 121 | + | 
|  | 122 | +#define PIN_ACC_IRQ          (23) | 
|  | 123 | + | 
|  | 124 | +static const uint8_t ACC_IRQ = PIN_ACC_IRQ; | 
|  | 125 | + | 
|  | 126 | +#ifdef __cplusplus | 
|  | 127 | +} | 
|  | 128 | +#endif | 
|  | 129 | + | 
|  | 130 | +/*---------------------------------------------------------------------------- | 
|  | 131 | + *        Arduino objects - C++ only | 
|  | 132 | + *----------------------------------------------------------------------------*/ | 
|  | 133 | + | 
|  | 134 | +#endif | 
0 commit comments