Currently (after https://github.com/stm32-rs/bxcan/pull/37), users have to perform 2 steps to use bxCAN: Call Can::new, then call Can::modify_config. The rest is very hard to forget because of #[must_use] on CanConfig.
We could reduce this to 1 step by replacing Can::new by Can::builder, and have that return a CanBuilder that functions similar to CanConfig, but gives you a Can instance when finished.
Would be really nice to implement timing configuration without involving raw numbers. CAN controller frequency can probably be provided by HALs and time quantas by user.
Currently (after https://github.com/stm32-rs/bxcan/pull/37), users have to perform 2 steps to use bxCAN: Call
Can::new
, then callCan::modify_config
. The rest is very hard to forget because of#[must_use]
onCanConfig
.We could reduce this to 1 step by replacing
Can::new
byCan::builder
, and have that return aCanBuilder
that functions similar toCanConfig
, but gives you aCan
instance when finished.