-
-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Electronut labs bluey board (#175)
- Loading branch information
1 parent
6091ba3
commit 1ec43d4
Showing
6 changed files
with
252 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
Copyright (c) 2014-2015 Arduino LLC. All right reserved. | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
// API compatibility | ||
#include "variant.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
Copyright (c) 2014-2015 Arduino LLC. All right reserved. | ||
Copyright (c) 2016 Sandeep Mistry All right reserved. | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#include "variant.h" | ||
|
||
/* | ||
A0 P0.02/AIN0 | 1 2 | P0.26 D0 | ||
A1 P0.03/AIN1 | 3 4 | P0.27 D1 | ||
A2 P0.04/AIN2 | 5 6 | P0.24/AIN4 A3 | ||
D2 P0.22 | 7 8 | P0.29/AIN5 A4 | ||
D3 P0.23 | 9 10 | P0.30/AIN6 A5 | ||
D4 P0.24 | 11 12 | P0.31/AIN7 A6 | ||
D5 P0.25 | 13 14 | Ex_vin | ||
GND | 15 16 | 3v3 | ||
GND | 17 18 | GND | ||
button D6 - P0.16 | ||
R D7 - P0.19 | ||
G D8 - P0.18 | ||
B D9 - P0.17 | ||
D10 SCL - P0.11 DRDYn - P0.12 D11 | ||
D12 SDA - P0.13 INT - P0.14 D13 | ||
D14 INT1 - P0.15 INT2 - P0.20 D15 | ||
RXD - P0.08 TXD - P0.06 | ||
RTS - P0.05 CTS - P0.07 | ||
SS - P0.22 SCK - P0.25 | ||
MISO - P0.24 MOSI - P0.23 | ||
*/ | ||
|
||
|
||
const uint32_t g_ADigitalPinMap[] = { | ||
// D0 - D15 | ||
26, | ||
27, | ||
22, // SS | ||
23, // MOSI | ||
24, // MISO | ||
25, // SCK | ||
16, // Button | ||
19, // R | ||
18, // G | ||
17, // B | ||
11, // SCL | ||
12, // DRDYn | ||
13, // SDA | ||
14, // INT | ||
15, // INT1 | ||
20, // INT2 | ||
|
||
// A0 - A6 | ||
2, | ||
3, | ||
4, | ||
24, | ||
29, | ||
30, | ||
31, | ||
|
||
// RX, TX, RTS, CTS | ||
8, | ||
6, | ||
5, | ||
7, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* | ||
Copyright (c) 2014-2015 Arduino LLC. All right reserved. | ||
Copyright (c) 2016 Sandeep Mistry All right reserved. | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#ifndef _VARIANT_ELECTRONUT_BLUEY_ | ||
#define _VARIANT_ELECTRONUT_BLUEY_ | ||
|
||
/** Master clock frequency */ | ||
#define VARIANT_MCK (64000000ul) | ||
|
||
/*---------------------------------------------------------------------------- | ||
* Headers | ||
*----------------------------------------------------------------------------*/ | ||
|
||
#include "WVariant.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif // __cplusplus | ||
|
||
// Number of pins defined in PinDescription array | ||
#define PINS_COUNT (27u) | ||
#define NUM_DIGITAL_PINS (27u) | ||
#define NUM_ANALOG_INPUTS (7u) | ||
#define NUM_ANALOG_OUTPUTS (0u) | ||
|
||
// LEDs | ||
#define PIN_LEDR (7) | ||
#define PIN_LEDG (8) | ||
#define PIN_LEDB (9) | ||
#define LED_BUILTIN PIN_LEDR | ||
|
||
// Buttons | ||
#define PIN_BUTTON (6) | ||
|
||
/* | ||
* Analog pins | ||
*/ | ||
#define PIN_A0 (16) | ||
#define PIN_A1 (17) | ||
#define PIN_A2 (18) | ||
#define PIN_A3 (19) | ||
#define PIN_A4 (20) | ||
#define PIN_A5 (21) | ||
#define PIN_A6 (22) | ||
|
||
static const uint8_t A0 = PIN_A0 ; // AIN0 / AREF / P0.02 | ||
static const uint8_t A1 = PIN_A1 ; // AIN1 | ||
static const uint8_t A2 = PIN_A2 ; // AIN2 | ||
static const uint8_t A3 = PIN_A3 ; // AIN4 | ||
static const uint8_t A4 = PIN_A4 ; // AIN5 | ||
static const uint8_t A5 = PIN_A5 ; // AIN6 | ||
static const uint8_t A6 = PIN_A6 ; // AIN7 | ||
#define ADC_RESOLUTION 10 | ||
|
||
// Other pins | ||
#define PIN_AREF (16) | ||
static const uint8_t AREF = PIN_AREF; | ||
|
||
/* | ||
* Serial interfaces | ||
*/ | ||
// Serial | ||
#define PIN_SERIAL_RX (23) | ||
#define PIN_SERIAL_TX (24) | ||
|
||
/* | ||
* SPI Interfaces | ||
*/ | ||
#define SPI_INTERFACES_COUNT 1 | ||
|
||
#define PIN_SPI_MISO (4) | ||
#define PIN_SPI_MOSI (3) | ||
#define PIN_SPI_SCK (5) | ||
|
||
static const uint8_t SS = 2 ; | ||
static const uint8_t MOSI = PIN_SPI_MOSI ; | ||
static const uint8_t MISO = PIN_SPI_MISO ; | ||
static const uint8_t SCK = PIN_SPI_SCK ; | ||
|
||
/* | ||
* Wire Interfaces | ||
*/ | ||
#define WIRE_INTERFACES_COUNT 1 | ||
|
||
#define PIN_WIRE_SDA (12u) | ||
#define PIN_WIRE_SCL (10u) | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
/*---------------------------------------------------------------------------- | ||
* Arduino objects - C++ only | ||
*----------------------------------------------------------------------------*/ | ||
|
||
#endif |