pub fn erase_command(&self, command: Command, address: u32) -> Result<(), Error> {
        match command {
            //TODO verify this list of commands
            Command::EraseSector | Command::EraseBlock => {
                let tfm = TransferMode {
                    address_enable: true,
                    instruction_enable: true,
                    ..TransferMode::default()
                };
                unsafe {
                    self.run_write_instruction(command, tfm, address, &[]);
                }
            }
            Command::EraseChip => {
                let tfm = TransferMode {
                    instruction_enable: true,
                    ..TransferMode::default()
                };
                unsafe {
                    self.run_read_instruction(command, tfm, 0, &mut [], true);
                }
            }
            _ => return Err(Error::CommandFunctionMismatch),
        }

        Ok(())
    }
/// Run one of the erase commands
Run one of the erase commands
Run one of the erase commands
pub fn erase_command(&self, command: Command, address: u32) -> Result<(), Error> {
        match command {
            //TODO verify this list of commands
            Command::EraseSector | Command::EraseBlock => {
                let tfm = TransferMode {
                    address_enable: true,
                    instruction_enable: true,
                    ..TransferMode::default()
                };
                unsafe {
                    self.run_write_instruction(command, tfm, address, &[]);
                }
            }
            Command::EraseChip => {
                let tfm = TransferMode {
                    instruction_enable: true,
                    ..TransferMode::default()
                };
                unsafe {
                    self.run_read_instruction(command, tfm, 0, &mut [], true);
                }
            }
            _ => return Err(Error::CommandFunctionMismatch),
        }
        Ok(())
    }
pub fn erase_command ( & self , command : Command , address : u32 ) -> Result < ( ) , Error > { match command { //TODO verify this list of commands Command :: EraseSector | Command :: EraseBlock => { let tfm = TransferMode { address_enable : true , instruction_enable : true , .. TransferMode :: default ( ) } ; unsafe { self . run_write_instruction ( command , tfm , address , & [ ] ) ; } } Command :: EraseChip => { let tfm = TransferMode { instruction_enable : true , .. TransferMode :: default ( ) } ; unsafe { self . run_read_instruction ( command , tfm , 0 , & mut [ ] , true ) ; } } _ => return Err ( Error :: CommandFunctionMismatch ) , } Ok ( ( ) ) }
Run one of the erase commands
Run one of the erase commands
&self
command
Command
address
u32
&self
command
Command
address
u32