fsl_spi_freertos and different config on spi bus

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

fsl_spi_freertos and different config on spi bus

ソリューションへジャンプ
1,252件の閲覧回数
PO220
Contributor IV

Hi

 

I'm looking fsl_spi_freertos driver but I need confirmation on what I understand...

 

I use on the same SPI bus several devices that do not have the same configuration (bdrate, phase...) and  I need to manipulate these devices from different tasks (I need mutex)

 

 

For me,  SPI_RTOS_Init function create the mutex and set configuration of the bus (with SPI_MasterInit), in the same function ; so I can not change bus configuration without breaking the mutex.

 

Is there a way to manage this or should I change  the SPI_RTOS_Init function to separate mutex creation and configuration of the bus (as I believe) ?

 

Thank you in advance

ラベル(1)
0 件の賞賛
返信
1 解決策
1,037件の閲覧回数
TICS_Fiona
NXP Employee
NXP Employee

Hello PO220

When the same SPI bus is connected with multiple external SPI devices,  and each device is working in different tasks, we can use mutex to ensure only one device is working in the same time.   User can create the mutex in SPI_RTOS_Init function, and lock the mutex when starting a task, unlock it when exist the task. However, when switch the task, the SPI register should be re-configured for the new task. 

Best Regards

Fiona Kuang

TIC - Technical Information Center

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Mark Correct button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,038件の閲覧回数
TICS_Fiona
NXP Employee
NXP Employee

Hello PO220

When the same SPI bus is connected with multiple external SPI devices,  and each device is working in different tasks, we can use mutex to ensure only one device is working in the same time.   User can create the mutex in SPI_RTOS_Init function, and lock the mutex when starting a task, unlock it when exist the task. However, when switch the task, the SPI register should be re-configured for the new task. 

Best Regards

Fiona Kuang

TIC - Technical Information Center

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Mark Correct button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信
1,037件の閲覧回数
PO220
Contributor IV

Thank you

0 件の賞賛
返信