Skip to content

default pins for SPI, I²C, Serial #1819

Closed Answered by fpistm
PerennialNovice asked this question in Q&A
Discussion options

You must be logged in to vote

In the wiki, for Hardwareserial it says that when creating a new serial instance, the first pin in pinmap corresponding to that serial port is chosen.

Yes if you only provide the peripheral instance name.

Does this also apply to additional SPI and I²C instances, or is it mandatory to specify them upon creation?

Yes, same if you specify instance name.

Where are the pins for the default SPI and I²C defined?

If they are not defined in the variant_*.h then it uses the default one which are specified here:

https://github.com/stm32duino/Arduino_Core_STM32/blob/main/cores/arduino/pins_arduino.h#L43-L84

I checked for Nucleo-L4R5 and the "first found" rule does not apply to I²C SDA and SCLK…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fpistm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants