Skip to content

Commit 6ba2cad

Browse files
committed
add led glasses driver variant
1 parent 5e72fd0 commit 6ba2cad

File tree

3 files changed

+216
-1
lines changed

3 files changed

+216
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ This repository contains the Arduino BSP for Adafruit Bluefruit nRF52 series:
1111
- [Adafruit Feather nRF52840 Sense](https://www.adafruit.com/product/4516)
1212
- [Adafruit ItsyBitsy nRF52840 Express](https://www.adafruit.com/product/4481)
1313
- Adafruit Metro nRF52840 Express
14+
- [Raytac MDBT50Q-RX](https://www.adafruit.com/product/5199)
1415

1516
Following boards are also included but are not officially supported:
1617

1718
- [Nordic nRF52840DK PCA10056](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK)
1819
- [Particle Xenon](https://store.particle.io/products/xenon)
19-
- Raytac MDBT50Q-RX
2020

2121
## BSP Installation
2222

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
// UART: place holder only
29+
25 , // D0 is UART TX (not connected)
30+
24 , // D1 is UART RX (not connected)
31+
32+
31 , // D2 is LED1
33+
32+15, // D3 is NeoPixel
34+
30 , // D4 is Button
35+
27 , // D5 is MIC Data
36+
0 , // D6 is MIC Clk
37+
1 , // D7 is LIS3DH IRQ
38+
39+
// I2C: connected to on-board LIS3DH and SteammaQT
40+
8 , // D8 is SCL
41+
6 , // D9 is SDA
42+
43+
// SPI: place holder only
44+
13 , // D10 is MISO (not connected)
45+
14 , // D11 is MOSI (not connected)
46+
15 , // D12 is SCK (not connected)
47+
16 , // D13 is SS (not connected)
48+
49+
// A0 .. A7: only A6 is connected to Battery
50+
32+3 , // D14 is A0 (not connected)
51+
32+4 , // D15 is A1 (not connected)
52+
32+5 , // D16 is A2 (not connected)
53+
32+6 , // D17 is A3 (not connected)
54+
32+7 , // D18 is A4 (not connected)
55+
32+1 , // D19 is A5 (not connected)
56+
4 , // D20 is A6 Battery
57+
5 , // D21 is A7 (not connected)
58+
59+
// QSPI pins (not exposed via any header / test point)
60+
19 , // D22 is QSPI CLK
61+
20 , // D23 is QSPI CS
62+
32+0 , // D24 is QSPI Data 0
63+
21 , // D25 is QSPI Data 1
64+
22 , // D26 is QSPI Data 2
65+
23 , // D27 is QSPI Data 3
66+
67+
// Thus, there are 28 defined pins
68+
};
69+
70+
void initVariant()
71+
{
72+
pinMode(PIN_LED1, OUTPUT);
73+
ledOff(PIN_LED1);
74+
}
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
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_FEATHER52840_
20+
#define _VARIANT_FEATHER52840_
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 (28)
41+
#define NUM_DIGITAL_PINS (28)
42+
#define NUM_ANALOG_INPUTS (6) // only A6 is routed and used for battery
43+
#define NUM_ANALOG_OUTPUTS (0)
44+
45+
// LEDs
46+
#define PIN_LED1 (2)
47+
#define PIN_NEOPIXEL (3)
48+
#define NEOPIXEL_NUM 1
49+
50+
#define LED_BUILTIN PIN_LED1
51+
#define LED_CONN PIN_LED1
52+
53+
#define LED_RED PIN_LED1
54+
#define LED_BLUE PIN_LED1
55+
56+
#define LED_STATE_ON 1 // State when LED is litted
57+
58+
/*
59+
* Buttons
60+
*/
61+
#define PIN_BUTTON1 (4)
62+
63+
// Microphone
64+
#define PIN_PDM_DIN 5
65+
#define PIN_PDM_CLK 6
66+
#define PIN_PDM_PWR -1 // not used
67+
68+
/*
69+
* Analog pins
70+
*/
71+
#define PIN_A0 (14) // not connected
72+
#define PIN_A1 (15) // not connected
73+
#define PIN_A2 (16) // not connected
74+
#define PIN_A3 (17) // not connected
75+
#define PIN_A4 (18) // not connected
76+
#define PIN_A5 (19) // not connected
77+
#define PIN_A6 (20) // VBAT
78+
#define PIN_A7 (21) // not connected
79+
80+
static const uint8_t A0 = PIN_A0 ;
81+
static const uint8_t A1 = PIN_A1 ;
82+
static const uint8_t A2 = PIN_A2 ;
83+
static const uint8_t A3 = PIN_A3 ;
84+
static const uint8_t A4 = PIN_A4 ;
85+
static const uint8_t A5 = PIN_A5 ;
86+
static const uint8_t A6 = PIN_A6 ;
87+
static const uint8_t A7 = PIN_A7 ;
88+
#define ADC_RESOLUTION 14
89+
90+
// Other pins
91+
#define PIN_VBAT PIN_A6
92+
93+
/*
94+
* Serial interfaces
95+
*/
96+
#define PIN_SERIAL1_RX (1) // not connected
97+
#define PIN_SERIAL1_TX (0) // not connected
98+
99+
/*
100+
* SPI Interfaces
101+
*/
102+
#define SPI_INTERFACES_COUNT 1
103+
104+
#define PIN_SPI_MISO (10) // not connected
105+
#define PIN_SPI_MOSI (11) // not connected
106+
#define PIN_SPI_SCK (12) // not connected
107+
108+
static const uint8_t SS = (13); // not connected
109+
static const uint8_t MOSI = PIN_SPI_MOSI ;
110+
static const uint8_t MISO = PIN_SPI_MISO ;
111+
static const uint8_t SCK = PIN_SPI_SCK ;
112+
113+
/*
114+
* Wire Interfaces
115+
*/
116+
#define WIRE_INTERFACES_COUNT 1
117+
118+
#define PIN_WIRE_SCL (8)
119+
#define PIN_WIRE_SDA (9)
120+
121+
// QSPI Pins
122+
#define PIN_QSPI_SCK 22
123+
#define PIN_QSPI_CS 23
124+
#define PIN_QSPI_IO0 24
125+
#define PIN_QSPI_IO1 25
126+
#define PIN_QSPI_IO2 26
127+
#define PIN_QSPI_IO3 27
128+
129+
// On-board QSPI Flash
130+
#define EXTERNAL_FLASH_DEVICES GD25Q16C
131+
#define EXTERNAL_FLASH_USE_QSPI
132+
133+
#ifdef __cplusplus
134+
}
135+
#endif
136+
137+
/*----------------------------------------------------------------------------
138+
* Arduino objects - C++ only
139+
*----------------------------------------------------------------------------*/
140+
141+
#endif

0 commit comments

Comments
 (0)