You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+26-16Lines changed: 26 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,8 @@ _Params_ `func` pointer to the callback function
58
58
*`void unregisterCoreCallback(void (*func)(void))`: unregister a callback function
59
59
_Params_`func` pointer to the callback function
60
60
61
-
[[/img/Warning-icon.png|alt="Warning"]] By default, the core callback feature is disabled, to enable it `CORE_CALLBACK` must be defined.
61
+
> [!WARNING]
62
+
> By default, the core callback feature is disabled, to enable it `CORE_CALLBACK` must be defined.
62
63
63
64
[`build_opt.h`][build_opt.h] can be used to define it by adding `-DCORE_CALLBACK`.
64
65
@@ -77,7 +78,8 @@ As each pin has not the same capabilities, it uses the best way:
77
78
### Frequency
78
79
`analogWriteFrequency(freq)` has been added in core version greater than **1.5.0** to set the frequency used by `analogWrite()`. Default is `PWM_FREQUENCY` (1000) in Hertz.
79
80
80
-
**_Note_** frequency is common to all channels of a specified timer, setting the frequency for one channel will impact all others of the same timer.
81
+
> [!NOTE]
82
+
> frequency is common to all channels of a specified timer, setting the frequency for one channel will impact all others of the same timer.
81
83
82
84
#### Example
83
85
```C
@@ -109,7 +111,8 @@ to the desired ADC sample time.
109
111
An example which read then convert to proper Unit the 3 internal channels + A0 is provided with [STM32Examples](https://github.com/stm32duino/STM32Examples) library:
Copy file name to clipboardExpand all lines: HardwareTimer-library.md
+32-16Lines changed: 32 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,8 @@
13
13
/vscode-markdown-toc-config -->
14
14
<!-- /vscode-markdown-toc -->
15
15
16
-
[[/img/Warning-icon.png|alt="Warning"]] Needs *Arduino_Core_STM32* version > 1.6.1
16
+
> [!WARNING]
17
+
> Requires *Arduino_Core_STM32* version higher than 1.6.1
17
18
18
19
## 1. <aname='Introduction'></a>Introduction
19
20
@@ -29,7 +30,8 @@ __Example__:
29
30
30
31
Each timer may provide several channels, nevertheless it is important to understand that all channels of the same timer share the same counter and thus have the same period/frequency.
31
32
32
-
[[/img/Warning-icon.png|alt="Warning"]]__For genericity purpose, HardwareTimer library uses all timers like a 16bits timer (even if some may be wider).__
33
+
> [!WARNING]
34
+
> For genericity purpose, HardwareTimer library uses all timers like a 16bits timer (even if some may be wider).
33
35
34
36
35
37
## 2. <aname='API'></a>API
@@ -96,7 +98,8 @@ Each timer may provide several channels, nevertheless it is important to underst
96
98
97
99
`HardwareTimer` is a C++ class, 1st thing to do is to instantiate an object with `TIM` instance as parameter.
98
100
99
-
[[/img/Note-icon.png|alt="Note"]] Some instances are used by Servo, Tone and SoftSerial (see TIMER_SERVO, TIMER_TONE and TIMER_SERIAL) but only when they are used. Just be sure there is no conflict with your own usage.
101
+
> [!NOTE]
102
+
> Some instances are used by Servo, Tone and SoftSerial (see TIMER_SERVO, TIMER_TONE and TIMER_SERIAL) but only when they are used. Just be sure there is no conflict with your own usage.
100
103
101
104
__Example__:
102
105
```C++
@@ -105,9 +108,11 @@ __Example__:
105
108
106
109
Then it is possible to configure mode of a channel.
107
110
108
-
[[/img/Note-icon.png|alt="Note"]] No need to configure pin mode (output/input/AlternateFunction), it will be done automatically by HardwareTimer library.
111
+
> [!NOTE]
112
+
> No need to configure pin mode (output/input/AlternateFunction), it will be done automatically by HardwareTimer library.
109
113
110
-
[[/img/Note-icon.png|alt="Note"]] Channel range [1..4], but not all timers support 4 channels.
114
+
> [!NOTE]
115
+
> Channel range [1..4], but not all timers support 4 channels.
111
116
112
117
__Example__:
113
118
```C++
@@ -145,11 +150,14 @@ typedef enum {
145
150
Then it is possible to configure *PrescalerFactor*. The Timer clock will be divided by this factor (if timer clock is 10Khz, and prescaler factor is 2, then timer will count at 5kHz).
146
151
147
152
148
-
[[/img/Note-icon.png|alt="Note"]] Configuration of *prescaler* is automatic when using method `setOverflow` with `format == MICROSEC_FORMAT` or `format == HERTZ_FORMAT`.
153
+
> [!NOTE]
154
+
> Configuration of *prescaler* is automatic when using method `setOverflow` with `format == MICROSEC_FORMAT` or `format == HERTZ_FORMAT`.
149
155
150
-
[[/img/Note-icon.png|alt="Note"]]*Prescaler* is for timer counter and thus is common to all channel.
156
+
> [!NOTE]
157
+
> *Prescaler* is for timer counter and thus is common to all channel.
151
158
152
-
[[/img/Note-icon.png|alt="Note"]]*PrescalerFactor* range: [1.. 0x10000] (Hardware register will range [0..0xFFFF]).
159
+
> [!NOTE]
160
+
> *PrescalerFactor* range: [1.. 0x10000] (Hardware register will range [0..0xFFFF]).
153
161
154
162
__Example__:
155
163
```C++
@@ -162,11 +170,14 @@ For __output__ it correspond to period or frequency.
162
170
163
171
For __input capture__ it is suggested to use max value: 0x10000 to avoid rollover before capture occurs .
164
172
165
-
[[/img/Note-icon.png|alt="Note"]] Configuration of *prescaler* is automatic when using method `setOverflow` with `format == MICROSEC_FORMAT` or `format == HERTZ_FORMAT`.
173
+
> [!NOTE]
174
+
> Configuration of *prescaler* is automatic when using method `setOverflow` with `format == MICROSEC_FORMAT` or `format == HERTZ_FORMAT`.
166
175
167
-
[[/img/Note-icon.png|alt="Note"]] *overflow* is common to all channel.
176
+
> [!NOTE]
177
+
> *overflow* is common to all channel.
168
178
169
-
[[/img/Note-icon.png|alt="Note"]] *Overflow* range: [1.. 0x10000] (Hardware register will range [0..0xFFFF]).
179
+
> [!NOTE]
180
+
> *Overflow* range: [1.. 0x10000] (Hardware register will range [0..0xFFFF]).
170
181
171
182
__Example__:
172
183
```C++
@@ -178,9 +189,11 @@ __Example__:
178
189
179
190
Then it is possible to configure *CaptureCompare* (channel specific CaptureCompare register).
180
191
181
-
[[/img/Note-icon.png|alt="Note"]]*CaptureCompare* is for one channel only.
[[/img/Note-icon.png|alt="Note"]] All channel of the same timer are started at the same time (as there is only 1 counter per timer).
220
+
> [!NOTE]
221
+
> All channel of the same timer are started at the same time (as there is only 1 counter per timer).
208
222
209
223
__Example__:
210
224
```C++
@@ -252,7 +266,8 @@ Also, to get ride of Interrupt callback:
252
266
```C++
253
267
detachInterrupt()
254
268
```
255
-
[[/img/Note-icon.png|alt="Note"]] Once the timer is started with the callback enabled you can disable and enable the callback through `detachInterrupt` and `attachInterrupt` freely, how many times you want. However, if the first `resume` (= timer start) is done without **before** calling `attachInterrupt`, the HardwareTimer will **not** be able to attach the interrupt later (for performance reasons the timer will be started with interrupts disabled)
269
+
> [!NOTE]
270
+
> Once the timer is started with the callback enabled you can disable and enable the callback through `detachInterrupt` and `attachInterrupt` freely, how many times you want. However, if the first `resume` (= timer start) is done without **before** calling `attachInterrupt`, the HardwareTimer will **not** be able to attach the interrupt later (for performance reasons the timer will be started with interrupts disabled)
256
271
257
272
If you detach and attach interrupts while the timer is running, starting from version 1.8.0, you can also know if there's a callback already attached (without the need to track it externally) through the method
258
273
```C++
@@ -306,7 +321,8 @@ Following examples are provided in [STM32Examples](https://github.com/stm32duino
306
321
External signal (signal generator for example) should be connected to `D2`.
307
322
308
323
## 5. <aname='Dependencies'></a>Dependencies
309
-
[[/img/Warning-icon.png|alt="Warning"]] Needs *Arduino_Core_STM32* version > 1.6.1
324
+
> [!WARNING]
325
+
> Required *Arduino_Core_STM32* version higher than 1.6.1
310
326
311
327
*Tone*, *Servo* and *analogwrite* have been updated to use *HardwareTimer*.
Copy file name to clipboardExpand all lines: Libraries.md
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,14 @@ Libraries using basic features like Serial, SPI, I2C,... should be fully compati
11
11
*[Third party](#third-party)
12
12
*[Tested](#tested)
13
13
14
-
[[/img/Warning-icon.png|alt="Warning"]]_Arduino boards provide ICSP connector used by several Arduino shields for SPI signal: MISO/MOSI/SCK. STM32 boards do not have this ICSP connector, so this requires to manually wire those SPI signals to the desired pin (mainly: D11 to D13)_
14
+
> [!WARNING]
15
+
> Arduino boards provide ICSP connector used by several Arduino shields for SPI signal: MISO/MOSI/SCK. STM32 boards do not have this ICSP connector, so this requires to manually wire those SPI signals to the desired pin (mainly: D11 to D13)
15
16
16
-
[[/img/Note-icon.png|alt="Note"]] All dedicated STM32 libraries are available through the "_**Library Manager**_"
17
-
or have a look hereafter to see which one is available:
@@ -102,7 +104,9 @@ These libraries are guaranteed to work fine with all NUCLEO boards supported in
102
104
*[X-NUCLEO-GNSS1A1](https://github.com/stm32duino/X-NUCLEO-GNSS1A1): to support the X-NUCLEO-GNSS1A1 expansion board using the TESEO-LIV3F module. It depends on the following libraries:
*[X-NUCLEO-IDB05A1](https://github.com/stm32duino/X-NUCLEO-IDB05A1): it is a Bluetooth Low Energy evaluation board based on the SPBTLE-RF BlueNRG-MS RF module. It depends on the following library:
0 commit comments