* I want to do this, and I don't mind going unsafe and passing a ptr ```rust let mut p: embassy_stm32::Peripherals = embassy_stm32::init(config); let p_ptr: *mut embassy_stm32::Peripherals = p as *const embassy_stm32::Peripherals as *mut embassy_stm32::Peripherals; let p_mut: &mut embassy_stm32::Peripherals = unsafe { &mut *p_ptr }; error[E0605]: non-primitive cast: `embassy_stm32::Peripherals` as `*const embassy_stm32::Peripherals` --> src/main.rs:154:9 | 154 | p as *const embassy_stm32::Peripherals as *mut embassy_stm32::Peripherals; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid cast | help: consider borrowing the value | 154 | &p as *const embassy_stm32::Peripherals as *mut embassy_stm32::Peripherals; | + // if I do that error[E0382]: borrow of partially moved value: `p` --> src/main.rs:154:9 | 130 | let mut adc = Adc::new(p.ADC3, &mut Delay); | ------ value partially moved here ... 154 | &p as *const embassy_stm32::Peripherals as *mut embassy_stm32::Peripherals; | ^^ value borrowed here after partial move | = note: partial move occurs because `p.ADC3` has type `embassy_stm32::peripherals::ADC3`, which does not implement the `Copy` trait ``` Reason is I want to share `p` (the owned value) to other fns/closures but I can't due to the owned `p` being consumed. `&mut p` would be ideal though. I have created this helper ```rust mem::init_sdram( |sdram_size| { let mut sdram = // Refer to resources/Arduino_GIGA_R1_pins.xlsx for FMC pin config. Fmc::sdram_a12bits_d16bits_4banks_bank1( p.FMC, // snip long list of peripherals ``` where, ```rust pub fn init_sdram(f: impl FnOnce(usize) -> R, core_peri: &mut cortex_m::Peripherals) { ``` I wouldn't need the closure though if I could pass it as a ptr.