sajattack / bitbang-hal

Implements embedded-hal traits by bitbanging
MIT License
41 stars 11 forks source link

Should we set clock to idle level in SPI::new? #7

Closed twitchyliquid64 closed 5 years ago

twitchyliquid64 commented 5 years ago

In SPI Mode 2 & 3 (CPOL = 1), the idle level is high.

In the current implementation, if the user does not set the clock to HIGH before calling SPI::new(...), the first bit will be lost.

twitchyliquid64 commented 5 years ago

This is something of an RFC. I think we should set the clock pin to the idle level for the user. The user of this library should not need to know implementation details like this.

sajattack commented 5 years ago

Yeah, makes sense to me.