1 //! Implementations for the TI-MSP430 family of MCUs. 2 3 use gdbstub::arch::{Arch, SingleStepGdbBehavior}; 4 5 pub mod reg; 6 7 /// Implements `Arch` for standard 16-bit TI-MSP430 MCUs. 8 pub struct Msp430 {} 9 10 impl Arch for Msp430 { 11 type Usize = u16; 12 type Registers = reg::Msp430Regs<u16>; 13 type RegId = reg::id::Msp430RegId<u16>; 14 type BreakpointKind = usize; 15 target_description_xml() -> Option<&'static str>16 fn target_description_xml() -> Option<&'static str> { 17 Some(r#"<target version="1.0"><architecture>msp430</architecture></target>"#) 18 } 19 20 #[inline(always)] single_step_gdb_behavior() -> SingleStepGdbBehavior21 fn single_step_gdb_behavior() -> SingleStepGdbBehavior { 22 SingleStepGdbBehavior::Required 23 } 24 } 25 26 /// Implements `Arch` for 20-bit TI-MSP430 MCUs (CPUX). 27 pub struct Msp430X {} 28 29 impl Arch for Msp430X { 30 type Usize = u32; 31 type Registers = reg::Msp430Regs<u32>; 32 type RegId = reg::id::Msp430RegId<u32>; 33 type BreakpointKind = usize; 34 target_description_xml() -> Option<&'static str>35 fn target_description_xml() -> Option<&'static str> { 36 Some(r#"<target version="1.0"><architecture>msp430x</architecture></target>"#) 37 } 38 39 #[inline(always)] single_step_gdb_behavior() -> SingleStepGdbBehavior40 fn single_step_gdb_behavior() -> SingleStepGdbBehavior { 41 SingleStepGdbBehavior::Required 42 } 43 } 44