How to access SPI as a generic device on nRF52?

Hello

I would like to use the SPI to communicate with an IC without having a software driver.

I have the following device tree:

&spi2 {
compatible = "nordic,nrf-spi";
pinctrl-0 = <&spi2_default>;
pinctrl-1 = <&spi2_sleep>;
pinctrl-names = "default", "sleep";
clock-frequency = <6000000>;
cs-gpios = <&gpio0 19 GPIO_ACTIVE_LOW>, <&gpio0 23 GPIO_ACTIVE_LOW>;
status = "okay";
ad4695: ad4695@0 {
compatible = "spi-device";
reg = <0>;
spi-max-frequency = <6000000>;
duplex = <0>;
frame-format = <0>;
};
};
On the prj.conf file I add : 
CONFIG_SPI=y
On the C code I have the following lines:
#define SPI_OP SPI_OP_MODE_MASTER |SPI_MODE_CPOL | SPI_MODE_CPHA | SPI_WORD_SET(8) | SPI_LINES_SINGLE
const struct spi_dt_spec spi_dev = SPI_DT_SPEC_GET(DT_NODELABEL(ad4695), SPI_OP, 0);
I get following error on the SPI_DT_SPEC_GET(..) 
Could you please let me know on how I can use the SPI as a generic device? Is there anything wrong with the code?
Thank you in advance!
Parents Reply Children
No Data
Related