Hi,
is there a possibility to use on Maple Mini SPI2 on the SPI- or Ethernet library?
I don't find any way at the SPI- or Ethernet library, how I can specify that I want use SPI2
Thank you
Ralf
use of SPI2 on SPI- or Ethernet lib
Re: use of SPI2 on SPI- or Ethernet lib
With this it works with the pins of SPI2
When I try this
I become on the Arduino IDE the follow Errors
I want use cc1101 Modules on SPI2 and a W5500 Lan Modul on SPI1
My sketch should work too on an existing hardware with the cc1101 Modules on SPI1 and the Lan Modul on SPI2.
Ist there a a possibility to use the W5500 Lan Modul on SPI2?
Code: Select all
#define csPin 31
#define mosiPin 28 // MOSI out
#define misoPin 29 // MISO in
#define sckPin 30 // SCLK out
SPI.setMISO(misoPin);
SPI.setMOSI(mosiPin);
SPI.setSCLK(sckPin);
SPI.begin(); //Initialize the SPI port.
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0);
SPI.setClockDivider(SPI_CLOCK_DIV16); // Slow speed (72 / 4 = 4.5 MHz SPI speed)
Code: Select all
#include <SPI.h>
SPIClass SPI2(mosiPin, misoPin, sckPin);
Code: Select all
/home/ralf/.arduino15/packages/STM32/hardware/stm32/1.8.0/system/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:654:43: error: expected ')' before '*' token
654 | #define SPI2 ((SPI_TypeDef *)SPI2_BASE)
| ~ ^
sketch/cc1101.h:18:11: note: in expansion of macro 'SPI2'
18 | SPIClass SPI2(mosiPin, misoPin, sckPin);
| ^~~~
/home/ralf/.arduino15/packages/STM32/hardware/stm32/1.8.0/system/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:654:43: error: expected ')' before '*' token
654 | #define SPI2 ((SPI_TypeDef *)SPI2_BASE)
| ~ ^
sketch/cc1101.h:18:11: note: in expansion of macro 'SPI2'
18 | SPIClass SPI2(mosiPin, misoPin, sckPin);
| ^~~~
My sketch should work too on an existing hardware with the cc1101 Modules on SPI1 and the Lan Modul on SPI2.
Ist there a a possibility to use the W5500 Lan Modul on SPI2?
Re: use of SPI2 on SPI- or Ethernet lib
You couldn't call your SPI2 instance SPI2 because it is a CMSIS definition.
So call it SPI_2 for example.
So call it SPI_2 for example.