japaric / stm32f30x-hal

Implementation of the `embedded-hal` traits for STM32F30x microcontrollers
Apache License 2.0
35 stars 37 forks source link

SPI: Clear error flags when detected #14

Open austinglaser opened 6 years ago

austinglaser commented 6 years ago

Closes #13

This implements the first option (automatic clearing errors on detection) discussed in the above issue. It hasn't yet been tested on actual hardware -- I likely won't be able to do so until this weekend.

The biggest stumbling block I see for testing is actually causing the errors. An overrun should be easy to force, and probably a mode fault. I'm not sure how to force a crc error though...

austinglaser commented 6 years ago

Made an update to how the MODF error is cleared to ensure that the exact sequence of register accesses called out in the reference manual is followed

little-arhat commented 6 years ago

Any updates on this?

austinglaser commented 6 years ago

Haven't had a chance to test the changes yet