AnsweredAssumed Answered

MQX 4.2: slave spi read-write doesn't work

Question asked by Mark Kalior on Sep 30, 2015
Latest reply on Mar 5, 2018 by CSMG Sarma

K20

MQX 4.2

8 bit data

SLAVE SPI

 

spifd = fopen("spi1:1",(void*)SPI_FLAG_FULL_DUPLEX);

ioctrl(spifd,IOCTL_SPI_SET_TRANSFER_MODE, SPI_DEVICE_SLAVE_MODE);

 

rw.BUFFER_LENGH = 6;

rw.WRITE_BUFFER = (char *)send_buffer;

rw.READ_BUFFER = (char *)receive_buffer;

 

ioctl(spifd, IOCTL_SPI_READ_WRITE, &rw); -> _io_ioctl(..) -> _io_spi_ioctl(..) -> _io_spi_read_write(..) ->_dspi_dma_setparam(..)

 

_dspi_dma_setparam(...):

....

if ((params->ATT & SPI_ATTR_TRANSFER_MODE_MASK != SPI_ATTR_MASTER_MODE)

     return SPI_ERROR_TRANSFER_MODE_INVALID;   <---  I get here.

 

Question:

1) Does MQX 4.2 support slave SPI dma transfers?   if so, how?

2) Does "_io_spi_read_write(...) support slave DMA transfer?

3) Why doesn't  "_dspi_dma_setparam(..)" support slave mode transfers?

Outcomes