Hi,
found some typo and the reason why mi SPI interface was not running with the sample software:
test_spi.cpp:
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <stdio.h>
#include "SpiCtrl.h"
int main(int argc, char *argv[]) {
SpiCtrl spi;
int i,ret;
uint8_t wbuf[20]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
uint8_t rbuf[20]={0,0,0};
//spi
ret=spi.Open("/dev/spidevice1.1",0,1000000); **<-- should be /dev/spidev1.1 instead**
if(ret){
printf("Failed To Turn On The Spi Bus\n");
}else{
printf("If Spi Is Enabled The Read And Write Operations Will Be Synchronized\n");
ret=spi.SPI_FullDuplex(wbuf,rbuf,16);
if(ret){
printf("SPI_FullDuplex Fail\n");
}else{
printf("SPI_FullDuplex Success,Read The Contents:");
for(i=0;i<16;i++)
{
printf("%02X ",rbuf[i]);
}
printf("\n");
}
}
printf("bye\n");
return 0;
}