AnsweredAssumed Answered

MQX3.8: How to Open SPI Ports for Multiple Slaves

Question asked by Hui Shao on Mar 20, 2015
Latest reply on Mar 26, 2015 by Hui Shao

Hi -

 

I have custom board loaded with MQX3.8 on K20d72m. There are two slave devices on MCU's SPI0 port that are driven by CS0 and CS2. Question is, how can I open/use the shared port for difference devices? In other words, does the SPI driver support multiple open to get file handler, like:

 

fopen("spi0:1", NULL) for CS0 and

fopen("spi0:4", NULL) for CS2 ?

 

Since the device on CS0 is already existing with fopen("spi0:", NULL), do I have to change it to fopen("spi0:1", NULL) to differentiate it with the one on CS2?

 

thanks!

 

Hui

Outcomes