nrf5340 SPI high drive within nRF Connect SDK

Hi,

I can see from other posters that high drive can be enabled via calling the nrf_gpio_cfg() function.

But when using the nRF5340 and the nRF Conenct SDK, the configuration of the SPI is mainly done via the '.conf' and '.overlay' configuration rather than coding. 

This leads me to be unsure as to where to call the nrf_gpio_cfg  function to override the default low drive setting.

I can see a few layers down that high drive is enabled automatically if using QSPI or when running at 32MHz, but I am trying to find the neatest way of forcing this for my use case in my application code, and I don't want my change to be overwritten by the spi intiailzation that is triggered by the .overlay file.

In my overlay file I set

&spi4 {
	compatible = "nordic,nrf-spim";
	status = "okay";
	mosi-pin = <9>;
	miso-pin = <10>;
	sck-pin = <8>;
};

And in my application code I have a struct configured

static const struct spi_config spi_cfg = {
    .operation = SPI_WORD_SET(8) | SPI_TRANSFER_MSB,
    .cs=&spi_cs,
    .frequency = 16000000,
    .slave = 0,
};

Which is passed to the  spi_transceive when I want to send or receive data

Are there any pointers you can give me, as to how and where to change the drive mode?

Related