AnsweredAssumed Answered

The questions about SPI

Question asked by Robin Zou on Nov 10, 2014
Latest reply on Nov 12, 2014 by Radek Sestak

I have read the SPI example in the address.

C:\Freescale\Freescale_MQX_4_1_TWRK64F120M\mqx\examples\spi

 

I have 3 questions:

1, What is the meaning of the parameter “cs_mask” in callback
function “set_CS”? Which parameter is transferred to the parameter “cs_mask” in
this example?

 

2, My SPI application has 1 master and 4 slavers (select
signals:CS0,CS1,CS2,CS3). How to select the slaver?Do I have to select the slaver in the callback
function? If I want to communicate with the slavers one by one, how should Imodify the source code?

 

3,The document < MQX_IO_User_Guide.pdf > Page 63
describes that

“the chip select signals are de-asserted and the bus is
released by execution of either IO_IOCTL_FLUSH_OUTPUT or IO_IOCTL_SPI_FLUSH_DEASSERT_CS command or by closing the file handle with _io_close() call.”

 

If I select the chip in the callback function by myself, are
the chip select signals still de-asserted by execution of either IO_IOCTL_FLUSH_OUTPUT
or IO_IOCTL_SPI_FLUSH_DEASSERT_CS command or by closing the file handle with
_io_close() call?

Outcomes