Multiple SPI and I2C and UART ports on the STM32

Hi there,
I have a project where I need to make a rc remote transmitter using the STM32F103C8T6 and the NRF24L01. At first, I connected the NRF24L01's SPI pins to the pins PA5 PA6 PA7 wich appears to be the STM32's main SPI pins, but then I realized that those pins are also ADC inputs that I need to use, so I thought about switching the NRF module to the SPI2 (PB13 PB14 PB15), but how to do that in my code in the the Arduino IDE since the NRF24L01 library automatically uses the main SPI port and I believe does not have any command to choose the SPI port ?

Also, I need to have an I2C OLED display and a MPU6050 wich also uses an I2C communication, so I wanted to have the display connected to the I2C1 (PB6 PB7) and the IMU to I2C2 (PB10 PB11). How to do that ?

Here is the pinout that I'm using to choose the pins to use :

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.