unsafe fn copy_settings(&self, from: *const RegisterBlock, to: *const RegisterBlock) {
        macro_rules! copy_bits {
            ($REG:ident, $mask:expr) => {{
                let source_register = ral::read_reg!(ral::gpio, from, $REG);
                let target_bits = $mask & source_register;

                ral::modify_reg!(ral::gpio, to, $REG, |mut destination| {
                    // Set the bit low...
                    destination &= !$mask;
                    // OR in the previous setting...
                    destination | target_bits
                });
            }};
        }

        // The input / output direction. When switching across fast / normal, keep the
        // same direction.
        copy_bits!(GDIR, self.mask());
    }
/// Copies the settings for one GPIO register block, `from`, to another register block, `to`.
///
/// This method runs when changing from a normal to a fast GPIO, or a fast to a normal GPIO.
/// The goal is to make the switch seamless for the end user. You must only copy the settings
/// for the current GPIO pin.
///
/// # Safety
///
/// This method must run in a critical section, since it performs reads and writes across
/// multiple register blocks which are shared across multiple pins.
Copies the settings for one GPIO register block, `from`, to another register block, `to`.
This method runs when changing from a normal to a fast GPIO, or a fast to a normal GPIO.
The goal is to make the switch seamless for the end user. You must only copy the settings
for the current GPIO pin.
Copies the settings for one GPIO register block ` from ` to another register block ` to ` . This method runs when changing from a normal to a fast GPIO or a fast to a normal GPIO . The goal is to make the switch seamless for the end user . You must only copy the settings for the current GPIO pin .
unsafe fn copy_settings(&self, from: *const RegisterBlock, to: *const RegisterBlock) {
        macro_rules! copy_bits {
            ($REG:ident, $mask:expr) => {{
                let source_register = ral::read_reg!(ral::gpio, from, $REG);
                let target_bits = $mask & source_register;
                ral::modify_reg!(ral::gpio, to, $REG, |mut destination| {
                    // Set the bit low...
                    destination &= !$mask;
                    // OR in the previous setting...
                    destination | target_bits
                });
            }};
        }
        // The input / output direction. When switching across fast / normal, keep the
        // same direction.
        copy_bits!(GDIR, self.mask());
    }
unsafe fn copy_settings ( & self , from : * const RegisterBlock , to : * const RegisterBlock ) { macro_rules! copy_bits { ( $REG : ident $mask : expr ) => { { let source_register ral read_reg ( ral gpio from $REG ) let target_bits $mask source_register ral modify_reg ( ral gpio to $REG mut destination { // Set the bit low... destination $mask // OR in the previous setting... destination target_bits } ) } } ; } // The input / output direction. When switching across fast / normal, keep the // same direction. copy_bits ! ( GDIR self mask ( ) ) ; }
Copies the settings for one GPIO register block, `from`, to another register block, `to`.
Copies the settings for one GPIO register block ` from ` to another register block ` to ` .
&self
from
*const RegisterBlock
to
*const RegisterBlock
safety
This method must run in a critical section, since it performs reads and writes across
multiple register blocks which are shared across multiple pins.
This method must run in a critical section since it performs reads and writes across multiple register blocks which are shared across multiple pins .