pub mod extended;
pub mod generic;
pub mod hw_reduced;
pub mod hw_reg;
#[derive(Copy, Clone)]
pub struct GenericCommunicationsChannelCommandField(u16);
impl GenericCommunicationsChannelCommandField {
pub const fn command(&self) -> u8 {
(self.0 & 0x00FF) as u8
}
pub const fn notify_on_completion(&self) -> bool {
self.0 & 0x8000 != 0
}
}
#[derive(Copy, Clone)]
pub struct GenericCommunicationsChannelStatusField(u16);
impl GenericCommunicationsChannelStatusField {
pub const fn command_complete(&self) -> bool {
self.0 & 0b0001 != 0
}
pub const fn platform_interrupt(&self) -> bool {
self.0 & 0b0010 != 0
}
pub const fn error(&self) -> bool {
self.0 & 0b0100 != 0
}
pub const fn platform_notification(&self) -> bool {
self.0 & 0b1000 != 0
}
}
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct GenericCommunicationsChannelSMR {
pub signature: u32,
pub command: GenericCommunicationsChannelCommandField,
pub status: GenericCommunicationsChannelStatusField,
pub communication_subspace: [u8; 0],
}
#[derive(Copy, Clone)]
pub struct MasterSlaveCommunicationsChannelFlags(u32);
impl MasterSlaveCommunicationsChannelFlags {
pub const fn notify_on_completion(&self) -> bool {
self.0 & 0b1 != 0
}
}
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct MasterSlaveCommunicationsChannelSMR {
pub signature: u32,
pub flags: MasterSlaveCommunicationsChannelFlags,
pub length: u32,
pub command: u32,
pub communication_subspace: [u8; 0]
}
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct ReducedPCCSubspaceSMR {
pub signature: u32,
pub communication_subspace: [u8; 0]
}