Skip to content

Commit fbbcccb

Browse files
authored
adds Calliope mini V3 to the library (#518)
* added mini3 * adds calliope pins, working * update readme * adds mini V3 to workflow
1 parent 5c22636 commit fbbcccb

File tree

6 files changed

+206
-1
lines changed

6 files changed

+206
-1
lines changed

.github/workflows/compile.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
- BBCmicrobit
1919
- BBCmicrobitV2
2020
- CalliopeMini
21+
- CalliopeminiV3
2122
- Generic_nRF51822:chip=xxac
2223
- Generic_nRF52832
2324
- Generic_nRF52833

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Become a sponsor and get your logo on our README on Github with a link to your s
8282

8383
### nRF52833
8484
* [BBC micro:bit v2](https://microbit.org/new-microbit/)
85-
85+
* [Calliope mini V3](https://calliope.cc/calliope-mini-3)
8686
### nRF52
8787
* [Plain nRF52 MCU](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF52832)
8888
* [Nordic Semiconductor nRF52 DK](https://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF52-DK)

boards.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,38 @@ CalliopeMini.menu.softdevice.s130.upload.maximum_size=151552
534534
CalliopeMini.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
535535
CalliopeMini.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxaa.ld
536536

537+
CalliopeminiV3.name=Calliope mini V3
538+
539+
CalliopeminiV3.vid.0=0x0d28
540+
CalliopeminiV3.pid.0=0x0204
541+
542+
CalliopeminiV3.upload.tool=sandeepmistry:openocd
543+
CalliopeminiV3.upload.protocol=cmsis-dap
544+
CalliopeminiV3.upload.target=nrf52
545+
CalliopeminiV3.upload.maximum_size=524288
546+
CalliopeminiV3.upload.setup_command=transport select swd;
547+
CalliopeminiV3.upload.use_1200bps_touch=false
548+
CalliopeminiV3.upload.wait_for_upload_port=false
549+
CalliopeminiV3.upload.native_usb=false
550+
551+
CalliopeminiV3.bootloader.tool=sandeepmistry:openocd
552+
553+
CalliopeminiV3.build.mcu=cortex-m4
554+
CalliopeminiV3.build.f_cpu=64000000
555+
CalliopeminiV3.build.board=CALLIOPE_MINI_V3
556+
CalliopeminiV3.build.core=nRF5
557+
CalliopeminiV3.build.variant=CalliopeminiV3
558+
CalliopeminiV3.build.variant_system_lib=
559+
CalliopeminiV3.build.extra_flags=-DNRF52833_XXAA
560+
CalliopeminiV3.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
561+
CalliopeminiV3.build.ldscript=nrf52833_xxaa.ld
562+
563+
CalliopeminiV3.build.lfclk_flags=-DUSE_LFSYNT
564+
565+
CalliopeminiV3.menu.softdevice.none=None
566+
CalliopeminiV3.menu.softdevice.none.softdevice=none
567+
CalliopeminiV3.menu.softdevice.none.softdeviceversion=
568+
537569
BluzDK.name=Bluz DK
538570

539571
BluzDK.upload.tool=sandeepmistry:openocd
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
This library is free software; you can redistribute it and/or
4+
modify it under the terms of the GNU Lesser General Public
5+
License as published by the Free Software Foundation; either
6+
version 2.1 of the License, or (at your option) any later version.
7+
This library is distributed in the hope that it will be useful,
8+
but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10+
See the GNU Lesser General Public License for more details.
11+
You should have received a copy of the GNU Lesser General Public
12+
License along with this library; if not, write to the Free Software
13+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
14+
*/
15+
16+
// API compatibility
17+
#include "variant.h"

variants/CalliopeminiV3/variant.cpp

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/* Pins for Calliope mini V3
2+
This file connects the hardware pin numbers on the left to the array position.
3+
In Arduino IDE this array position is usually used when calling a pin by number,
4+
e.g. pinMode(5, INPUT) sets BTN A to input mode */
5+
6+
#include "variant.h"
7+
8+
const uint32_t g_ADigitalPinMap[] = {
9+
// 0 - 4
10+
2, // A0, PAD 0
11+
3, // A1, PAD 1
12+
4, // A2, PAD 2
13+
35, // Pad 3, not analog (Calliope exclusive pin)
14+
28, // A4, COL1
15+
16+
// 5 - 9
17+
14, // BTN A
18+
37, // COL4, P1.05
19+
11, // COL2
20+
10, // NFC2
21+
9, // NFC1
22+
23+
// 10-16
24+
30, // A5, COL5
25+
23, // BTN B
26+
12,
27+
17, // SCK
28+
1, // MISO
29+
13, // MOSI
30+
29, // A5, C16_A1RX (Calliope change)
31+
32+
// 17 + 18
33+
34, // P1.02 C17 (Calliope exclusive pin)
34+
31, // A3, COL3 (Calliope changed pin number)
35+
36+
// 19 + 20
37+
26, // SCL
38+
32, // SDA, P1.00
39+
40+
// 21 - 25
41+
21, // ROW1
42+
22, // ROW2
43+
15, // ROW3
44+
24, // ROW4
45+
19, // ROW5
46+
47+
// 26 - 29
48+
36, // LOGO (touch sensor)
49+
0, // SPEAKER (Note: Must use synthesized LF clock to make this pin available)
50+
20, // RUN_MIC
51+
5, // A6, MIC_IN
52+
53+
// 30 - 31
54+
16, // I2C_INT_SDA
55+
8, // I2C_INT_SCL
56+
57+
// 32 - 34
58+
25, // COMBINED_SENSOR_INT
59+
40, // RX, P1.08
60+
6, // TX
61+
62+
// 35 - 40 internal Calliope mini pins
63+
7, // RGB
64+
38, // MOTOR_MODE
65+
33, // M0_DIR
66+
27, // M0_SPEED
67+
39, // M1_DIR
68+
41, // M1_SPEED
69+
};

variants/CalliopeminiV3/variant.h

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#ifndef _CALLIOPE_MINI_V3_
2+
#define _CALLIOPE_MINI_V3_
3+
4+
// Master clock frequency
5+
6+
#define VARIANT_MCK (64000000ul)
7+
8+
#include "WVariant.h"
9+
10+
#ifdef __cplusplus
11+
extern "C"
12+
{
13+
#endif // __cplusplus
14+
15+
// Number of pins defined in PinDescription array
16+
17+
#define PINS_COUNT (41)
18+
#define NUM_DIGITAL_PINS (41)
19+
#define NUM_ANALOG_INPUTS (7)
20+
#define NUM_ANALOG_OUTPUTS (0)
21+
22+
// LEDs
23+
24+
#define PIN_LED (13) // This goes to Calliope mini header C12 (not a built in LED)
25+
#define LED_BUILTIN PIN_LED
26+
27+
// Buttons
28+
29+
#define PIN_BUTTON_A (5)
30+
#define PIN_BUTTON_B (11)
31+
32+
// Analog pins
33+
34+
#define PIN_A0 (0)
35+
#define PIN_A1 (1)
36+
#define PIN_A2 (2)
37+
#define PIN_A3 (3)
38+
#define PIN_A4 (4)
39+
#define PIN_A5 (10)
40+
#define PIN_A6 (29)
41+
42+
#define ADC_RESOLUTION 10
43+
static const uint8_t A0 = PIN_A0;
44+
static const uint8_t A1 = PIN_A1;
45+
static const uint8_t A2 = PIN_A2;
46+
static const uint8_t A3 = PIN_A3;
47+
static const uint8_t A4 = PIN_A4;
48+
static const uint8_t A5 = PIN_A5;
49+
static const uint8_t A6 = PIN_A6;
50+
51+
// Serial
52+
53+
#define PIN_SERIAL_RX (33)
54+
#define PIN_SERIAL_TX (34)
55+
56+
// SPI
57+
58+
#define SPI_INTERFACES_COUNT 1
59+
60+
#define PIN_SPI_MISO (14)
61+
#define PIN_SPI_MOSI (15)
62+
#define PIN_SPI_SCK (13)
63+
64+
// Wire Interfaces (external and internal)
65+
66+
#define WIRE_INTERFACES_COUNT 2
67+
68+
#define PIN_WIRE_SDA (20)
69+
#define PIN_WIRE_SCL (19)
70+
71+
#define PIN_WIRE1_SDA (30)
72+
#define PIN_WIRE1_SCL (31)
73+
74+
#ifdef __cplusplus
75+
76+
// Calliope internal pins
77+
#define PIN_RGB (35)
78+
#define PIN_M_MODE (36)
79+
#define PIN_M0_DIR (37)
80+
#define PIN_M0_SPEED (38)
81+
#define PIN_M1_DIR (39)
82+
#define PIN_M1_SPEED (40)
83+
}
84+
#endif // __cplusplus
85+
86+
#endif

0 commit comments

Comments
 (0)