Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Aug 2016 05:28:30 +0200
From:      Bernd Walter <ticso@cicely7.cicely.de>
To:        FreeBSD-arm@freebsd.org
Cc:        Bernd Walter <ticso@cicely7.cicely.de>
Subject:   SPI on Raspberry B+
Message-ID:  <20160803032830.GB18406@cicely7.cicely.de>

next in thread | raw e-mail | index | archive | help
I'm currently writing a kernel driver for APA102 LEDs on 11-BETA3.
With some help of older threads on this list I've managed to
get my driver attached and sending data.
However, what I didn't manged yet is setting the SPI parameters.

The SPI mode seems to match fine.

The byte order is unfortunately wrong.
I need MSB first and the driver is sending LSB first.
Of course I could rotate all the bits, but would like to avoid it
for performance reasons.

The clock is only 500kHz according to scope.
I've heared that there is no device specific speed support, but since I'm
not using any other SPI device setting the global speed would be fine.

I'm calling SPIBUS_TRANSFER with multiple bytes.
There is a gap of 2 microseconds between the bytes.
Don't know if it just skipping a full clock cycle and the gap will
be shorter with a higher clockrate, or if the driver really needs
2 full microseconds between each bytes.
I somehow believe (and hope) it is just a full cycle in the controller.

-- 
B.Walter <bernd@bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160803032830.GB18406>