Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 5339d21

Browse files
authored
v1.2.2 to add support to Seeeduino nRF52
### Releases v1.2.2 1. Add support to Seeeduino nRF52840-based boards such as **SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE**, etc. using Seeeduino `mbed` core 2. Add astyle using `allman` style. Restyle the library
1 parent d99a6b4 commit 5339d21

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

README.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
123123

124124
### Currently supported Boards
125125

126-
1. **nRF52_MBED-based boards** such as Nano-33-BLE or Nano-33-BLE_Sense, etc., using [`Arduino mbed_nano core 2.5.2+`](https://github.com/arduino/ArduinoCore-mbed) or [`Arduino mbed core v1.3.2-`](https://github.com/arduino/ArduinoCore-mbed/releases/tag/1.3.2)
126+
1. **MBED nRF52840-based boards such as Nano_33_BLE, Nano_33_BLE_Sense**, etc. using [**Arduino-mbed mbed_nano** core](https://github.com/arduino/ArduinoCore-mbed)
127+
2. **Seeeduino nRF52840-based boards such as SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE**, etc. using Seeeduino `mbed` core
127128

128129
---
129130

@@ -139,10 +140,11 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
139140
## Prerequisites
140141

141142
1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://img.shields.io/github/release/arduino/Arduino.svg)](https://github.com/arduino/Arduino/releases/latest)
142-
2. [`Arduino mbed_nano core 2.7.2+`](https://github.com/arduino/ArduinoCore-mbed) for NRF52-based board using mbed-RTOS such as Nano-33-BLE if you don't use `NRF_TIMER_1`. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-mbed.svg)](https://github.com/arduino/ArduinoCore-mbed/releases/latest)
143+
2. [`Arduino mbed_nano core 3.4.1+`](https://github.com/arduino/ArduinoCore-mbed) for NRF52-based board using mbed-RTOS such as Nano-33-BLE if you don't use `NRF_TIMER_1`. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-mbed.svg)](https://github.com/arduino/ArduinoCore-mbed/releases/latest)
143144
3. [`Arduino mbed core v1.3.2-`](https://github.com/arduino/ArduinoCore-mbed/releases/tag/1.3.2) for NRF52-based board using mbed-RTOS such as Nano-33-BLE if you'd like to use `NRF_TIMER_1`. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-mbed.svg)](https://github.com/arduino/ArduinoCore-mbed/releases/latest)
145+
4. `Seeeduino mbed core 2.7.2+` for Seeeduino nRF52840-based boards such as **SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE**
144146

145-
4. To use with certain example
147+
5. To use with certain example
146148
- [`SimpleTimer library`](https://github.com/jfturcot/SimpleTimer) for [ISR_16_PWMs_Array_Complex example](examples/ISR_16_PWMs_Array_Complex).
147149
---
148150
---
@@ -159,9 +161,9 @@ You can also use this link [![arduino-library-badge](https://www.ardu-badge.com/
159161
Another way to install is to:
160162

161163
1. Navigate to [**nRF52_MBED_Slow_PWM**](https://github.com/khoih-prog/nRF52_MBED_Slow_PWM) page.
162-
2. Download the latest release `nRF52_MBED_Slow_PWM-master.zip`.
163-
3. Extract the zip file to `nRF52_MBED_Slow_PWM-master` directory
164-
4. Copy whole `nRF52_MBED_Slow_PWM-master` folder to Arduino libraries' directory such as `~/Arduino/libraries/`.
164+
2. Download the latest release `nRF52_MBED_Slow_PWM-main.zip`.
165+
3. Extract the zip file to `nRF52_MBED_Slow_PWM-main` directory
166+
4. Copy whole `nRF52_MBED_Slow_PWM-main` folder to Arduino libraries' directory such as `~/Arduino/libraries/`.
165167

166168
### VS Code & PlatformIO
167169

@@ -180,14 +182,14 @@ The current library implementation, using `xyz-Impl.h` instead of standard `xyz.
180182

181183
You can include this `.hpp` file
182184

183-
```
185+
```cpp
184186
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
185187
#include "nRF52_MBED_Slow_PWM.hpp" //https://github.com/khoih-prog/nRF52_MBED_Slow_PWM
186188
```
187189

188190
in many files. But be sure to use the following `.h` file **in just 1 `.h`, `.cpp` or `.ino` file**, which must **not be included in any other file**, to avoid `Multiple Definitions` Linker Error
189191

190-
```
192+
```cpp
191193
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
192194
#include "nRF52_MBED_Slow_PWM.h" //https://github.com/khoih-prog/nRF52_MBED_Slow_PWM
193195
```
@@ -211,7 +213,7 @@ Before using any Timer, you have to make sure the Timer has not been used by any
211213

212214
#### 1. Init Hardware Timer
213215

214-
```
216+
```cpp
215217
// Init NRF52 timer NRF_TIMER3
216218
NRF52_MBED_Timer ITimer(NRF_TIMER_3);
217219

@@ -221,7 +223,7 @@ NRF52_MBED_Slow_PWM ISR_PWM;
221223
222224
#### 2. Set PWM Frequency, dutycycle, attach irqCallbackStartFunc and irqCallbackStopFunc functions
223225
224-
```
226+
```cpp
225227
void irqCallbackStartFunc()
226228
{
227229
@@ -261,7 +263,7 @@ void setup()
261263

262264
### Example [ISR_16_PWMs_Array_Complex](examples/ISR_16_PWMs_Array_Complex)
263265

264-
https://github.com/khoih-prog/nRF52_MBED_Slow_PWM/blob/36036c9759ff4ea96a4b30e33242ca54ed49a7c4/examples/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino#L16-L578
266+
https://github.com/khoih-prog/nRF52_MBED_Slow_PWM/blob/d99a6b40d4cd4642284791634d76ea729fe6d91b/examples/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino#L16-L590
265267

266268

267269
---
@@ -276,7 +278,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
276278

277279
```
278280
Starting ISR_16_PWMs_Array_Complex on Nano 33 BLE
279-
NRF52_MBED_Slow_PWM v1.2.1
281+
NRF52_MBED_Slow_PWM v1.2.2
280282
[PWM] Timer = NRF_TIMER3 , Timer Clock (Hz) = 16000000.00
281283
[PWM] Frequency = 100000.00 , _count = 160
282284
Starting ITimer OK, micros() = 2800208
@@ -357,7 +359,7 @@ The following is the sample terminal output when running example [**ISR_16_PWMs_
357359

358360
```
359361
Starting ISR_16_PWMs_Array on Nano 33 BLE
360-
NRF52_MBED_Slow_PWM v1.2.1
362+
NRF52_MBED_Slow_PWM v1.2.2
361363
[PWM] Timer = NRF_TIMER3 , Timer Clock (Hz) = 16000000.00
362364
[PWM] Frequency = 100000.00 , _count = 160
363365
Starting ITimer OK, micros() = 2802084
@@ -387,7 +389,7 @@ The following is the sample terminal output when running example [**ISR_16_PWMs_
387389

388390
```
389391
Starting ISR_16_PWMs_Array_Simple on Nano 33 BLE
390-
NRF52_MBED_Slow_PWM v1.2.1
392+
NRF52_MBED_Slow_PWM v1.2.2
391393
[PWM] Timer = NRF_TIMER3 , Timer Clock (Hz) = 16000000.00
392394
[PWM] Frequency = 100000.00 , _count = 160
393395
Starting ITimer OK, micros() = 3202330
@@ -417,7 +419,7 @@ The following is the sample terminal output when running example [ISR_Modify_PWM
417419

418420
```
419421
Starting ISR_Modify_PWM on Nano 33 BLE
420-
NRF52_MBED_Slow_PWM v1.2.1
422+
NRF52_MBED_Slow_PWM v1.2.2
421423
[PWM] Timer = NRF_TIMER3 , Timer Clock (Hz) = 16000000.00
422424
[PWM] Frequency = 50000.00 , _count = 320
423425
Starting ITimer OK, micros() = 2703294
@@ -456,7 +458,7 @@ The following is the sample terminal output when running example [ISR_Changing_P
456458

457459
```
458460
Starting ISR_Changing_PWM on Nano 33 BLE
459-
NRF52_MBED_Slow_PWM v1.2.1
461+
NRF52_MBED_Slow_PWM v1.2.2
460462
[PWM] Timer = NRF_TIMER3 , Timer Clock (Hz) = 16000000.00
461463
[PWM] Frequency = 50000.00 , _count = 320
462464
Starting ITimer OK, micros() = 3024808
@@ -509,14 +511,17 @@ Submit issues to: [nRF52_MBED_Slow_PWM issues](https://github.com/khoih-prog/nRF
509511

510512
## DONE
511513

512-
1. Basic hardware multi-channel PWM for **nRF52_MBED-based Nano-33-BLE or Nano-33-BLE_Sense, etc.** using [`Arduino mbed_nano core 2.5.2+`](https://github.com/arduino/ArduinoCore-mbed) or [`Arduino mbed core v1.3.2-`](https://github.com/arduino/ArduinoCore-mbed/releases/tag/1.3.2)
513-
2. Add Table of Contents
514-
3. Add functions to modify PWM settings on-the-fly
515-
4. Fix `multiple-definitions` linker error
516-
5. Optimize library code by using `reference-passing` instead of `value-passing`
517-
6. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`
518-
7. DutyCycle to be optionally updated at the end current PWM period instead of immediately.
519-
8. Display informational warning only when `_PWM_LOGLEVEL_` > 3
514+
1. Basic hardware multi-channel PWM for **nRF52_MBED-based Nano-33-BLE or Nano-33-BLE_Sense, etc.** using [`Arduino mbed_nano core 2.5.2+`](https://github.com/arduino/ArduinoCore-mbed) or [`Arduino mbed core v1.3.2-`](https://github.com/arduino/ArduinoCore-mbed/releases/tag/1.3.2)
515+
2. Add Table of Contents
516+
3. Add functions to modify PWM settings on-the-fly
517+
4. Fix `multiple-definitions` linker error
518+
5. Optimize library code by using `reference-passing` instead of `value-passing`
519+
6. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`
520+
7. DutyCycle to be optionally updated at the end current PWM period instead of immediately.
521+
8. Display informational warning only when `_PWM_LOGLEVEL_` > 3
522+
9. Add support to Seeeduino nRF52840-based boards such as **SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE**, etc. using Seeeduino `mbed` core
523+
10. Add astyle using `allman` style. Restyle the library
524+
520525

521526
---
522527
---

0 commit comments

Comments
 (0)