teemuatlut / TMCStepper

MIT License
502 stars 196 forks source link

Use different hardware spi #142

Open mr-miky opened 4 years ago

mr-miky commented 4 years ago

On the board that I designed and uses stm32F4 there are 3 spi hardware. The TMC2130 that I use are connected to a dedicated spi hardware. The TMCStepper library relies on the software spi or the Arduino SPI. What I ask is if it is possible to implement a method to pass the pointer to a SPIClass other than the standard Arduino one.

I currently use a SPIClass * TMC_HW_SPI pointer declared extern and initialized in MarlinCore.cpp. The problem is that I have to patch the TMCStepper library every time a new version is released.

If I want to use the Arduino SPI:

TMC_HW_SPI = & SPI;

if not :

TMC_HW_SPI = new SPIClass (SPI1, TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK);

If there was a method to pass the pointer it would be more portable without changing the library code.

teemuatlut commented 4 years ago

See the upcoming Release_v1 branch. It's still very much alpha stage at this point though.


From: mr-miky notifications@github.com Sent: Saturday, August 1, 2020 4:09:00 PM To: teemuatlut/TMCStepper TMCStepper@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [teemuatlut/TMCStepper] Use different hardware spi (#142)

On the board that I designed and uses stm32F4 there are 3 spi hardware. The TMC2130 that I use are connected to a dedicated spi hardware. The TMCStepper library relies on the software spi or the Arduino SPI. What I ask is if it is possible to implement a method to pass the pointer to a SPIClass other than the standard Arduino one.

I currently use a SPIClass * TMC_HW_SPI pointer declared extern and initialized in MarlinCore.cpp. The problem is that I have to patch the TMCStepper library every time a new version is released.

If I want to use the Arduino SPI:

TMC_HW_SPI = & SPI;

if not :

TMC_HW_SPI = new SPIClass (SPI1, TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK);

If there was a method to pass the pointer it would be more portable without changing the library code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/teemuatlut/TMCStepper/issues/142, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB3HF7RJVRC2MVKIRXCBVRDR6QHWZANCNFSM4PRXM5QQ.

rohan-patel367 commented 6 months ago

Hello, has this been implemented? I am using a teensy 4.1 and would like to utilise SPI1 instead of SPI with a TMC5160. Just wondering if this is possible...