lpspi component Master configuration

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

lpspi component Master configuration

1,485件の閲覧回数
dearwww2000
Contributor I

When I run example 'lpspi_transfer_s32k118' project , transfer one byte, will product twice interrupts 'void LPSPI0_IRQHandler(void)'.

Question : How to send byte in main-loop, and receive SPI data in ISR 'void LPSPI0_IRQHandler(void)'?

(purpose : only once go to ISR.)

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

1,381件の閲覧回数
jorge_a_vazquez
NXP Employee
NXP Employee

Hi 王 从伟

The SDK example uses the LPSPI_DRV_MasterTransferBlocking API function, this will set the interrupt mode for the transmission and the reception, these represent two interruptions. If you want to trigger only one time the interruptions when you send, you could set NULL the reception buffer:

LPSPI_DRV_MasterTransferBlocking(SEND, &masterDataSend, NULL, BUFFER_SIZE, TIMEOUT);

But if you pass null, the received bytes are ignored.

Hope this helps

Best regards

Jorge Alcala

0 件の賞賛

1,381件の閲覧回数
dearwww2000
Contributor I

Dear Jorge Antonio Alcala Vazquez

I need only reception interrupt to get the slave-chip response word.

So I don't need send word interrupt.

But I can't known how to do ?

0 件の賞賛

1,381件の閲覧回数
jorge_a_vazquez
NXP Employee
NXP Employee

Hi 王 从伟

Similar as only sending, you can only receive, but you have to pass NULL to the parameter of sendBuffer.

LPSPI_DRV_MasterTransferBlocking(SEND, NULL, &masterDataReceive, BUFFER_SIZE, TIMEOUT);

Hope this helps

Best regards

Jorge Alcala

0 件の賞賛