Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

How do I use SPI?

26

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
26
Posted at 2/9/2015 12:29:27      1#

How do I use SPI?

hello

------test source-----------

device="/dev/spi_misc_test";

fd = open(device, O_RDWR);
if (fd < 0)
  pabort("can't open device");

/*
  * spi mode
  */
ret = ioctl(fd, SPI_IOC_WR_MODE, &mode);
if (ret == -1)
  pabort("can't set spi mode");

-----------------------------------

however  error abort.


How do I use SPI?

Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list