How to get current spi configuration and change it on the fly?

How to get current spi configuration and change it on the fly?
I have spi display and sd card? which use the same pin, but due unknown purposes they can`t work together.
My goal is to use two spi configuration and swap them when I need.
I defined spi pins in YML config file. But after sd card initialization display stop work.