Skip to content

Commit 93af438

Browse files
committed
Enable STEVAL-MKBOXPRO support in examples
1 parent 831e996 commit 93af438

File tree

7 files changed

+77
-14
lines changed

7 files changed

+77
-14
lines changed

Diff for: examples/Central/LedControl/LedControl.ino

+11-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
it will remotely control the BLE Peripheral's LED, when the button is pressed or released.
77
88
The circuit:
9-
- STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
9+
- STEVAL-MKBOXPRO, STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
1010
1111
You can use it with another board that is compatible with this library and the
1212
Peripherals -> LED example.
@@ -16,7 +16,16 @@
1616

1717
#include <STM32duinoBLE.h>
1818

19-
#if defined(ARDUINO_STEVAL_MKSBOX1V1)
19+
#if defined(ARDUINO_STEVAL_MKBOXPRO)
20+
/* STEVAL-MKBOXPRO */
21+
SPIClass SpiHCI(PA7, PA6, PA5);
22+
HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_LP, PA2, PB11, PD4, 1000000, SPI_MODE3);
23+
#if !defined(FAKE_BLELOCALDEVICE)
24+
BLELocalDevice BLEObj(&HCISpiTransport);
25+
BLELocalDevice& BLE = BLEObj;
26+
#endif
27+
const int buttonPin = PC13; // set buttonPin to digital pin PC13
28+
#elif defined(ARDUINO_STEVAL_MKSBOX1V1)
2029
/* STEVAL-MKSBOX1V1 */
2130
SPIClass SpiHCI(PC3, PD3, PD1);
2231
HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_1S, PD0, PD4, PA8, 1000000, SPI_MODE1);

Diff for: examples/Central/PeripheralExplorer/PeripheralExplorer.ino

+11-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
is found. Then connects, and discovers + prints all the peripheral's attributes.
66
77
The circuit:
8-
- STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
8+
- STEVAL-MKBOXPRO, STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
99
1010
You can use it with another board that is compatible with this library and the
1111
Peripherals -> LED example.
@@ -15,7 +15,16 @@
1515

1616
#include <STM32duinoBLE.h>
1717

18-
#if defined(ARDUINO_STEVAL_MKSBOX1V1)
18+
#if defined(ARDUINO_STEVAL_MKBOXPRO)
19+
/* STEVAL-MKBOXPRO */
20+
SPIClass SpiHCI(PA7, PA6, PA5);
21+
HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_LP, PA2, PB11, PD4, 1000000, SPI_MODE3);
22+
#if !defined(FAKE_BLELOCALDEVICE)
23+
BLELocalDevice BLEObj(&HCISpiTransport);
24+
BLELocalDevice& BLE = BLEObj;
25+
#endif
26+
const int buttonPin = PC13; // set buttonPin to digital pin PC13
27+
#elif defined(ARDUINO_STEVAL_MKSBOX1V1)
1928
/* STEVAL-MKSBOX1V1 */
2029
SPIClass SpiHCI(PC3, PD3, PD1);
2130
HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_1S, PD0, PD4, PA8, 1000000, SPI_MODE1);

Diff for: examples/Central/Scan/Scan.ino

+11-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,23 @@
55
address, local name, advertised service UUID's.
66
77
The circuit:
8-
- STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
8+
- STEVAL-MKBOXPRO, STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
99
1010
This example code is in the public domain.
1111
*/
1212

1313
#include <STM32duinoBLE.h>
1414

15-
#if defined(ARDUINO_STEVAL_MKSBOX1V1)
15+
#if defined(ARDUINO_STEVAL_MKBOXPRO)
16+
/* STEVAL-MKBOXPRO */
17+
SPIClass SpiHCI(PA7, PA6, PA5);
18+
HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_LP, PA2, PB11, PD4, 1000000, SPI_MODE3);
19+
#if !defined(FAKE_BLELOCALDEVICE)
20+
BLELocalDevice BLEObj(&HCISpiTransport);
21+
BLELocalDevice& BLE = BLEObj;
22+
#endif
23+
const int buttonPin = PC13; // set buttonPin to digital pin PC13
24+
#elif defined(ARDUINO_STEVAL_MKSBOX1V1)
1625
/* STEVAL-MKSBOX1V1 */
1726
SPIClass SpiHCI(PC3, PD3, PD1);
1827
HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_1S, PD0, PD4, PA8, 1000000, SPI_MODE1);

Diff for: examples/Central/ScanCallback/ScanCallback.ino

+11-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,23 @@
77
reported for every single advertisement it makes.
88
99
The circuit:
10-
- STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
10+
- STEVAL-MKBOXPRO, STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
1111
1212
This example code is in the public domain.
1313
*/
1414

1515
#include <STM32duinoBLE.h>
1616

17-
#if defined(ARDUINO_STEVAL_MKSBOX1V1)
17+
#if defined(ARDUINO_STEVAL_MKBOXPRO)
18+
/* STEVAL-MKBOXPRO */
19+
SPIClass SpiHCI(PA7, PA6, PA5);
20+
HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_LP, PA2, PB11, PD4, 1000000, SPI_MODE3);
21+
#if !defined(FAKE_BLELOCALDEVICE)
22+
BLELocalDevice BLEObj(&HCISpiTransport);
23+
BLELocalDevice& BLE = BLEObj;
24+
#endif
25+
const int buttonPin = PC13; // set buttonPin to digital pin PC13
26+
#elif defined(ARDUINO_STEVAL_MKSBOX1V1)
1827
/* STEVAL-MKSBOX1V1 */
1928
SPIClass SpiHCI(PC3, PD3, PD1);
2029
HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_1S, PD0, PD4, PA8, 1000000, SPI_MODE1);

Diff for: examples/Central/SensorTagButton/SensorTagButton.ino

+11-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,24 @@
88
outputted to the Serial Monitor when one is pressed.
99
1010
The circuit:
11-
- STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
11+
- STEVAL-MKBOXPRO, STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
1212
- TI SensorTag
1313
1414
This example code is in the public domain.
1515
*/
1616

1717
#include <STM32duinoBLE.h>
1818

19-
#if defined(ARDUINO_STEVAL_MKSBOX1V1)
19+
#if defined(ARDUINO_STEVAL_MKBOXPRO)
20+
/* STEVAL-MKBOXPRO */
21+
SPIClass SpiHCI(PA7, PA6, PA5);
22+
HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_LP, PA2, PB11, PD4, 1000000, SPI_MODE3);
23+
#if !defined(FAKE_BLELOCALDEVICE)
24+
BLELocalDevice BLEObj(&HCISpiTransport);
25+
BLELocalDevice& BLE = BLEObj;
26+
#endif
27+
const int buttonPin = PC13; // set buttonPin to digital pin PC13
28+
#elif defined(ARDUINO_STEVAL_MKSBOX1V1)
2029
/* STEVAL-MKSBOX1V1 */
2130
SPIClass SpiHCI(PC3, PD3, PD1);
2231
HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_1S, PD0, PD4, PA8, 1000000, SPI_MODE1);

Diff for: examples/Peripheral/CallbackLED/CallbackLED.ino

+11-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
library are used.
77
88
The circuit:
9-
- STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
9+
- STEVAL-MKBOXPRO, STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
1010
1111
You can use a generic BLE central app, like LightBlue (iOS and Android) or
1212
nRF Connect (Android), to interact with the services and characteristics
@@ -17,7 +17,16 @@
1717

1818
#include <STM32duinoBLE.h>
1919

20-
#if defined(ARDUINO_STEVAL_MKSBOX1V1)
20+
#if defined(ARDUINO_STEVAL_MKBOXPRO)
21+
/* STEVAL-MKBOXPRO */
22+
SPIClass SpiHCI(PA7, PA6, PA5);
23+
HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_LP, PA2, PB11, PD4, 1000000, SPI_MODE3);
24+
#if !defined(FAKE_BLELOCALDEVICE)
25+
BLELocalDevice BLEObj(&HCISpiTransport);
26+
BLELocalDevice& BLE = BLEObj;
27+
#endif
28+
const int buttonPin = PC13; // set buttonPin to digital pin PC13
29+
#elif defined(ARDUINO_STEVAL_MKSBOX1V1)
2130
/* STEVAL-MKSBOX1V1 */
2231
SPIClass SpiHCI(PC3, PD3, PD1);
2332
HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_1S, PD0, PD4, PA8, 1000000, SPI_MODE1);

Diff for: examples/Peripheral/LED/LED.ino

+11-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
characteristic to control an LED.
66
77
The circuit:
8-
- STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
8+
- STEVAL-MKBOXPRO, STEVAL-MKSBOX1V1, B-L475E-IOT01A1, B_L4S5I_IOT01A, or a Nucleo board plus the X-NUCLEO-IDB05A2 or the X-NUCLEO-IDB05A1 or the X-NUCLEO-BNRG2A1
99
1010
You can use a generic BLE central app, like LightBlue (iOS and Android) or
1111
nRF Connect (Android), to interact with the services and characteristics
@@ -15,7 +15,16 @@
1515
*/
1616
#include <STM32duinoBLE.h>
1717

18-
#if defined(ARDUINO_STEVAL_MKSBOX1V1)
18+
#if defined(ARDUINO_STEVAL_MKBOXPRO)
19+
/* STEVAL-MKBOXPRO */
20+
SPIClass SpiHCI(PA7, PA6, PA5);
21+
HCISpiTransportClass HCISpiTransport(SpiHCI, BLUENRG_LP, PA2, PB11, PD4, 1000000, SPI_MODE3);
22+
#if !defined(FAKE_BLELOCALDEVICE)
23+
BLELocalDevice BLEObj(&HCISpiTransport);
24+
BLELocalDevice& BLE = BLEObj;
25+
#endif
26+
const int buttonPin = PC13; // set buttonPin to digital pin PC13
27+
#elif defined(ARDUINO_STEVAL_MKSBOX1V1)
1928
/* STEVAL-MKSBOX1V1 */
2029
SPIClass SpiHCI(PC3, PD3, PD1);
2130
HCISpiTransportClass HCISpiTransport(SpiHCI, SPBTLE_1S, PD0, PD4, PA8, 1000000, SPI_MODE1);

0 commit comments

Comments
 (0)