Skip to content

Commit 85fdb47

Browse files
committed
1 parent e777211 commit 85fdb47

28 files changed

+229
-165
lines changed

API.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ _Params_ `func` pointer to the callback function
5858
* `void unregisterCoreCallback(void (*func)(void))`: unregister a callback function
5959
_Params_ `func` pointer to the callback function
6060

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.
6263
6364
[`build_opt.h`][build_opt.h] can be used to define it by adding `-DCORE_CALLBACK`.
6465

@@ -77,7 +78,8 @@ As each pin has not the same capabilities, it uses the best way:
7778
### Frequency
7879
`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.
7980

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.
8183
8284
#### Example
8385
```C
@@ -109,7 +111,8 @@ to the desired ADC sample time.
109111
An example which read then convert to proper Unit the 3 internal channels + A0 is provided with [STM32Examples](https://github.com/stm32duino/STM32Examples) library:
110112
[Internal_channels](https://github.com/stm32duino/STM32Examples/blob/main/examples/Peripherals/ADC/Internal_channels/Internal_channels.ino)
111113
112-
[[/img/Warning-icon.png|alt="Warning"]] This example is provided "as it" and can require some update mainly for datasheet values.
114+
> [!WARNING]
115+
> This example is provided "as it" and can require some update mainly for datasheet values.
113116
114117
## HardwareSerial
115118
@@ -140,7 +143,8 @@ void loop() {
140143
Another solution is to add a [`build_opt.h`][build_opt.h] file alongside your main `.ino` file with: `-DENABLE_HWSERIALx`.
141144
This will define the `Serialx` instance using the first `USARTx` instance found in the `PeripheralPins.c` of your variant.
142145

143-
[[/img/Note-icon.png|alt="Note"]] **Note** that only the latter solution allows to use the `serialEventx()` callback in the sketch.
146+
> [!NOTE]
147+
> that only the latter solution allows to use the `serialEventx()` callback in the sketch.
144148
145149
For Example, if you define in the [`build_opt.h`][build_opt.h]: `-DENABLE_HWSERIAL3`
146150

@@ -167,7 +171,8 @@ It is also possible to change the default pins used by the `Serial` instance usi
167171
* `void setRx(PinName rx)`
168172
* `void setTx(PinName tx)`
169173
170-
[[/img/Warning-icon.png|alt="Warning"]] **Have to be called before `begin()`.**
174+
> [!WARNING]
175+
> Have to be called before `begin()`.
171176
172177
##### Example:
173178
```C++
@@ -289,7 +294,8 @@ void loop() {
289294
}
290295
```
291296
292-
**Note:** Serial Rx/TX buffer size can be changed, see [[custom definitions|Custom-definitions#serial-rxtx-buffer-size]]
297+
> [!NOTE]
298+
> Serial Rx/TX buffer size can be changed, see [[custom definitions|Custom-definitions#serial-rxtx-buffer-size]]
293299
294300
#### Enable hardware flow control
295301
@@ -366,7 +372,8 @@ void setup() {
366372
#### Change default `SPI` instance pins
367373
It is also possible to change the default pins used by the `SPI` instance using above API:
368374
369-
[[/img/Warning-icon.png|alt="Warning"]] **Have to be called before `begin()`.**
375+
> [!WARNING]
376+
> Have to be called before `begin()`.
370377
371378
* `void setMISO(uint32_t miso)`
372379
* `void setMOSI(uint32_t mosi)`
@@ -377,7 +384,8 @@ It is also possible to change the default pins used by the `SPI` instance using
377384
* `void setSCLK(PinName sclk)`
378385
* `void setSSEL(PinName ssel)`
379386
380-
**_Note 1_** Using `setSSEL()` allows to enable hardware CS pin management linked to the SPI peripheral.
387+
> [!NOTE]
388+
> Using `setSSEL()` allows to enable hardware CS pin management linked to the SPI peripheral.
381389
382390
##### Example:
383391
```C++
@@ -476,7 +484,8 @@ It is also possible to change the default pins used by the `Wire` instance using
476484
* `void setSCL(PinName scl)`
477485
* `void setSDA(PinName sda)`
478486

479-
[[/img/Warning-icon.png|alt="Warning"]] **Have to be called before `begin()`.**
487+
> [!WARNING]
488+
> Have to be called before `begin()`.
480489
481490
##### Example:
482491
```C++
@@ -563,13 +572,14 @@ In this case, following switches should be defined (in variant.h or [`build_opt.
563572
564573
see example of variant implementation: [#938](../pull/938)
565574
566-
[[/img/Warning-icon.png|alt="Warning"]] **Single/dual bank configuration**:
567-
568-
Default last sector used correspond to default board configuration.
569-
570-
For example, NUCLEO_F767ZI is by default configured in single bank. Last sector correspond to this bank configuration.
571-
If this configuration is changed, it is then mandatory to customize `FLASH_BASE_ADDRESS`/`FLASH_DATA_SECTOR`,
572-
even to use last sector of Flash.
575+
> [!WARNING]
576+
> Single/dual bank configuration:
577+
>
578+
> Default last sector used correspond to default board configuration.
579+
>
580+
> For example, NUCLEO_F767ZI is by default configured in single bank. Last sector correspond to this bank configuration.
581+
> If this configuration is changed, it is then mandatory to customize `FLASH_BASE_ADDRESS`/`FLASH_DATA_SECTOR`,
582+
> even to use last sector of Flash.
573583
574584
## [[Servo library]]
575585

FAQ.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Node names list has to be separated by ',' and double quoted (for Windows).
1717

1818
### When using "STLink" upload method on Windows, nothing is happening:
1919

20-
[[/img/Warning-icon.png|alt="Warning"]] _**deprecated since core version > 1.5.0**_
20+
> [!WARNING]
21+
> deprecated since core version higher than 1.5.0
2122
2223
This is probably due to the missing `MSVCR100.dll`.
2324

HardwareTimer-library.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
/vscode-markdown-toc-config -->
1414
<!-- /vscode-markdown-toc -->
1515

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
1718
1819
## 1. <a name='Introduction'></a>Introduction
1920

@@ -29,7 +30,8 @@ __Example__:
2930

3031
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.
3132

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).
3335
3436

3537
## 2. <a name='API'></a>API
@@ -96,7 +98,8 @@ Each timer may provide several channels, nevertheless it is important to underst
9698
9799
`HardwareTimer` is a C++ class, 1st thing to do is to instantiate an object with `TIM` instance as parameter.
98100
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.
100103
101104
__Example__:
102105
```C++
@@ -105,9 +108,11 @@ __Example__:
105108

106109
Then it is possible to configure mode of a channel.
107110

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.
109113
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.
111116
112117
__Example__:
113118
```C++
@@ -145,11 +150,14 @@ typedef enum {
145150
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).
146151

147152

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`.
149155
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.
151158
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]).
153161
154162
__Example__:
155163
```C++
@@ -162,11 +170,14 @@ For __output__ it correspond to period or frequency.
162170
163171
For __input capture__ it is suggested to use max value: 0x10000 to avoid rollover before capture occurs .
164172
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`.
166175
167-
[[/img/Note-icon.png|alt="Note"]] *overflow* is common to all channel.
176+
> [!NOTE]
177+
> *overflow* is common to all channel.
168178
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]).
170181
171182
__Example__:
172183
```C++
@@ -178,9 +189,11 @@ __Example__:
178189

179190
Then it is possible to configure *CaptureCompare* (channel specific CaptureCompare register).
180191

181-
[[/img/Note-icon.png|alt="Note"]] *CaptureCompare* is for one channel only.
192+
> [!NOTE]
193+
> *CaptureCompare* is for one channel only.
182194
183-
[[/img/Note-icon.png|alt="Note"]] *CaptureCompare* range: [0.. 0xFFFF]
195+
> [!NOTE]
196+
> *CaptureCompare* range: [0.. 0xFFFF]
184197
185198
__Example__:
186199
```C++
@@ -204,7 +217,8 @@ __Example__:
204217

205218
It is now time to start timer.
206219

207-
[[/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).
208222
209223
__Example__:
210224
```C++
@@ -252,7 +266,8 @@ Also, to get ride of Interrupt callback:
252266
```C++
253267
detachInterrupt()
254268
```
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)
256271

257272
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
258273
```C++
@@ -306,7 +321,8 @@ Following examples are provided in [STM32Examples](https://github.com/stm32duino
306321
External signal (signal generator for example) should be connected to `D2`.
307322

308323
## 5. <a name='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
310326
311327
*Tone*, *Servo* and *analogwrite* have been updated to use *HardwareTimer*.
312328

Libraries.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ Libraries using basic features like Serial, SPI, I2C,... should be fully compati
1111
* [Third party](#third-party)
1212
* [Tested](#tested)
1313

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)
1516
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:
18-
19-
* http://www.arduinolibraries.info/architectures/stm32
17+
> [!NOTE]
18+
> All dedicated STM32 libraries are available through the "_**Library Manager**_"
19+
> or have a look hereafter to see which one is available:
20+
>
21+
> * http://www.arduinolibraries.info/architectures/stm32
2022
2123
## Built-in (delivered with the core package)
2224

@@ -102,7 +104,9 @@ These libraries are guaranteed to work fine with all NUCLEO boards supported in
102104
* [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:
103105
* [MicroNMEA](https://github.com/stevemarple/MicroNMEA)
104106

105-
[[/img/Note-icon.png|alt="Note"]] In order to perform the firmware upgrade, the following Java application should be used:
107+
> [!NOTE]
108+
> In order to perform the firmware upgrade, the following Java application should be used:
109+
106110
* [Teseo-LIV3F-Flash-Updater](https://github.com/stm32duino/Teseo-LIV3F-Flash-Updater)
107111

108112
* [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

Comments
 (0)