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?

951件の閲覧回数
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 返信

773件の閲覧回数
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 件の賞賛
返信