stm32-rs / bxcan

bxCAN peripheral driver for STM32 chips

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Can::builder`

jonas-schievink opened this issue · comments

Currently (after #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.