Hi,
I'm evaluating FLEXIO as SPI using SDK v3.2.1 on a FRDM-KL27Z. Basically I'd need to solve 2 things:
How can I do to accomplish these points?
regards,
gaston
已解决! 转到解答。
Hi Gaston,
Yes, the FlexIO SPI driver must be modified to invert the clock polarity.
Unfortunately, I don't know if this feature will be implemented in future versions of the SDK.
Regards,
Hello Gaston,
The FlexIO SPI driver doesn't support CPOL=1 (idle high), but as mentioned in the KL27P64M48SF2RM, you can manually change the pin polarity of the timer used for SCK generation to support this:
In FLEXIO_SPI_MasterInit():
/*3. Configure the timer 0 for SCK. */
timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]);
timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow;
timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal;
timerConfig.pinConfig = kFLEXIO_PinConfigOutput;
timerConfig.pinSelect = base->SCKPinIndex;
// timerConfig.pinPolarity = kFLEXIO_PinActiveHigh;
timerConfig.pinPolarity = kFLEXIO_PinActiveLow;
About the CS pin, you can manually change the pin muxing to GPIO instead of the FlexIO so you can manually control it.
Regards,
Gerardo
Hi Gerardo,
Thanks for replying. I assume I have to modify the FlexIO SPI driver in order to change the pin polarity of the timer. Will this feature be implemented in the next SDK version?
regards,
gaston
Hi Gaston,
Yes, the FlexIO SPI driver must be modified to invert the clock polarity.
Unfortunately, I don't know if this feature will be implemented in future versions of the SDK.
Regards,
Please could someone give me some feedback? I thought I could use an extra SPI interface without constraints but I don't know how to do it.
https://community.nxp.com/thread/471557
regards,
gaston