Hi.
I've been studying cortex-m crate code. Mostly the ITM struct. What I can't understand is how is it possible for code:
#![no_main]
#![no_std]
use panic_itm as _;
use stm32f1xx_hal as _;
use cortex_m::{iprintln, Peripherals};
use cortex_m_rt::entry;
#[entry]
fn main() -> ! {
let mut p = Peripherals::take().unwrap();
let stim = &mut p.ITM.stim[0];
iprintln!(stim, "Hello, world!");
loop {}
}
To even compile and work. ITM struct foes not have any fields. RegisterBlock is created while accessing any field in ITM struct ?. Looks like a black magic for me.