OK, I know this is Teensy forum but I looked in SPI.cpp build for Teensy and it includes reassigning of SPI pins.
So I figure users of this forum know something about the subject.
Unfortunately mentioned SPI.cpp covers only AVR method of reassigning the SPI pins.
It does that by accessing SPI control register - SPICR.
Not so simple in ARM / SAM.
Apparently someone put into standard, Arduino version of SPI this piece of code to do something ,
the code is not commented, perhaps it does what I am after.
I have not found any source code / application using this code .
I could use some assistance in deciphering / implementing this code if it actually modifies standard SPI pins assignments on Due.
And if my request is really out of this forum interests, just ignore it.
Thanks
Vaclav
So I figure users of this forum know something about the subject.
Unfortunately mentioned SPI.cpp covers only AVR method of reassigning the SPI pins.
It does that by accessing SPI control register - SPICR.
Not so simple in ARM / SAM.
Apparently someone put into standard, Arduino version of SPI this piece of code to do something ,
the code is not commented, perhaps it does what I am after.
Code:
* #if SPI_INTERFACES_COUNT > 0
static void SPI_0_Init(void) {
PIO_Configure(
g_APinDescription[PIN_SPI_MOSI].pPort,
g_APinDescription[PIN_SPI_MOSI].ulPinType,
g_APinDescription[PIN_SPI_MOSI].ulPin,
g_APinDescription[PIN_SPI_MOSI].ulPinConfiguration);
PIO_Configure(
g_APinDescription[PIN_SPI_MISO].pPort,
g_APinDescription[PIN_SPI_MISO].ulPinType,
g_APinDescription[PIN_SPI_MISO].ulPin,
g_APinDescription[PIN_SPI_MISO].ulPinConfiguration);
PIO_Configure(
g_APinDescription[PIN_SPI_SCK].pPort,
g_APinDescription[PIN_SPI_SCK].ulPinType,
g_APinDescription[PIN_SPI_SCK].ulPin,
g_APinDescription[PIN_SPI_SCK].ulPinConfiguration);
}
SPIClass SPI(SPI_INTERFACE, SPI_INTERFACE_ID, SPI_0_Init);
#endif
I have not found any source code / application using this code .
I could use some assistance in deciphering / implementing this code if it actually modifies standard SPI pins assignments on Due.
And if my request is really out of this forum interests, just ignore it.
Thanks
Vaclav