Is 170uA really the lowest I can expect?
Welcome in the forum, Jonas!
setting them to analog high impedance, but that seems not like a proper way to do it.
This is the proper way! When in deep sleep the pins output states are still maintained (could be to prevent the 30t crane to move)
SPI_Sleep() just saves the current state of the component, so that it can be restored when woken up. Setting the pins to an appropriate state (in your case hi-z) is your task to do.
Excellent! I was not sure about that because your code takes great care of pin configuration so far, so I expected that would be included in the SPI code, but it makes more sense this way.
Now where do I find the code which initializes the pins to their default configuration?
I was unable to identify which code is called at start up to setup the IO as configured in .cysch file (or is that part in the bitstream?). So I know which mode to set when I have to use the SPI again. I also looked into the documentation and did not find information about the configuration of the pins.
Use SPI1_miso_m_Sleep() and SPI1_miso_m_Wakeup();, same for mosi. I admit that the documentation is thin here...
Thanks for helping me out!
For anybody having the same problem: Sleep, SetDriveMode & Wakeup did the trick for me.