简体   繁体   中英

is there a shell command can change SPI clock for raspberry pi zero?

I would like to write a bash file to light up an OLED screen with SSD1306 driver, with below code I can send the SPI commands to the screen but seems the CLK is supper fast so the SSD1306 doesn't work, is there a way to change the SCLK for SPI interface(like set to 4Mhz) in the shell? I am using Raspberry Pi Zero W.

echo -ne $cmd > /dev/spidev0.0

You can try the following for 3.9MHz:

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

Table for different speed deviders you can find here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM