Hello,
I’m looking for an SPI example.
The one provided in the link below is incomplete…
wiringX is a library that allows developers to control the GPIO of various platforms with generic and uniform functions. By using wiringX, the same code will run on all platforms supported by wiringX, natively.
It is saying that there is a SPI communication example provided.
//Here is an example of SPI communication
#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
#include <wiringx.h>
int main(void)
{
int fd_spi;
if(wiringXSetup("duo", NULL) == -1) {
wiringXGC();
return -1;
}
if ((fd_spi = wiringXSPISetup(0, 500000)) <0) {
printf("SPI Setup failed: %d\n", fd_spi);
wiringXGC();
return -1;
}
//**TODO**
}
tinnu
January 27, 2024, 1:34pm
2
may be you can try to use spi in user type driver.
I use it to handle the tft-spi module :this the tips
1 Like
That looks nice, but it is made in go language. I will need some example in c or c++.
tinnu
January 29, 2024, 11:52am
4
It’s made in C, may be the translation makes you confused. it use the “/dev/spidev0.0” file that is a classical way for linux to operate spi. you can also find some example in github, it’s no limit to cv1800b, totally different from the wiringX library, many embedded linux examples use it.
1 Like
well I was clicking the wrong link… and not this one https://jihulab.com/tinnu/mpu_cv18xx_lvgl_demo