nrf52840 with NOR memory

https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/drivers/spi_flash/src/main.c#L36

may I know where I can find the pin connections used in this example 

"const struct device *flash_dev = DEVICE_DT_GET_ONE(SPI_FLASH_COMPAT);" 

#if DT_HAS_COMPAT_STATUS_OKAY(jedec_spi_nor)
#define SPI_FLASH_COMPAT jedec_spi_nor

I checked jedec yaml file but no pins is defined there as well 

Parents Reply
  • #define SPIOP SPI_WORD_SET(8) | SPI_TRANSFER_MSB

    struct spi_dt_spec spispec = SPI_DT_SPEC_GET(DT_NODELABEL(w25m02g), SPIOP, 0);

    const struct device *spi_dev = DEVICE_DT_GET(DT_NODELABEL(spi1));

    &spi1 {
        compatible = "nordic,nrf-spim";
        status = "okay";
        pinctrl-0 = <&spi1_default>;
        pinctrl-1 = <&spi1_sleep>;
        pinctrl-names = "default", "sleep";
        cs-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
    
        w25m02g: w25m02g@0 {
            compatible = "winbond,w25m02g";
            reg = <0>;
            spi-max-frequency = <80000000>;
            size = <2147483648>;
            wp-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
            hold-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
        };
    };

    May I ask if the SPI_DT_SPEC_GET and DEVICE_DT_GET can change with each other? Are they serving the same purpose? 

    Can both work with spi_transceive?  how about flash_write? 

Children
No Data
Related