diff --git a/mcan/CHANGELOG.md b/mcan/CHANGELOG.md index 7f6bbdc..cf04144 100644 --- a/mcan/CHANGELOG.md +++ b/mcan/CHANGELOG.md @@ -5,6 +5,7 @@ Tagging in git follows a pattern: `mcan/`. ## [Unreleased] - *Breaking* Update the register mappings with svd2rust 0.30.2 and form 0.10.0 (#46) - Add safe way to shutdown the bus when actively transmitting/receiving (#45) +- Add method to finalize configuration into initialization mode (#47) ## [0.4.0] - 2023-10-24 diff --git a/mcan/src/bus.rs b/mcan/src/bus.rs index c60ddf2..f366ac1 100644 --- a/mcan/src/bus.rs +++ b/mcan/src/bus.rs @@ -575,6 +575,16 @@ impl<'a, Id: mcan_core::CanId, D: mcan_core::Dependencies, C: Capacities> Ok(can) } + /// Locks the configuration and enters initialization mode. + pub fn finalize_initialized(mut self) -> Result, ConfigurationError> { + self.apply_configuration()?; + + let can = self.0; + can.aux.initialization_mode(); + + Ok(can) + } + /// Locks the configuration and enters normal operation. pub fn finalize(mut self) -> Result, ConfigurationError> { self.apply_configuration()?;