Skip to content

Commit 7b8d3e1

Browse files
authored
Merge pull request #442 from adafruit/clue-play
enhance Clue support
2 parents 3d8c68a + a6a7bcd commit 7b8d3e1

32 files changed

+795
-129
lines changed

.github/workflows/githubci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
rm -r $HOME/$BSP_PATH/*
5353
ln -s $GITHUB_WORKSPACE $HOME/$BSP_PATH/$BSP_VERSION
5454
# Install library dependency
55-
arduino-cli lib install "Adafruit GFX Library" "Adafruit SSD1306" "Adafruit ILI9341" "Adafruit HX8357 Library" "Adafruit EPD"
55+
arduino-cli lib install "Adafruit GFX Library" "Adafruit SSD1306" "Adafruit ILI9341" "Adafruit HX8357 Library" "Adafruit ST7735 and ST7789 Library" "Adafruit EPD"
5656
arduino-cli lib install "Adafruit Circuit Playground" "Adafruit NeoPixel" "Adafruit NeoMatrix" "MIDI Library" "Firmata"
5757
5858
- name: Build examples

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
This repository contains the Arduino BSP for Adafruit Bluefruit nRF52 series:
66

7-
- Adafruit CLUE nRF52840
7+
- [Adafruit CLUE nRF52840](https://www.adafruit.com/product/4500)
88
- [Adafruit Circuit Playground Bluefruit](https://www.adafruit.com/product/4333)
99
- [Adafruit Feather nRF52832](https://www.adafruit.com/product/3406)
1010
- [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
11-
- Adafruit Feather nRF52840 Sense
11+
- [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
1414

boards.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ feather52840sense.build.board=NRF52840_FEATHER_SENSE
144144
feather52840sense.build.core=nRF5
145145
feather52840sense.build.variant=feather_nrf52840_sense
146146
feather52840sense.build.usb_manufacturer="Adafruit LLC"
147-
feather52840sense.build.usb_product="Feather Bluefruit Sense"
147+
feather52840sense.build.usb_product="Feather nRF52840 Sense"
148148
feather52840sense.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
149149
feather52840sense.build.ldscript=nrf52840_s140_v6.ld
150150
feather52840sense.build.vid=0x239A
@@ -167,9 +167,9 @@ feather52840sense.menu.debug.l3=Level 3 (Segger SystemView)
167167
feather52840sense.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
168168

169169

170-
# ----------------------------------
170+
# ---------------------------------------------
171171
# Bluefruit ItsyBitsy nRF52840 Express
172-
# ----------------------------------
172+
# ---------------------------------------------
173173
itsybitsy52840.name=Adafruit ItsyBitsy nRF52840 Express
174174

175175
# VID/PID for bootloader with/without UF2, Arduino + Circuitpython App
@@ -251,7 +251,7 @@ cplaynrf52840.build.board=NRF52840_CIRCUITPLAY
251251
cplaynrf52840.build.core=nRF5
252252
cplaynrf52840.build.variant=circuitplayground_nrf52840
253253
cplaynrf52840.build.usb_manufacturer="Adafruit LLC"
254-
cplaynrf52840.build.usb_product="Adafruit Circuit Playground Bluefruit"
254+
cplaynrf52840.build.usb_product="Circuit Playground Bluefruit"
255255
cplaynrf52840.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
256256
cplaynrf52840.build.ldscript=nrf52840_s140_v6.ld
257257
cplaynrf52840.build.vid=0x239A
@@ -305,7 +305,7 @@ cluenrf52840.build.board=NRF52840_CLUE
305305
cluenrf52840.build.core=nRF5
306306
cluenrf52840.build.variant=clue_nrf52840
307307
cluenrf52840.build.usb_manufacturer="Adafruit LLC"
308-
cluenrf52840.build.usb_product="Adafruit Clue"
308+
cluenrf52840.build.usb_product="CLUE"
309309
cluenrf52840.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
310310
cluenrf52840.build.ldscript=nrf52840_s140_v6.ld
311311
cluenrf52840.build.vid=0x239A
@@ -380,6 +380,16 @@ metro52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
380380
metro52840.menu.debug.l3=Level 3 (Segger SystemView)
381381
metro52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
382382

383+
384+
385+
386+
# -------------------------------------------------------
387+
#
388+
# Boards that aren't made by Adafruit
389+
#
390+
# -------------------------------------------------------
391+
392+
383393
# ----------------------------------
384394
# Nordic nRF52840DK (PCA10056)
385395
# ----------------------------------

libraries/BLEAdafruitService/src/BLEAdafruitService.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@
2828
#include "bluefruit_common.h"
2929
#include "BLECharacteristic.h"
3030
#include "BLEService.h"
31-
3231
#include "services/BLEAdafruitSensor.h"
33-
#include "services/BLEAdafruitTemperature.h"
32+
3433
#include "services/BLEAdafruitAccel.h"
35-
#include "services/BLEAdafruitLightSensor.h"
34+
#include "services/BLEAdafruitAddressablePixel.h"
35+
#include "services/BLEAdafruitBaro.h"
3636
#include "services/BLEAdafruitButton.h"
37+
#include "services/BLEAdafruitGyro.h"
38+
#include "services/BLEAdafruitHumid.h"
39+
#include "services/BLEAdafruitLightSensor.h"
40+
#include "services/BLEAdafruitMagnetic.h"
41+
#include "services/BLEAdafruitTemperature.h"
3742
#include "services/BLEAdafruitTone.h"
38-
#include "services/BLEAdafruitAddressablePixel.h"
3943

4044
#endif /* BLEADAFRUITSERVICE_H_ */

libraries/BLEAdafruitService/src/services/BLEAdafruitAccel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ err_t BLEAdafruitAccel::begin (void)
6868
_measurement.setFixedLen(4*3);
6969

7070
// Invoke base class begin(), this will add Service, Measurement and Period characteristics
71-
VERIFY_STATUS( BLEAdafruitSensor::begin(1000) );
71+
VERIFY_STATUS( BLEAdafruitSensor::begin(DEFAULT_PERIOD) );
7272

7373
return ERROR_NONE;
7474
}

libraries/BLEAdafruitService/src/services/BLEAdafruitAccel.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,18 @@
2222
* THE SOFTWARE.
2323
*/
2424

25-
#ifndef BLEADAFRUITACCEL_H_
26-
#define BLEADAFRUITACCEL_H_
25+
#ifndef BLEADAFRUIT_ACCEL_H_
26+
#define BLEADAFRUIT_ACCEL_H_
2727

2828
class BLEAdafruitAccel : public BLEAdafruitSensor
2929
{
3030
public:
3131
static const uint8_t UUID128_SERVICE[16];
3232
static const uint8_t UUID128_CHR_DATA[16];
33-
34-
BLECharacteristic Accel;
33+
static const int32_t DEFAULT_PERIOD = 1000;
3534

3635
BLEAdafruitAccel(void);
3736
virtual err_t begin(void);
3837
};
3938

40-
#endif /* BLEADAFRUITACCEL_H_ */
39+
#endif /* BLEADAFRUIT_ACCEL_H_ */

libraries/BLEAdafruitService/src/services/BLEAdafruitAddressablePixel.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
* THE SOFTWARE.
2323
*/
2424

25-
#ifndef BLEADAFRUITADDRESSABLEPIXEL_H_
26-
#define BLEADAFRUITADDRESSABLEPIXEL_H_
25+
#ifndef BLEADAFRUIT_ADDRESSABLEPIXEL_H_
26+
#define BLEADAFRUIT_ADDRESSABLEPIXEL_H_
2727

2828
#include "Adafruit_NeoPixel.h"
2929

@@ -54,4 +54,4 @@ class BLEAdafruitAddressablePixel : public BLEService
5454

5555

5656

57-
#endif /* BLEADAFRUITADDRESSABLEPIXEL_H_ */
57+
#endif /* BLEADAFRUIT_ADDRESSABLEPIXEL_H_ */
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
#include "BLEAdafruitService.h"
26+
27+
//--------------------------------------------------------------------+
28+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
29+
//--------------------------------------------------------------------+
30+
31+
32+
/* All Adafruit Service/Characteristic UUID128 share the same Base UUID:
33+
* ADAFxxx-C332-42A8-93BD-25E905756CB8
34+
*
35+
* Shared Characteristics
36+
* - Measurement Period 0001 | int32_t | Read + Write |
37+
* ms between measurements, -1: stop reading, 0: update when changes
38+
*
39+
* Barometric service 0800
40+
* - Pressure 0801 | float[3] | Read + Notify | x, y, z
41+
* - Measurement Period 0001
42+
*/
43+
44+
const uint8_t BLEAdafruitBaro::UUID128_SERVICE[16] =
45+
{
46+
0xB8, 0x6c, 0x75, 0x05, 0xE9, 0x25, 0xBD, 0x93,
47+
0xA8, 0x42, 0x32, 0xC3, 0x00, 0x08, 0xAF, 0xAD
48+
};
49+
50+
const uint8_t BLEAdafruitBaro::UUID128_CHR_DATA[16] =
51+
{
52+
0xB8, 0x6c, 0x75, 0x05, 0xE9, 0x25, 0xBD, 0x93,
53+
0xA8, 0x42, 0x32, 0xC3, 0x01, 0x08, 0xAF, 0xAD
54+
};
55+
56+
// Constructor
57+
BLEAdafruitBaro::BLEAdafruitBaro(void)
58+
: BLEAdafruitSensor(UUID128_SERVICE, UUID128_CHR_DATA)
59+
{
60+
61+
}
62+
63+
err_t BLEAdafruitBaro::begin (void)
64+
{
65+
// Setup Measurement Characteristic
66+
_measurement.setProperties(CHR_PROPS_READ | CHR_PROPS_NOTIFY);
67+
_measurement.setPermission(SECMODE_OPEN, SECMODE_NO_ACCESS);
68+
_measurement.setFixedLen(4);
69+
70+
// Invoke base class begin(), this will add Service, Measurement and Period characteristics
71+
VERIFY_STATUS( BLEAdafruitSensor::begin(DEFAULT_PERIOD) );
72+
73+
return ERROR_NONE;
74+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
#ifndef BLEADAFRUIT_BARO_H_
26+
#define BLEADAFRUIT_BARO_H_
27+
28+
class BLEAdafruitBaro : public BLEAdafruitSensor
29+
{
30+
public:
31+
static const uint8_t UUID128_SERVICE[16];
32+
static const uint8_t UUID128_CHR_DATA[16];
33+
static const int32_t DEFAULT_PERIOD = 1000;
34+
35+
BLEAdafruitBaro(void);
36+
virtual err_t begin(void);
37+
};
38+
39+
#endif /* BLEADAFRUIT_BARO_H_ */

libraries/BLEAdafruitService/src/services/BLEAdafruitButton.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ err_t BLEAdafruitButton::begin(void)
6767
_measurement.setFixedLen(4);
6868

6969
// Invoke base class begin(), this will add Service, Measurement and Period characteristics
70-
VERIFY_STATUS( BLEAdafruitSensor::begin(100) );
70+
VERIFY_STATUS( BLEAdafruitSensor::begin(DEFAULT_PERIOD) );
7171

7272
return ERROR_NONE;
7373
}

0 commit comments

Comments
 (0)