-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Describe the bug
According to the documentation for spi.Port.Connect(), 0
is a valid value to use for specifying SPI speed:
...Use 0 for f if there is no known maximum value for this device...
However, I instead receive an error when providing 0
:
panic: sysfs-spi: invalid speed 0Hz; minimum supported clock is 100Hz; did you forget to multiply by physic.MegaHertz?
To Reproduce
Steps to reproduce the behavior:
- Enter program
package main
import (
"periph.io/x/host/v3"
"periph.io/x/conn/v3/spi/spireg"
)
func main() {
host.Init()
p, err := spireg.Open("0")
if err != nil {
panic(err)
}
defer p.Close()
c, err := p.Connect(0, spi.Mode0, 8)
if err != nil {
panic(err)
}
}
- Run it.
- See error
Expected behavior
No error, and the connection to the SPI device succeeds.
Platform (please complete the following information):
- OS: Raspbian GNU/Linux 12 with armv7l kernel
- Board: Raspberry Pi Zero 2W
Additional thoughts
Perhaps if this is not intended to be supported behavior, the documentation should be updated to remove the 0
option.
Metadata
Metadata
Assignees
Labels
No labels