Skip to content

Commit dda829c

Browse files
committed
draft 1
1 parent e690442 commit dda829c

File tree

2 files changed

+217
-0
lines changed

2 files changed

+217
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2016 Sandeep Mistry All right reserved.
4+
Copyright (c) 2018, Adafruit Industries (adafruit.com)
5+
6+
This library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
This library is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
See the GNU Lesser General Public License for more details.
15+
16+
You should have received a copy of the GNU Lesser General Public
17+
License along with this library; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
*/
20+
21+
#include "variant.h"
22+
#include "wiring_constants.h"
23+
#include "wiring_digital.h"
24+
#include "nrf.h"
25+
26+
const uint32_t g_ADigitalPinMap[] =
27+
{
28+
// D0 .. D13
29+
29, // D0 is P0.29 (GPIO D0 / A6 / UART RX)
30+
14, // D1 is P0.14 (GPIO D1 / UART TX)
31+
4, // D2 is P0.04 (GPIO D2 / A5 / SDA)
32+
5, // D3 is P0.05 (GPIO D3 / A4 / SCL)
33+
33, // D4 is P1.01 (GPIO D4 / Left Button)
34+
47, // D5 is P1.15 (GPIO D5 / Right button)
35+
3, // D6 is P0.03 (GPIO D6 / A1)
36+
34, // D7 is P1.02 (GPIO D7 / Slide Switch)
37+
13, // D8 is P0.13 (GPIO D8 / NeoPixels)
38+
2, // D9 is P0.02 (GPIO D9 / A2)
39+
28, // D10 is P0.28 (GPIO D10 / A3)
40+
35, // D11 is P1.03 (GPIO D11 / Speaker Shutdown)
41+
26, // D12 is P0.26 (GPIO D12 / Audio Out)
42+
46, // D13 is P1.14 (GPIO D13 / Red LED)
43+
44+
// D14 .. D23
45+
26, // NOT REALLY ANALOG, A PLACEHODER SINCE D12 is not analog
46+
3, // D6 is P0.03 (GPIO D6 / A1)
47+
2, // D9 is P0.02 (GPIO D9 / A2)
48+
28, // D10 is P0.28 (GPIO D10 / A3)
49+
5, // D3 is P0.05 (GPIO D3 / A4 / SCL)
50+
4, // D2 is P0.04 (GPIO D2 / A5 / SDA)
51+
29, // D0 is P0.29 (GPIO D0 / A6 / UART RX)
52+
14, // NOT REALLY ANALOG, A PLACEHODER SINCE D1 is not analog
53+
31, // A8 - Light sensor
54+
30, // A9 - Thermistor sensor
55+
56+
45, // D24 is P1.13 (LIS IRQ)
57+
44, // D25 is P1.12 (LIS SCL)
58+
43, // D26 is P1.11 (LIS SDA)
59+
60+
// QSPI pins (not exposed via any header / test point)
61+
19, // D27 is P0.19 (QSPI CLK)
62+
15, // D28 is P0.15 (QSPI CS)
63+
21, // D29 is P0.21 (QSPI Data 0)
64+
23, // D30 is P0.23 (QSPI Data 1)
65+
32, // D31 is P1.00 (QSPI Data 2)
66+
22, // D32 is P0.22 (QSPI Data 3)
67+
68+
// D33 & D34 PDM pins
69+
24, // D33 is P0.24 (PDM CLK)
70+
25, // D34 is P0.25 (PDM DAT)
71+
72+
};
73+
74+
void initVariant()
75+
{
76+
// LED1
77+
pinMode(PIN_LED1, OUTPUT);
78+
ledOff(PIN_LED1);
79+
}
80+
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2016 Sandeep Mistry All right reserved.
4+
Copyright (c) 2018, Adafruit Industries (adafruit.com)
5+
6+
This library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13+
See the GNU Lesser General Public License for more details.
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef _VARIANT_CIRCUITPLAY52840_
20+
#define _VARIANT_CIRCUITPLAY52840_
21+
22+
/** Master clock frequency */
23+
#define VARIANT_MCK (64000000ul)
24+
25+
//#define USE_LFXO // Board uses 32khz crystal for LF
26+
#define USE_LFRC // Board uses RC for LF
27+
28+
/*----------------------------------------------------------------------------
29+
* Headers
30+
*----------------------------------------------------------------------------*/
31+
32+
#include "WVariant.h"
33+
34+
#ifdef __cplusplus
35+
extern "C"
36+
{
37+
#endif // __cplusplus
38+
39+
// Number of pins defined in PinDescription array
40+
#define PINS_COUNT (35)
41+
#define NUM_DIGITAL_PINS (35)
42+
#define NUM_ANALOG_INPUTS (8)
43+
#define NUM_ANALOG_OUTPUTS (0)
44+
45+
// LEDs
46+
#define PIN_LED1 (13)
47+
#define PIN_NEOPIXEL (8)
48+
49+
#define LED_BUILTIN PIN_LED1
50+
51+
#define LED_RED PIN_LED1
52+
53+
#define LED_STATE_ON 1 // State when LED is litted
54+
55+
// Buttons
56+
57+
#define PIN_BUTTON1 (4)
58+
#define PIN_BUTTON2 (5)
59+
60+
/*
61+
* Analog pins
62+
*/
63+
#define PIN_A0 (14) // not really analog!
64+
#define PIN_A1 (15)
65+
#define PIN_A2 (16)
66+
#define PIN_A3 (17)
67+
#define PIN_A4 (18)
68+
#define PIN_A5 (19)
69+
#define PIN_A6 (20)
70+
#define PIN_A7 (21) // not really analog!
71+
#define PIN_A8 (22)
72+
#define PIN_A9 (23)
73+
74+
static const uint8_t A0 = PIN_A0 ;
75+
static const uint8_t A1 = PIN_A1 ;
76+
static const uint8_t A2 = PIN_A2 ;
77+
static const uint8_t A3 = PIN_A3 ;
78+
static const uint8_t A4 = PIN_A4 ;
79+
static const uint8_t A5 = PIN_A5 ;
80+
static const uint8_t A6 = PIN_A6 ;
81+
static const uint8_t A7 = PIN_A7 ;
82+
static const uint8_t A8 = PIN_A8 ;
83+
static const uint8_t A9 = PIN_A9 ;
84+
#define ADC_RESOLUTION 14
85+
86+
/*
87+
* Serial interfaces
88+
*/
89+
// Serial
90+
#define PIN_SERIAL_RX (1)
91+
#define PIN_SERIAL_TX (0)
92+
93+
/*
94+
* SPI Interfaces
95+
*/
96+
#define SPI_INTERFACES_COUNT 1
97+
98+
#define PIN_SPI_MISO (6)
99+
#define PIN_SPI_MOSI (9)
100+
#define PIN_SPI_SCK (10)
101+
102+
static const uint8_t SS = (5);
103+
static const uint8_t MOSI = PIN_SPI_MOSI ;
104+
static const uint8_t MISO = PIN_SPI_MISO ;
105+
static const uint8_t SCK = PIN_SPI_SCK ;
106+
107+
/*
108+
* Wire Interfaces
109+
*/
110+
#define WIRE_INTERFACES_COUNT 1
111+
112+
#define PIN_WIRE_SDA (2)
113+
#define PIN_WIRE_SCL (3)
114+
115+
// QSPI Pins
116+
#define PIN_QSPI_SCK 27
117+
#define PIN_QSPI_CS 28
118+
#define PIN_QSPI_IO0 29
119+
#define PIN_QSPI_IO1 30
120+
#define PIN_QSPI_IO2 31
121+
#define PIN_QSPI_IO3 32
122+
123+
// On-board QSPI Flash
124+
#define EXTERNAL_FLASH_DEVICES GD25Q16C
125+
126+
#define USB_MSC_BLOCK_SIZE 512
127+
#define USB_MSC_BLOCK_COUNT ((2*1024*1024) / USB_MSC_BLOCK_SIZE)
128+
129+
#ifdef __cplusplus
130+
}
131+
#endif
132+
133+
/*----------------------------------------------------------------------------
134+
* Arduino objects - C++ only
135+
*----------------------------------------------------------------------------*/
136+
137+
#endif

0 commit comments

Comments
 (0)