Official Omega2 Hardware SPI driver for C?
-
Hello,
I need to use the HARDWARE SPI in the OMEGA2+ to constantly read A/D data at a very high sample rate from this 8-bit A/D converter chip (the SPI timing diagram for the chip is in this document):
Before i start writing code I just wanted to find out which is the "official" "C" language driver for the HARDWARE SPI in OMEGA2+
I found 2 sources, does anyone know which of these "C" drivers below is the best one, or maybe there is a better one that you know of?
Group 1:
https://www.kernel.org/doc/Documentation/spi/spidev
https://linux-sunxi.org/SPIdev#In_the_user_spaceGroup 2:
https://github.com/torvalds/linux/blob/master/drivers/spi/spi-mt7621.c
-
@nsmith You'll want to use the SPIdev interface for your userspace programs.
I believespi-mt7621
is the hardware specific kernel layer and can't be directly accessed from userspace.EDIT: forgot to mention, spidev definitely works. It's used under the hood in our python-spidev implementation
-
In my opinion, it is
spidev
(package name,kmod-spidev
), as it is the working module on OpenWrt 22.03 build for Omega2.
I could see hardware SPI driver is present under/dev/spi*
after installing it.
Havent tested it yet by myself, though.
-
This post is deleted!