imxrt-rs / imxrt-hal

Rust for NXP i.MX RT
Apache License 2.0
122 stars 29 forks source link

LPSPI sampling configuration API #135

Closed dstric-aqueduct closed 1 year ago

dstric-aqueduct commented 1 year ago

Expose a public method to allow users to change the sampling point of an LPSPI peripheral.

I've experienced RX FIFO overruns when the SAMPLE: SAMPLE_1 (delayed edge) is used with non-hardware controlled chip select pins (ie, manually driving a CS pin with GPIO embedded_hal traits). Changing this configuration setting to SAMPLE_0 fixed the issue.

Tested on a Teensy 4.0 and 4.1 with a Trinamic TMC5130 stepper driver IC.

When using CS0 (pin 10 on Teensy 4.X), the SAMPLE_1 setting works fine. When using pin 4, the SAMPLE_0 must be used to avoid overruns. I'm curious if anyone else has experienced this issue.

dstric-aqueduct commented 1 year ago

Moved method to Disabled in 38b7398.

dstric-aqueduct commented 1 year ago

Whoops - accidentally closed when responding - Ian, can you reopen?

mciantyre commented 1 year ago

I squashed these commits, added a changelog entry, and merged. If there's any follow-on work between the close and now, we can discuss in a new PR.