bitbang-hal
bitbang-hal copied to clipboard
Implements embedded-hal traits by bitbanging
The changes seemed straight-forward. I have not tested this in hardware, though.
In order to guarantee the width of the start bit in a serial transfer we need ot make sure that we are waiting for the correct amount of time. Since...
- Serial read works now Timings are fixed and have been tested to work from 300 baud to 115200 baud. - Read with timeout (try_read()) A convenience function - now...
The dependencies are not adapted yet. I needed to adapt this for a different issue so I better contribute it as well.
The serial read appears to be broken. The first issue is that it's loading bits from the LSB - so the final byte will be reversed. It should be loading...
Clock stretching tends to be a failure case for a lot of hal implementations. It would be cool if this library supported controlling clock stretching timeouts as master or allowed...
It looks like there's a new [DelayNs trait](https://docs.rs/embedded-hal/latest/embedded_hal/delay/trait.DelayNs.html) that could work as a replacement for embedded-hal 0.2's `CountDown + Periodic`
https://github.com/sajattack/bitbang-hal/blob/6631f50b49c397cda277b8314a048c995adfe7f8/src/spi.rs#L120 This line is unsound. Creating an invalid timer is UB itself, even if the value is never used. The timer could contain types which the zero valued is invalid,...