pixelslinger icon indicating copy to clipboard operation
pixelslinger copied to clipboard

Need to set SPI clock speed

Open longears opened this issue 12 years ago • 1 comments

Right now we're not setting the SPI clock speed.

Here is demo code doing it in C: https://github.com/zestyping/openpixelcontrol/blob/master/src/spi.c#L58

We need to reproduce this in Go.

Because we don't have this, controlling pixels from a Beaglebone will result in noisy flickering.

A temporary workaround is to run the linked C code once at boot, which will set the SPI clock speed until the next boot.

longears avatar Jul 31 '13 04:07 longears

It's possible according to the syscall package docs: http://golang.org/pkg/syscall/ Something like x,y,z = syscall.Syscall(SYS_IOCTL, SPI_IOC_WR_MAX_SPEED_HZ, uinptr(speed)); might do the trick.

fragmede avatar Jul 31 '13 19:07 fragmede