| ... | ... | @@ -58,6 +58,17 @@ somePin.mode(Mode::ALTERNATE); |
|
|
|
somePin.alternateFunction(5);
|
|
|
|
```
|
|
|
|
|
|
|
|
> :warning: **WARNING: when configuring GPIOs you should disable interrupts to avoid concurrent calls to *mode()* (for example if it is done at runtime). This can be done since pins configuration is a very fast operation, but it should in general be avoided, in order not to compromise real-time capabilities of Miosix. A normal mutex would introduce more overhead.**
|
|
|
|
> ```cpp
|
|
|
|
> void someFunction()
|
|
|
|
> {
|
|
|
|
> {
|
|
|
|
> FastInterruptDisableLock dLock; // disable interrupts
|
|
|
|
> somePin::mode(Mode::OUTPUT);
|
|
|
|
> } // dLock scope ends: re-enable interrupts
|
|
|
|
> }
|
|
|
|
> ```
|
|
|
|
|
|
|
|
### Discovery Board Pins
|
|
|
|
These are some commonly used pins that you'll need when writing software for **Discovery boards**.
|
|
|
|
|
| ... | ... | |