SPI
Jeffrey Lee (213) 6048 posts |
Anyone working on, or thinking of working on, an SPI bus/manager API? It’s something I’ll be needing to sort out in the next few months for the TouchBook & Pandora touchscreen, and Pandora LCD brightness/contrast/gamma. |
Theo Markettos (89) 919 posts |
Not as such… but I have some hardware I’m planning that makes heavy use of SPI on the RPi. Target application is Linux, but it would be fun (if somewhat pointless) if it was usable in RISC OS too. |
Jeffrey Lee (213) 6048 posts |
After looking at the OMAP & BCM TRMs, I’m thinking the SPI API should roughly be as follows:
Can anyone spot anything that I’ve missed? (Apart from slave mode, which I’m ignoring for the moment – unless someone needs it for something?) |
Rick Murray (539) 13850 posts |
I think that will be a friendlier way to handle things. With SPI, what concerns me is something probably out of the remit of RISC OS to do much about:
It seems there are a billion different types of SPI with no formal “definition” (one could say that JTAG behaves in a manner similar to SPI). I’m not so much worried about the RISC OS API, which – by the way – looks about right, as I am worried about the poor sod that needs to communicate with SPI! ;-) |
Jeffrey Lee (213) 6048 posts |
I think there’s a bit of extra functionality the SPI manager will need – the ability to gain exclusive access to the bus for a series of operations. Initially I was thinking the “keep chip select enabled at end of transfer” flag would be all that would be necessary for this, but that wouldn’t allow you to keep exclusive access if the chip you’re talking to needs the chip select to disable between transfers. |
Rien (223) 10 posts |
SPI interface should be enabled too, Although that might have to be done before starting the SPI module? |
Rien (223) 10 posts |
DOUT Hold time if needed? |
Kim Faulkner (84) 30 posts |
It has been a while since this thread was updated but I just wondered whether there was any behind-the-scenes progress on this topic please. |
Bill Antonia (2466) 130 posts |
Not quite to the ambitions earlier in the thread and limited to the Raspberry Pi, I wrote a module to communicate to SPI chips. Not sure if this is any use but feel free to us: PiSPI |
John Ballance (21) 85 posts |
I have now started work on a SPIDriver module. An initial HALDevice for spi has been added to kernel.HDR, though this will be subject to change as further HAL calls are created. I am mindful of Jeffrey’s post above, but would appreciate any further suggestions/requests. The iMx6 HAL is the HAL I’m doing this with, though the driver will be within the main ROOL CVS. |
John Ballance (21) 85 posts |
One feature I’ll be adding is the capability to request/reserve additional Chip select lines from a subset of ‘available’ GPIO lines. Logic behind this is iMx6 SPIO has 2 built in CS lines. The connector bringing this out also has 8 GPIO lines, any or all of which could usefully be incorporated as CS lines. |
Chris Evans (457) 1614 posts |
Are you/could you base it on Bill Antonia’s work? I hate to see duplicated effort! |
Chris Hall (132) 3558 posts |
The iMx6 HAL is the HAL I’m doing this with, though the driver will be within the main ROOL CVS. I should like to interface a PaPiRus (electronic ink display) to a Pi Zero. Do we have a SPI driver for the Pi yet please? |
Raik (463) 2061 posts |
Is there a solution to use SPI on Omap3 like Pandora or Tochbook? |