How to use DCX SPI configuration in Zephyr !?

I successful use SPI by Zepher, I want communication with LCD Display but cant use SPI Data/Command option GPIO for config LCD !

zephyr,gc9a01.yaml

description: My spi device binding
compatible: "zephyr,gc9a01"
include: spi-device.yaml

.overlay

&spi1 {
    cs-gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
    gc9a01:gc9a01@0 {
        compatible = "zephyr,gc9a01";
        reg = < 0 >;
        spi-max-frequency=<30000000>;
        label = "gc9a01";
    };
};

send data:

spi_write_dt(&gc9a01,&spi_buffer_tx_set);

I read the datasheet of nrf52840 & i found D/CX SPI configuration!

How i must use that in Zephyr and how must i config GPIO for that??

Parents Reply
  • Thanks, it helped a lot.

    in that sample, for control D/C pin of LCD Was used normal GPIO set/reset fanctions.

    Since the related functions are not implemented, I think that using register values can help. Something similar to this:

    // D/Cx Control
    NRF_SPIM1->DCXCNT=0; //0x0-0xf
    NRF_SPIM1->PSELDCX=(4<<0)|(0<<5)|(0<<31);//P0.4 Connect

    But in the first attempt, the system restarts!!

    Thanks for the help, I will probably look into this more in the future.

Children
Related