Skip to content

Commit 2e09f1b

Browse files
jhmaloneysandeepmistry
authored andcommitted
Calliope mini (#259)
1 parent e67e4fc commit 2e09f1b

File tree

6 files changed

+230
-2
lines changed

6 files changed

+230
-2
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ script:
2323
- buildExampleSketch sandeepmistry:nRF5:BLENano:version=1_0 01.Basics Blink
2424
- buildExampleSketch sandeepmistry:nRF5:RedBearLab_nRF51822:version=1_0 01.Basics Blink
2525
- buildExampleSketch sandeepmistry:nRF5:BBCmicrobit 01.Basics Blink
26+
- buildExampleSketch sandeepmistry:nRF5:CalliopeMini 01.Basics Blink
2627
- buildExampleSketch sandeepmistry:nRF5:Generic_nRF51822:chip=xxac 01.Basics Blink
2728
- buildExampleSketch sandeepmistry:nRF5:Generic_nRF52832 01.Basics Blink
2829
- buildExampleSketch sandeepmistry:nRF5:OSHChip 01.Basics Blink

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Become a sponsor and get your logo on our README on Github with a link to your s
9393
### nRF51
9494
* [Plain nRF51 MCU](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822)
9595
* [BBC micro:bit](https://microbit.org)
96+
* [Calliope mini](https://calliope.cc/en)
9697
* [Bluz DK](http://bluz.io)
9798
* Nordic Semiconductor [nRF51822 Development Kit](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822-Development-Kit) + [nRF51422 Development Kit](https://www.nordicsemi.com/eng/Products/ANT/nRF51422-Development-Kit)
9899
* Nordic SemiconductornRF51x22 Development Kits (PCA1000x)

boards.txt

+47-2
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,51 @@ BBCmicrobit.menu.softdevice.s130.upload.maximum_size=151552
386386
BBCmicrobit.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
387387
BBCmicrobit.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxaa.ld
388388

389+
CalliopeMini.name=Calliope mini
390+
391+
CalliopeMini.vid.0=0x0d28
392+
CalliopeMini.pid.0=0x0204
393+
394+
CalliopeMini.upload.tool=sandeepmistry:openocd
395+
CalliopeMini.upload.protocol=cmsis-dap
396+
CalliopeMini.upload.target=nrf51
397+
CalliopeMini.upload.maximum_size=262144
398+
CalliopeMini.upload.setup_command=transport select swd;
399+
CalliopeMini.upload.use_1200bps_touch=false
400+
CalliopeMini.upload.wait_for_upload_port=false
401+
CalliopeMini.upload.native_usb=false
402+
403+
CalliopeMini.bootloader.tool=sandeepmistry:openocd
404+
405+
CalliopeMini.build.mcu=cortex-m0
406+
CalliopeMini.build.f_cpu=16000000
407+
CalliopeMini.build.board=CALLIOPE_MINI
408+
CalliopeMini.build.core=nRF5
409+
CalliopeMini.build.variant=CalliopeMini
410+
CalliopeMini.build.variant_system_lib=
411+
CalliopeMini.build.extra_flags=-DNRF51
412+
CalliopeMini.build.float_flags=
413+
CalliopeMini.build.ldscript=nrf51_xxaa.ld
414+
415+
CalliopeMini.build.lfclk_flags=-DUSE_LFRC
416+
417+
CalliopeMini.menu.softdevice.none=None
418+
CalliopeMini.menu.softdevice.none.softdevice=none
419+
CalliopeMini.menu.softdevice.none.softdeviceversion=
420+
421+
CalliopeMini.menu.softdevice.s110=S110
422+
CalliopeMini.menu.softdevice.s110.softdevice=s110
423+
CalliopeMini.menu.softdevice.s110.softdeviceversion=8.0.0
424+
CalliopeMini.menu.softdevice.s110.upload.maximum_size=151552
425+
CalliopeMini.menu.softdevice.s110.build.extra_flags=-DNRF51 -DS110 -DNRF51_S110
426+
CalliopeMini.menu.softdevice.s110.build.ldscript=armgcc_s110_nrf51822_xxaa.ld
427+
428+
CalliopeMini.menu.softdevice.s130=S130
429+
CalliopeMini.menu.softdevice.s130.softdevice=s130
430+
CalliopeMini.menu.softdevice.s130.softdeviceversion=2.0.1
431+
CalliopeMini.menu.softdevice.s130.upload.maximum_size=151552
432+
CalliopeMini.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
433+
CalliopeMini.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxaa.ld
389434

390435
BluzDK.name=Bluz DK
391436

@@ -556,14 +601,14 @@ Beacon_PCA20006.menu.softdevice.s110=S110
556601
Beacon_PCA20006.menu.softdevice.s110.softdevice=s110
557602
Beacon_PCA20006.menu.softdevice.s110.softdeviceversion=8.0.0
558603
Beacon_PCA20006.menu.softdevice.s110.upload.maximum_size=151552
559-
Beacon_PCA20006.menu.softdevice.s110.build.extra_flags=-DNRF51 -DS110 -DNRF51_S110
604+
Beacon_PCA20006.menu.softdevice.s110.build.extra_flags=-DNRF51 -DS110 -DNRF51_S110
560605
Beacon_PCA20006.menu.softdevice.s110.build.ldscript=armgcc_s110_nrf51822_xxaa.ld
561606

562607
Beacon_PCA20006.menu.softdevice.s130=S130
563608
Beacon_PCA20006.menu.softdevice.s130.softdevice=s130
564609
Beacon_PCA20006.menu.softdevice.s130.softdeviceversion=2.0.1
565610
Beacon_PCA20006.menu.softdevice.s130.upload.maximum_size=151552
566-
Beacon_PCA20006.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
611+
Beacon_PCA20006.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
567612
Beacon_PCA20006.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxaa.ld
568613

569614
TinyBLE.name= TinyBLE

variants/CalliopeMini/pins_arduino.h

+17
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/CalliopeMini/variant.cpp

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2016 Sandeep Mistry All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
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+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
#include "variant.h"
21+
22+
const uint32_t g_ADigitalPinMap[] = {
23+
// 0 - 19 (available on expension connector)
24+
0, // A0 - left pad
25+
1, // A1 - bottom left pad; analog input
26+
2, // A2 - bottom right pad; analog input
27+
22, // A3 - right pad; SPI SCLK
28+
4, // LED row 1; analog input
29+
5, // LED row 2; analog input
30+
6, // LED row 3; analog input
31+
7, // LED row 4
32+
8, // LED row 5
33+
9, // LED row 6
34+
10, // LED row 7
35+
11, // LED row 8
36+
12, // LED row 9
37+
13, // LED column 1
38+
14, // LED column 2
39+
15, // LED column 3
40+
26, // serial RX; SPI MISO
41+
27, // serial TX; SPI MOSI
42+
20, // SDA
43+
19, // SCL
44+
45+
// 20-25 (internal; not available on external connector)
46+
17, // button A
47+
3, // microphone (shown as c21 on Calliope pinout)
48+
16, // button B
49+
28, // motor driver enable
50+
29, // motor driver in1
51+
30, // motor driver in2
52+
53+
// 26-30
54+
18, // neopixel
55+
21, // accelerometer chip interrupt
56+
23, // unassigned
57+
24, // usb serial TX
58+
25, // usb serial RX
59+
};

variants/CalliopeMini/variant.h

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2016 Sandeep Mistry All right reserved.
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
This library is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
See the GNU Lesser General Public License for more details.
12+
You should have received a copy of the GNU Lesser General Public
13+
License along with this library; if not, write to the Free Software
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
*/
16+
17+
#ifndef _VARIANT_CALLIOPE_MINI_
18+
#define _VARIANT_CALLIOPE_MINI_
19+
20+
/** Master clock frequency */
21+
#define VARIANT_MCK (16000000ul)
22+
23+
/*----------------------------------------------------------------------------
24+
* Headers
25+
*----------------------------------------------------------------------------*/
26+
27+
#include "WVariant.h"
28+
29+
#ifdef __cplusplus
30+
extern "C"
31+
{
32+
#endif // __cplusplus
33+
34+
// Number of pins defined in PinDescription array
35+
36+
#define PINS_COUNT (31)
37+
#define NUM_DIGITAL_PINS (26)
38+
#define NUM_ANALOG_INPUTS (6)
39+
#define NUM_ANALOG_OUTPUTS (0)
40+
41+
// LEDs
42+
43+
#define PIN_LED (0) // no user LED; use pad 0
44+
#define LED_BUILTIN PIN_LED
45+
46+
// Buttons
47+
48+
#define PIN_BUTTON_A (20)
49+
#define PIN_BUTTON_B (22)
50+
51+
// Analog pins
52+
53+
#define PIN_A0 (21) // microphone (note: pad 0 is not an analog input!)
54+
#define PIN_A1 (1) // pad 1
55+
#define PIN_A2 (2) // pad 2
56+
#define PIN_A3 (4) // connector pin 4
57+
#define PIN_A4 (5) // connector pin 5
58+
#define PIN_A5 (6) // connector pin 6
59+
60+
static const uint8_t A0 = PIN_A0;
61+
static const uint8_t A1 = PIN_A1;
62+
static const uint8_t A2 = PIN_A2;
63+
static const uint8_t A3 = PIN_A3;
64+
static const uint8_t A4 = PIN_A4;
65+
static const uint8_t A5 = PIN_A5;
66+
#define ADC_RESOLUTION 10
67+
68+
// Serial interface
69+
70+
#define PIN_SERIAL_TX (29)
71+
#define PIN_SERIAL_RX (30)
72+
73+
// SPI Interfaces
74+
75+
#define SPI_INTERFACES_COUNT 1
76+
77+
#define PIN_SPI_MISO (16)
78+
#define PIN_SPI_MOSI (17)
79+
#define PIN_SPI_SCK (22)
80+
81+
static const uint8_t MOSI = PIN_SPI_MOSI;
82+
static const uint8_t MISO = PIN_SPI_MISO;
83+
static const uint8_t SCK = PIN_SPI_SCK;
84+
85+
// Wire Interfaces
86+
87+
#define WIRE_INTERFACES_COUNT 1
88+
89+
#define PIN_WIRE_SDA (18)
90+
#define PIN_WIRE_SCL (19)
91+
92+
static const uint8_t SDA = PIN_WIRE_SDA;
93+
static const uint8_t SCL = PIN_WIRE_SCL;
94+
95+
// I2C device IDs
96+
97+
#define ACCEL_ID 24
98+
#define GYRO_ID 104
99+
#define MAG_ID 24
100+
101+
#ifdef __cplusplus
102+
}
103+
#endif
104+
105+
#endif

0 commit comments

Comments
 (0)