AnsweredAssumed Answered

Question about 3 SPI Device Control....

Question asked by Kevin Cho on Feb 9, 2010
Latest reply on Jun 25, 2012 by Ardoster

Hello,

 

I'm new and using MQX3.4 & MCF52259.

 

My MCF52259 board has 3 SPI devices which are connected to MCF52259.

each device has their own CHIP Select pin. (QSPI_CS0, QSPI_CS2, QSPI_CS3)

 

My code is based on the mqx/example/spi example from Freescale.

 

There is set_CS() function for controling CS pin.

But, I wondering about that this function really need for me?

Because, all I used pins are default pin.

MQX_IO_Driver_User_Guide described IO_IOCTL_SPI_SET_CS_CALLBACK function

is used for only for MCF51 family.

Is that right?

 

And, one more question...

How to fill the param when using IO_IOCTL_SPI_SET_CS function?

 

param = ????; 

 if(ioctl(spi_fd, IO_IOCTL_SPI_SET_CS, &param) == SPI_OK) {
  printf ("OK\n");
 }
 else {
  printf ("ERROR\n");
 }

 

What's the best way to control 3 SPI devices simultaneously?

Thanks in advance

 

Message Edited by OOLife on 2010-02-09 02:32 PM

Outcomes