| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Usage example: PinNamepin_rx = pinmap_pin(USART1, PinMap_UART_RX); PinNamepin_tx = pinmap_pin(USART1, PinMap_UART_TX); Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
Previously Serialx instance was defined by the variant. It was not enough generic and flexible. With this patch, all available Serialx instance are handled dynamically. Where 'x' is the U(S)ART number. Currently, STM32 MCU could have 9 U(S)ART. Serial is the generic name used in Arduino sketches. Serial is now mapped to the Serialx instance linked to the com port in the variant.h (mainly one linked to ST-Link) Moreover this will simplify USB integration to map the SerialUSB. Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
When Serialx instanciation, check if it is the generic 'Serial' then set Rx/Tx pins if defined else get the pins of the first peripheral occurence in PinMap Anyway, Rx/Tx pins could be changed later using Serialx.setRx/setTx methods before call the Serialx.begin() Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
By default, UART_DEBUG is linked to Serial generic instance. So it is not required to define it. It could be redefined in the variant.h to print on another instance than Serial Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
As HardwareSerial is no more used in variant, use pins_arduino.h instead of Arduino.h Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
Signed-off-by: fpr <fabien.perroquin@wi6labs.com> Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
There was a problem hiding this comment.
I tested on some boards and that seems to be OK.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Previously Serialx instance was defined by the variant.
It was not enough generic and flexible.
With this patch, all available Serialx instance are handled dynamically.
Where 'x' is the U(S)ART number.
Currently, STM32 MCU could have up to 10 U(S)ART.
Serial is the generic name used in Arduino sketches.
Serial is now mapped to the Serialx instance linked to the com port in the variant.h (mainly one linked to ST-Link).
To define the generic Serial, define this in variant.h:
Moreover this will simplify USB integration to map the SerialUSB as Serial.
Menu has been review, 4 options:
Generic Serial (default): only the Serialx instance linked to the com port is available.
No Serial: Serial is disabled (useful for sketch which not use Serial)
Fisrt third: Instanciate the first third Serial instance (USART1 to 3)
All: Instantiate all available U(S)ART (up to 10)
SerialxEvent() are weak and could be redefined by the user at sketch level.
Depends of #121
Fixed #113