add cpu model to architectures for rust bindings

This commit is contained in:
lockbox
2023-07-13 13:58:14 -04:00
parent 84fe5d1756
commit 2f2bf8d96f
10 changed files with 720 additions and 5 deletions

View File

@@ -1,7 +1,8 @@
#![allow(non_camel_case_types)]
// TRICORE registers
#[repr(C)]
#[derive(PartialEq, Debug, Clone, Copy)]
#[allow(non_camel_case_types)]
pub enum RegisterTRICORE {
INVALID = 0,
A0 = 1,
@@ -135,3 +136,23 @@ impl From<RegisterTRICORE> for i32 {
r as i32
}
}
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum TricoreCpuModel {
UC_CPU_TRICORE_TC1796,
UC_CPU_TRICORE_TC1797,
UC_CPU_TRICORE_TC27X,
}
impl From<TricoreCpuModel> for i32 {
fn from(value: TricoreCpuModel) -> Self {
value as i32
}
}
impl From<&TricoreCpuModel> for i32 {
fn from(value: &TricoreCpuModel) -> Self {
(*value) as i32
}
}