fn apply_config_master(
        &mut self,
        config: mdma::MdmaConfig,
        is_ahb: (bool, bool),
        transfer_length: usize,
    ) {
        self.stream.clear_interrupts();

        let (
            (source_size, destination_size),
            (source_offset, destination_offset),
        ) = Self::source_destination_size_offset(&config);

        // NOTE(unsafe) These values are correct for the generic types on
        // Transfer
        unsafe {
            self.stream.set_source_size(source_size);
            self.stream.set_destination_size(destination_size);
            self.stream.set_source_offset(source_offset);
            self.stream.set_destination_offset(destination_offset);
        }

        // Calculate burst sizes to apply
        let source_burst = Self::master_max_burst_size(
            is_ahb.0,
            transfer_length,
            config.source_increment,
            source_size,
            source_offset,
        );
        let source_burst = source_burst.min(config.source_burst_size);
        let destination_burst = Self::master_max_burst_size(
            is_ahb.1,
            transfer_length,
            config.destination_increment,
            destination_size,
            destination_offset,
        );
        let destination_burst =
            destination_burst.min(config.destination_burst_size);

        // Set burst sizes
        unsafe {
            self.stream.set_source_burst_size(source_burst.0);
            self.stream.set_destination_burst_size(destination_burst.0);
        }

        // Apply config, including offsets for this combination of configation
        // and source/destination sizes
        self.stream.apply_config(config);
    }
/// Applies all fields in MdmaConfig.
Applies all fields in MdmaConfig.
Applies all fields in MdmaConfig .
fn apply_config_master(
        &mut self,
        config: mdma::MdmaConfig,
        is_ahb: (bool, bool),
        transfer_length: usize,
    ) {
        self.stream.clear_interrupts();
        let (
            (source_size, destination_size),
            (source_offset, destination_offset),
        ) = Self::source_destination_size_offset(&config);
        // NOTE(unsafe) These values are correct for the generic types on
        // Transfer
        unsafe {
            self.stream.set_source_size(source_size);
            self.stream.set_destination_size(destination_size);
            self.stream.set_source_offset(source_offset);
            self.stream.set_destination_offset(destination_offset);
        }
        // Calculate burst sizes to apply
        let source_burst = Self::master_max_burst_size(
            is_ahb.0,
            transfer_length,
            config.source_increment,
            source_size,
            source_offset,
        );
        let source_burst = source_burst.min(config.source_burst_size);
        let destination_burst = Self::master_max_burst_size(
            is_ahb.1,
            transfer_length,
            config.destination_increment,
            destination_size,
            destination_offset,
        );
        let destination_burst =
            destination_burst.min(config.destination_burst_size);
        // Set burst sizes
        unsafe {
            self.stream.set_source_burst_size(source_burst.0);
            self.stream.set_destination_burst_size(destination_burst.0);
        }
        // Apply config, including offsets for this combination of configation
        // and source/destination sizes
        self.stream.apply_config(config);
    }
fn apply_config_master ( & mut self , config : mdma :: MdmaConfig , is_ahb : ( bool , bool ) , transfer_length : usize , ) { self . stream . clear_interrupts ( ) ; let ( ( source_size , destination_size ) , ( source_offset , destination_offset ) , ) = Self :: source_destination_size_offset ( & config ) ; // NOTE(unsafe) These values are correct for the generic types on // Transfer unsafe { self . stream . set_source_size ( source_size ) ; self . stream . set_destination_size ( destination_size ) ; self . stream . set_source_offset ( source_offset ) ; self . stream . set_destination_offset ( destination_offset ) ; } // Calculate burst sizes to apply let source_burst = Self :: master_max_burst_size ( is_ahb . 0 , transfer_length , config . source_increment , source_size , source_offset , ) ; let source_burst = source_burst . min ( config . source_burst_size ) ; let destination_burst = Self :: master_max_burst_size ( is_ahb . 1 , transfer_length , config . destination_increment , destination_size , destination_offset , ) ; let destination_burst = destination_burst . min ( config . destination_burst_size ) ; // Set burst sizes unsafe { self . stream . set_source_burst_size ( source_burst . 0 ) ; self . stream . set_destination_burst_size ( destination_burst . 0 ) ; } // Apply config, including offsets for this combination of configation // and source/destination sizes self . stream . apply_config ( config ) ; }
Applies all fields in MdmaConfig.
Applies all fields in MdmaConfig .
&mut self
config
mdma::MdmaConfig
is_ahb
(bool, bool)
transfer_length
usize
&mut self
config
mdma::MdmaConfig
is_ahb
(bool, bool)
transfer_length
usize