Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18915

Re: Using The SPI Port Without the mraa Library Problems

$
0
0

I gave that code a run and I too see that there is only one byte being chucked out. ( In my pic I have MOSI and MISO in a loop for fun(?))

just-one.png

Whilst on the Raspberry Pi, it does indeed work fine

rasp.png

This highlights an issue with the spi device on the Edison. I will have a deeper investigation to find what is going wrong.

 

But for something for now, that may or not help you.

The typical behaviour that mraa currently has is to put multiple data into one transfer. I tweaked the function you posted.

struct spi_ioc_transfer spi;

spi.tx_buf = (unsigned long) data;
spi.rx_buf = (unsigned long) data;
spi.len           = length;
spi.delay_usecs   = 0 ;
spi.speed_hz      = this->speed ;
spi.bits_per_word = this->bitsPerWord ;
spi.cs_change = 0;

retVal = ioctl (this->spifd, SPI_IOC_MESSAGE(1), &spi);

 

Doing so gets all three bytes out on the bus. But it is seen as three transactions, not what is wanted. I currently don't have a solution that works with the current spi dev

three.png


Viewing all articles
Browse latest Browse all 18915

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>