pub fn commit(self) -> Result<(), EI::Error> {
        for (bank, bank_config) in self.banks.iter().enumerate() {
            match bank_config.status() {
                BankConfigStatus::Unchanged => {}
                BankConfigStatus::Overwrite => {
                    self.expander.write_bank_config(bank as u8, *bank_config)?;
                }
                BankConfigStatus::ReadModify => {
                    self.expander
                        .read_modify_bank_config(bank as u8, |cur| bank_config.merge(cur))?;
                }
            }
        }
        if self.expander_config_dirty {
            self.expander.write_config()
        } else {
            Ok(())
        }
    }
/// Commit the configuration changes to the MAX7301. The configurator will attempt to update
/// the device's configuration registers while minimizing bus traffic (avoiding
/// read-modify-writes when possible, not setting registers that were not changed).
Commit the configuration changes to the MAX7301. The configurator will attempt to update
the device's configuration registers while minimizing bus traffic (avoiding
read-modify-writes when possible, not setting registers that were not changed).
Commit the configuration changes to the MAX7301 . The configurator will attempt to update the device ' s configuration registers while minimizing bus traffic ( avoiding read - modify - writes when possible not setting registers that were not changed ) .
pub fn commit(self) -> Result<(), EI::Error> {
        for (bank, bank_config) in self.banks.iter().enumerate() {
            match bank_config.status() {
                BankConfigStatus::Unchanged => {}
                BankConfigStatus::Overwrite => {
                    self.expander.write_bank_config(bank as u8, *bank_config)?;
                }
                BankConfigStatus::ReadModify => {
                    self.expander
                        .read_modify_bank_config(bank as u8, |cur| bank_config.merge(cur))?;
                }
            }
        }
        if self.expander_config_dirty {
            self.expander.write_config()
        } else {
            Ok(())
        }
    }
pub fn commit ( self ) -> Result < ( ) , EI :: Error > { for ( bank , bank_config ) in self . banks . iter ( ) . enumerate ( ) { match bank_config . status ( ) { BankConfigStatus :: Unchanged => { } BankConfigStatus :: Overwrite => { self . expander . write_bank_config ( bank as u8 , * bank_config ) ? ; } BankConfigStatus :: ReadModify => { self . expander . read_modify_bank_config ( bank as u8 , | cur | bank_config . merge ( cur ) ) ? ; } } } if self . expander_config_dirty { self . expander . write_config ( ) } else { Ok ( ( ) ) } }
Commit the configuration changes to the MAX7301.
Commit the configuration changes to the MAX7301 .
self
self