lpspi component Master configuration

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

lpspi component Master configuration

1,448 次查看
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,344 次查看
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,344 次查看
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,344 次查看
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 项奖励