S32k144 LPSPI

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

S32k144 LPSPI

1,107件の閲覧回数
wanglijun
Contributor II

Hello,

I have a question about LPSPI module in S32DS.

In S32DS code, there is a function: LPSPI_DRV_MasterTransferBlocking, it includes both transmission and reception.

But I just only need transmission or reception.

How to use the function?

@

タグ(3)
0 件の賞賛
3 返答(返信)

982件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

when SPI master transmits a data, SPI slave sends a data back to master at the same time. This is a nature of the SPI interface. So, when you want to only transmit a data by master, you will always receive data from slave. You can just disregard such data. When you want to receive a data from slave, master must send some data to slave, so the slave can send the data back. Solution for this is to send a dummy data to slave.

Regards,

Lukas

0 件の賞賛

982件の閲覧回数
wanglijun
Contributor II

Hello Lukas,

Thank you for the replying!

If I only want to receive the data, how the function should be called?

Additionally, If I want to receive by DMA, which function should be called?

0 件の賞賛

982件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

If you want to receive a data from slave, you need to transmit dummy data (like 0xFF), so the slave can clock out the data.

There's an example lpspi_dma:

c:\NXP\S32DS_ARM_v2.2\S32DS\software\S32SDK_S32K1xx_RTM_3.0.0\examples\S32K144\driver_examples\communication\lpspi_dma\

Regards,

Lukas

0 件の賞賛