For example of using SPI you can take a look at tests/drivers/spi/spi_loopback. Config for nRF52840 DK is at tests/drivers/spi/spi_loopback/boards/nrf52840_pca10056.conf, also please take a look at boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts for pin configuration.