1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
use crate::generic::*; #[doc = "Indicates the type of platform in use"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Platform(pub u32); impl Platform { #[doc = "Indicates the platform is an FPGA"] pub const fn fpga(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } #[doc = "Indicates the platform is an FPGA"] pub fn set_fpga(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } #[doc = "Indicates the platform is an ASIC"] pub const fn asic(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } #[doc = "Indicates the platform is an ASIC"] pub fn set_asic(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Platform { fn default() -> Platform { Platform(0) } }