Can I open multiple file descriptors in MQX 4.0 for an SPI channel in MCF52259?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Can I open multiple file descriptors in MQX 4.0 for an SPI channel in MCF52259?

952 次查看
lumi
Contributor II

Hi,

I'm working with MCF52259 in a bsp/psp modified from the tower board provided.

According to MQXIOUG rev 18, section 9.6 "Using the driver", I should be able to open multiple file handles to the same SPI channel, each using different Chip Selects (CS).

The paragraph reads:

"As described above, the SPI driver may be concurrently used from multiple tasks using multiple file

handles without needing any additional locking or synchronization in the application since the bus

reservation mechanism, internal to the SPI driver, prevents collisions in multitasking environment."

However, when I try something like this:

Task1:

     f1 = fopen("spi0:", NULL);

...and...

Task 2:

     f2 = fopen("spi0:", NULL);

, the second fopen fails. Making f2 equal to NULL.

Am I missing something? How can I really open two file descriptors for the same SPI channel?

Thanks

0 项奖励
回复
1 回复

774 次查看
erikisaksson
Contributor I

Hi,

Same question, but MQX 4.1 for MCF52259.

I get the feeling that legacy SPI driver is still included, since there is both a spi_int and spi_pol...?

BR,

Erik

0 项奖励
回复