Navigation

    全志在线开发者论坛

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

    请问D1怎么才能通过命令行动态给SPI调速?

    MR Series
    spi调速 spi d1
    3
    4
    1311
    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.
    • U
      ubuntu LV 7 last edited by

      https://stackoverflow.com/questions/57262938/is-there-a-shell-command-can-change-spi-clock-for-raspberry-pi-zero

      echo -ne "\x06\x04" > /sys/class/spi_master/spi0/of_node/spi-max-frequency

      请问D1怎么才能通过命令行动态给SPI调速?

      这里 /sys/class/spi_master/ 下面啥文件也没有:

      root@TinaLinux:/# ls /sys/class/spi_master/
      root@TinaLinux:/#
      
      1 Reply Last reply Reply Quote Share 0
      • M
        memory LV 7 last edited by

        root@TinaLinux:/# hexdump  /sys/firmware/devicetree/base/soc@3000000/spi@4025000
        /spi-nand@0/spi-max-frequency
        0000000 f505 00e1
        0000004
        root@TinaLinux:/#
        

        只找到这个节点,而且只读,不能写。

        1 Reply Last reply Reply Quote Share 0
        • U
          ubuntu LV 7 last edited by

          是呀,我也发现了。

          https://community.toradex.com/t/imx8x-max-frequency-of-spidev/10970

          小飞的也可以重设SPI速率

          1 Reply Last reply Reply Quote Share 0
          • J
            Jingyan LV 5 last edited by

            使用spidev-test测试命令的-s参数可以调整spi速率

            Usage: ./spidev_test [-DsbdlHOLC3vpNR24SI]
              -D --device   device to use (default /dev/spidev1.1)
              -s --speed    max speed (Hz)
              -d --delay    delay (usec)
              -b --bpw      bits per word
              -i --input    input data from a file (e.g. "test.bin")
              -o --output   output data to a file (e.g. "results.bin")
              -l --loop     loopback
              -H --cpha     clock phase
              -O --cpol     clock polarity
              -L --lsb      least significant bit first
              -C --cs-high  chip select active high
              -3 --3wire    SI/SO signals shared
              -v --verbose  Verbose (show tx buffer)
              -p            Send data (e.g. "1234\xde\xad")
              -N --no-cs    no chip select
              -R --ready    slave pulls low to pause
              -2 --dual     dual transfer
              -4 --quad     quad transfer
              -8 --octal    octal transfer
              -S --size     transfer size
              -I --iter     iterations
            
            1 Reply Last reply Reply Quote Share 0
            • 1 / 1
            • First post
              Last post

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

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