Do you mean you want to switch between SPI and I2C interface during operation?
if you want to achieve this, the sensor VDD and VDDIO should connect to the GPIO pin also.
Because the interface selection is done automatically when sensor is power on.
In your current setup, when sensor power on, it might be run in to SPI or I2C because the level of CSB pin is uncontroled.
If you want to connect sensor to GPIO, please make sure those pin have enough driving power.
... View more