digitalWrite SPI MOSI pin while SPI is enabled

I've encountered a problem where my digitalWrite(MOSI_pin) commans are ignored when SPI is open. Are there any ways to enable the pin anyway?

I think you need:

SPI.end;
pinMode(pin11, INPUT/OUTPUT);

otherwise the pin is not under your direct control.

Thank you, I can not believe I did not thought about disabling SPI just before accessing the pin and enabling it back right afterwards.