This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf9160 SPI

Dear Sir,

Moving to zephyr new installation 1.4.99

Configure SPI1,SPI3 .  I can see the SPI configured in zephyr.dts 

spi3: spi@b000 {
#address-cells = < 0x1 >;
#size-cells = < 0x0 >;
reg = < 0xb000 0x1000 >;
interrupts = < 0xb 0x1 >;
status = "okay";
label = "SPI_3";
compatible = "nordic,nrf-spim";
sck-pin = < 0x1f >;
mosi-pin = < 0x9 >;
miso-pin = < 0x1e >;
cs-gpios = < &gpio0 0x1a 0x0 >, < &gpio0 0xf 0x1 >;
};

spi1: spi@9000 {
#address-cells = < 0x1 >;
#size-cells = < 0x0 >;
reg = < 0x9000 0x1000 >;
interrupts = < 0x9 0x1 >;
status = "okay";
label = "SPI_1";
compatible = "nordic,nrf-spim";
sck-pin = < 0x3 >;
mosi-pin = < 0x8 >;
miso-pin = < 0x5 >;
cs-gpios = < &gpio0 0x4 0x1 >;
};

However the routine  returns false

int spi_init3(void)
{
const char* const spiName3 = "SPI_3";

spi_dev3 = device_get_binding(spiName3);

if (spi_dev3 == NULL) {
printk("Could not get %s device\r\n", spiName3);
return 0;
}
else
{
printk("device %s is configured\r\n", spiName3);
return 1;
}
}  

Please Advise .

Thansk

Parents Reply Children
Related