Thank you for your help.
I ask you a very basic question.
1. Use "SDK_2.6.0_MKE04Z128xxx4" for SPI communication.
When writing to the SPI device, set CS = L, write the register address or command, and send the data to be written next. This can be done with "SPI_MasterTransferNonBlocking".
When reading out, use "SPI_MasterTransferNonBlocking", write the register address and command, and then read out. At that time, for example, output 0 as a dummy and adopt the data input simultaneously with that clock. What?
2. If you have typical samples for writing and reading, please let us know.
Thank you.
Solved! Go to Solution.
Hi jun,
SPI interface write and read data at same time. If you want to read a byte, you must write a dummy byte to data port. This can make SPI interface send spi clock.
KE04 SDK hasn't SPI polling example. You can refer to KL25 SDK. It has SPI polling example. There SPI module is very similar. You can also download KE04 driver library form https://www.nxp.com/webapp/Download?colCode=FRDM-KEXX-Driver-Library-Package&appType=license&locatio...
This library operate register directly. You can understand SPI quickly.
Regards,
Jing
Hi jun,
SPI interface write and read data at same time. If you want to read a byte, you must write a dummy byte to data port. This can make SPI interface send spi clock.
KE04 SDK hasn't SPI polling example. You can refer to KL25 SDK. It has SPI polling example. There SPI module is very similar. You can also download KE04 driver library form https://www.nxp.com/webapp/Download?colCode=FRDM-KEXX-Driver-Library-Package&appType=license&locatio...
This library operate register directly. You can understand SPI quickly.
Regards,
Jing
Hi.
I am always grateful for your help.
I understand the clock.
Thank you for the source code for register direct access.
This is certainly a quick understanding of the SPI module.
jun