can't open a spi device in /dev
I manually insmod spidev(device driver) and spi_bcm2708(controller driver) successfully.
In "/proc/devices" shows the spi major number is 153, I did"mknod /dev/spidev0.0 c 153 0". Trying to test whether I can open the device,which points to spidev module.
I write a simple test program to try to open the deivice, however it failed, the file descriptor is less than 0
Any people know why I can't open a device ?
#include <stdio.h>
#define device "spidev0.0"
void main(int argc,char **argv)
{
int fd = open(device,argv);
if(fd<0)
printf("cant");
}
|