-
-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds Calliope mini V3 to the library (#518)
* added mini3 * adds calliope pins, working * update readme * adds mini V3 to workflow
- Loading branch information
1 parent
5c22636
commit fbbcccb
Showing
6 changed files
with
206 additions
and
1 deletion.
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,69 @@ | ||
/* Pins for Calliope mini V3 | ||
This file connects the hardware pin numbers on the left to the array position. | ||
In Arduino IDE this array position is usually used when calling a pin by number, | ||
e.g. pinMode(5, INPUT) sets BTN A to input mode */ | ||
|
||
#include "variant.h" | ||
|
||
const uint32_t g_ADigitalPinMap[] = { | ||
// 0 - 4 | ||
2, // A0, PAD 0 | ||
3, // A1, PAD 1 | ||
4, // A2, PAD 2 | ||
35, // Pad 3, not analog (Calliope exclusive pin) | ||
28, // A4, COL1 | ||
|
||
// 5 - 9 | ||
14, // BTN A | ||
37, // COL4, P1.05 | ||
11, // COL2 | ||
10, // NFC2 | ||
9, // NFC1 | ||
|
||
// 10-16 | ||
30, // A5, COL5 | ||
23, // BTN B | ||
12, | ||
17, // SCK | ||
1, // MISO | ||
13, // MOSI | ||
29, // A5, C16_A1RX (Calliope change) | ||
|
||
// 17 + 18 | ||
34, // P1.02 C17 (Calliope exclusive pin) | ||
31, // A3, COL3 (Calliope changed pin number) | ||
|
||
// 19 + 20 | ||
26, // SCL | ||
32, // SDA, P1.00 | ||
|
||
// 21 - 25 | ||
21, // ROW1 | ||
22, // ROW2 | ||
15, // ROW3 | ||
24, // ROW4 | ||
19, // ROW5 | ||
|
||
// 26 - 29 | ||
36, // LOGO (touch sensor) | ||
0, // SPEAKER (Note: Must use synthesized LF clock to make this pin available) | ||
20, // RUN_MIC | ||
5, // A6, MIC_IN | ||
|
||
// 30 - 31 | ||
16, // I2C_INT_SDA | ||
8, // I2C_INT_SCL | ||
|
||
// 32 - 34 | ||
25, // COMBINED_SENSOR_INT | ||
40, // RX, P1.08 | ||
6, // TX | ||
|
||
// 35 - 40 internal Calliope mini pins | ||
7, // RGB | ||
38, // MOTOR_MODE | ||
33, // M0_DIR | ||
27, // M0_SPEED | ||
39, // M1_DIR | ||
41, // M1_SPEED | ||
}; |
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,86 @@ | ||
#ifndef _CALLIOPE_MINI_V3_ | ||
#define _CALLIOPE_MINI_V3_ | ||
|
||
// Master clock frequency | ||
|
||
#define VARIANT_MCK (64000000ul) | ||
|
||
#include "WVariant.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif // __cplusplus | ||
|
||
// Number of pins defined in PinDescription array | ||
|
||
#define PINS_COUNT (41) | ||
#define NUM_DIGITAL_PINS (41) | ||
#define NUM_ANALOG_INPUTS (7) | ||
#define NUM_ANALOG_OUTPUTS (0) | ||
|
||
// LEDs | ||
|
||
#define PIN_LED (13) // This goes to Calliope mini header C12 (not a built in LED) | ||
#define LED_BUILTIN PIN_LED | ||
|
||
// Buttons | ||
|
||
#define PIN_BUTTON_A (5) | ||
#define PIN_BUTTON_B (11) | ||
|
||
// Analog pins | ||
|
||
#define PIN_A0 (0) | ||
#define PIN_A1 (1) | ||
#define PIN_A2 (2) | ||
#define PIN_A3 (3) | ||
#define PIN_A4 (4) | ||
#define PIN_A5 (10) | ||
#define PIN_A6 (29) | ||
|
||
#define ADC_RESOLUTION 10 | ||
static const uint8_t A0 = PIN_A0; | ||
static const uint8_t A1 = PIN_A1; | ||
static const uint8_t A2 = PIN_A2; | ||
static const uint8_t A3 = PIN_A3; | ||
static const uint8_t A4 = PIN_A4; | ||
static const uint8_t A5 = PIN_A5; | ||
static const uint8_t A6 = PIN_A6; | ||
|
||
// Serial | ||
|
||
#define PIN_SERIAL_RX (33) | ||
#define PIN_SERIAL_TX (34) | ||
|
||
// SPI | ||
|
||
#define SPI_INTERFACES_COUNT 1 | ||
|
||
#define PIN_SPI_MISO (14) | ||
#define PIN_SPI_MOSI (15) | ||
#define PIN_SPI_SCK (13) | ||
|
||
// Wire Interfaces (external and internal) | ||
|
||
#define WIRE_INTERFACES_COUNT 2 | ||
|
||
#define PIN_WIRE_SDA (20) | ||
#define PIN_WIRE_SCL (19) | ||
|
||
#define PIN_WIRE1_SDA (30) | ||
#define PIN_WIRE1_SCL (31) | ||
|
||
#ifdef __cplusplus | ||
|
||
// Calliope internal pins | ||
#define PIN_RGB (35) | ||
#define PIN_M_MODE (36) | ||
#define PIN_M0_DIR (37) | ||
#define PIN_M0_SPEED (38) | ||
#define PIN_M1_DIR (39) | ||
#define PIN_M1_SPEED (40) | ||
} | ||
#endif // __cplusplus | ||
|
||
#endif |