Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    T113-S3 使用GPIO模拟SPI

    Linux
    4
    7
    4358
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      steve.xu LV 3 last edited by

      使用GPIO模拟SPI接口,Linux 5.4. 按照linux的binding教程配置,但是在系统的/dev目录找不到驱动

      spi_gpio{
      	compatible = "spi-gpio";
      	ranges;
      	pinctrl-0 = <&spi_gpio_pins>;
      	pinctrl-names = "default";
      
      	status = "okay";
      
      	#address-cells = <0x1>;
      	#size-cells = <0x0>;
      
      	sck-gpios = <&pio PD 16 GPIO_ACTIVE_LOW>;
      	miso-gpios = <&pio PD 17 GPIO_ACTIVE_LOW>;
      	mosi-gpios = <&pio PD 18 GPIO_ACTIVE_LOW>;
      	cs-gpios = <&pio PD 19 GPIO_ACTIVE_LOW>;
      	
      	num-chipselects = <1>;
      
      	wavegen@0 {
              compatible = "rohm,dh2228fv";
              spi-max-frequency = <500000>;
              spi-rx-bus-width = <1>;
              spi-tx-bus-width = <1>;
              bits-per-word = <8>;
      		reg = <0>;
      
      		status = "okay";
          };
      };
      
      C whycan 2 Replies Last reply Reply Quote Share 1
      • C
        captain LV 5 @steve.xu last edited by

        @steve-xu
        能看到其它spi的驱动不?

        S 1 Reply Last reply Reply Quote Share 0
        • S
          steve.xu LV 3 @captain last edited by

          @captain 可以看到 系统的spi1.0,cpu的spi

          1 Reply Last reply Reply Quote Share 0
          • whycan
            whycan晕哥 LV 9 @steve.xu last edited by

            @steve-xu

            可以不用SPI模拟, 可以用GPIO片选

            S 1 Reply Last reply Reply Quote Share 0
            • S
              steve.xu LV 3 @whycan last edited by

              @whycan SPI 模拟的,实际测试了一下,clk能到180K左右,主要是用来控制ADC采集,速度达不到,需要2M左右的spi速率

              whycan 1 Reply Last reply Reply Quote Share 0
              • whycan
                whycan晕哥 LV 9 @steve.xu last edited by

                @steve-xu

                那建议 用GPIO片选,这个是基于硬件SPI,速率可以满足你的需求。

                1 Reply Last reply Reply Quote Share 0
                • J
                  Jhogy LV 3 last edited by

                  楼主的问题解决了吗

                  1 Reply Last reply Reply Quote Share 0
                  • 1 / 1
                  • First post
                    Last post

                  Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

                  行为准则 | 用户协议 | 隐私权政策